• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_TASK_RUNNER_HELPER_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_TASK_RUNNER_HELPER_H_
7 
8 #include "base/memory/ref_counted.h"
9 
10 namespace base {
11 class SequencedTaskRunner;
12 }  // namespace base
13 
14 namespace mojo {
15 namespace internal {
16 
17 // Returns the SequencedTaskRunner to use from the optional user-provided
18 // SequencedTaskRunner. If |runner| is provided non-null, it is returned.
19 // Otherwise, SequencedTaskRunnerHandle::Get() is returned. If |runner| is non-
20 // null, it must run tasks on the current sequence.
21 scoped_refptr<base::SequencedTaskRunner>
22 GetTaskRunnerToUseFromUserProvidedTaskRunner(
23     scoped_refptr<base::SequencedTaskRunner> runner);
24 
25 }  // namespace internal
26 }  // namespace mojo
27 
28 #endif  // MOJO_PUBLIC_CPP_BINDINGS_LIB_TASK_RUNNER_HELPER_H_
29