OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_TREES_TASK_RUNNER_PROVIDER_H_ | 5 #ifndef CC_TREES_TASK_RUNNER_PROVIDER_H_ |
6 #define CC_TREES_TASK_RUNNER_PROVIDER_H_ | 6 #define CC_TREES_TASK_RUNNER_PROVIDER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 // Useful for assertion checks. | 32 // Useful for assertion checks. |
33 class CC_EXPORT TaskRunnerProvider { | 33 class CC_EXPORT TaskRunnerProvider { |
34 public: | 34 public: |
35 static std::unique_ptr<TaskRunnerProvider> Create( | 35 static std::unique_ptr<TaskRunnerProvider> Create( |
36 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 36 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
37 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) { | 37 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) { |
38 return base::WrapUnique( | 38 return base::WrapUnique( |
39 new TaskRunnerProvider(main_task_runner, impl_task_runner)); | 39 new TaskRunnerProvider(main_task_runner, impl_task_runner)); |
40 } | 40 } |
41 | 41 |
| 42 // TODO(vmpstr): Should these return scoped_refptr to task runners? Many |
| 43 // places turn them into scoped_refptrs. How many of them need to? |
42 base::SingleThreadTaskRunner* MainThreadTaskRunner() const; | 44 base::SingleThreadTaskRunner* MainThreadTaskRunner() const; |
43 bool HasImplThread() const; | 45 bool HasImplThread() const; |
44 base::SingleThreadTaskRunner* ImplThreadTaskRunner() const; | 46 base::SingleThreadTaskRunner* ImplThreadTaskRunner() const; |
45 | 47 |
46 // Debug hooks. | 48 // Debug hooks. |
47 bool IsMainThread() const; | 49 bool IsMainThread() const; |
48 bool IsImplThread() const; | 50 bool IsImplThread() const; |
49 bool IsMainThreadBlocked() const; | 51 bool IsMainThreadBlocked() const; |
50 #if DCHECK_IS_ON() | 52 #if DCHECK_IS_ON() |
51 void SetMainThreadBlocked(bool is_main_thread_blocked); | 53 void SetMainThreadBlocked(bool is_main_thread_blocked); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 ~DebugScopedSetMainThreadBlocked() {} | 109 ~DebugScopedSetMainThreadBlocked() {} |
108 | 110 |
109 private: | 111 private: |
110 DISALLOW_COPY_AND_ASSIGN(DebugScopedSetMainThreadBlocked); | 112 DISALLOW_COPY_AND_ASSIGN(DebugScopedSetMainThreadBlocked); |
111 }; | 113 }; |
112 #endif | 114 #endif |
113 | 115 |
114 } // namespace cc | 116 } // namespace cc |
115 | 117 |
116 #endif // CC_TREES_TASK_RUNNER_PROVIDER_H_ | 118 #endif // CC_TREES_TASK_RUNNER_PROVIDER_H_ |
OLD | NEW |