Roll src/third_party/WebKit a05b987:7eb2976 (svn 202510:202511)
[chromium-blink-merge.git] / mojo / runner / task_runners.h
blob5a51bb8d3ecfa1ad25b2ba37515a043ec5942bfa
1 // Copyright 2013 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.
5 #ifndef MOJO_RUNNER_TASK_RUNNERS_H_
6 #define MOJO_RUNNER_TASK_RUNNERS_H_
8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/threading/thread.h"
13 namespace base {
14 class SequencedWorkerPool;
17 namespace mojo {
18 namespace runner {
20 // A context object that contains the common task runners for the shell's main
21 // process.
22 class TaskRunners {
23 public:
24 explicit TaskRunners(
25 const scoped_refptr<base::SingleThreadTaskRunner>& shell_runner);
26 ~TaskRunners();
28 base::SingleThreadTaskRunner* shell_runner() const {
29 return shell_runner_.get();
32 base::SingleThreadTaskRunner* io_runner() const {
33 return io_thread_->task_runner().get();
36 base::SequencedWorkerPool* blocking_pool() const {
37 return blocking_pool_.get();
40 private:
41 scoped_refptr<base::SingleThreadTaskRunner> shell_runner_;
42 scoped_ptr<base::Thread> io_thread_;
44 scoped_refptr<base::SequencedWorkerPool> blocking_pool_;
46 DISALLOW_COPY_AND_ASSIGN(TaskRunners);
49 } // namespace runner
50 } // namespace mojo
52 #endif // MOJO_RUNNER_TASK_RUNNERS_H_