• 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 #include "mojo/public/cpp/bindings/lib/task_runner_helper.h"
6 
7 #include "base/sequenced_task_runner.h"
8 #include "base/threading/sequenced_task_runner_handle.h"
9 
10 namespace mojo {
11 namespace internal {
12 
13 scoped_refptr<base::SequencedTaskRunner>
GetTaskRunnerToUseFromUserProvidedTaskRunner(scoped_refptr<base::SequencedTaskRunner> runner)14 GetTaskRunnerToUseFromUserProvidedTaskRunner(
15     scoped_refptr<base::SequencedTaskRunner> runner) {
16   if (runner) {
17     DCHECK(runner->RunsTasksInCurrentSequence());
18     return runner;
19   }
20   return base::SequencedTaskRunnerHandle::Get();
21 }
22 
23 }  // namespace internal
24 }  // namespace mojo
25