OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_PROXY_H_ | 5 #ifndef CC_TREES_PROXY_H_ |
6 #define CC_TREES_PROXY_H_ | 6 #define CC_TREES_PROXY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 class SingleThreadTaskRunner; | 23 class SingleThreadTaskRunner; |
24 } | 24 } |
25 | 25 |
26 namespace gfx { | 26 namespace gfx { |
27 class Rect; | 27 class Rect; |
28 class Vector2d; | 28 class Vector2d; |
29 } | 29 } |
30 | 30 |
31 namespace cc { | 31 namespace cc { |
32 | 32 |
| 33 class BlockingTaskRunner; |
33 class LayerTreeDebugState; | 34 class LayerTreeDebugState; |
34 class OutputSurface; | 35 class OutputSurface; |
35 struct RendererCapabilities; | 36 struct RendererCapabilities; |
36 | 37 |
37 // Abstract class responsible for proxying commands from the main-thread side of | 38 // Abstract class responsible for proxying commands from the main-thread side of |
38 // the compositor over to the compositor implementation. | 39 // the compositor over to the compositor implementation. |
39 class CC_EXPORT Proxy { | 40 class CC_EXPORT Proxy { |
40 public: | 41 public: |
41 base::SingleThreadTaskRunner* MainThreadTaskRunner() const; | 42 base::SingleThreadTaskRunner* MainThreadTaskRunner() const; |
42 bool HasImplThread() const; | 43 bool HasImplThread() const; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 protected: | 107 protected: |
107 Proxy(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 108 Proxy(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
108 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 109 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
109 friend class DebugScopedSetImplThread; | 110 friend class DebugScopedSetImplThread; |
110 friend class DebugScopedSetMainThread; | 111 friend class DebugScopedSetMainThread; |
111 friend class DebugScopedSetMainThreadBlocked; | 112 friend class DebugScopedSetMainThreadBlocked; |
112 | 113 |
113 private: | 114 private: |
114 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 115 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
115 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_; | 116 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_; |
| 117 |
| 118 // Blocking task runner which forwards tasks to |main_task_runner_| while the |
| 119 // Proxy is alive. |
| 120 scoped_refptr<BlockingTaskRunner> blocking_main_thread_task_runner_; |
| 121 |
116 #if DCHECK_IS_ON | 122 #if DCHECK_IS_ON |
117 const base::PlatformThreadId main_thread_id_; | 123 const base::PlatformThreadId main_thread_id_; |
118 bool impl_thread_is_overridden_; | 124 bool impl_thread_is_overridden_; |
119 bool is_main_thread_blocked_; | 125 bool is_main_thread_blocked_; |
120 #endif | 126 #endif |
121 | 127 |
122 DISALLOW_COPY_AND_ASSIGN(Proxy); | 128 DISALLOW_COPY_AND_ASSIGN(Proxy); |
123 }; | 129 }; |
124 | 130 |
125 #if DCHECK_IS_ON | 131 #if DCHECK_IS_ON |
(...skipping 17 matching lines...) Expand all Loading... |
143 explicit DebugScopedSetMainThreadBlocked(Proxy* proxy) {} | 149 explicit DebugScopedSetMainThreadBlocked(Proxy* proxy) {} |
144 ~DebugScopedSetMainThreadBlocked() {} | 150 ~DebugScopedSetMainThreadBlocked() {} |
145 private: | 151 private: |
146 DISALLOW_COPY_AND_ASSIGN(DebugScopedSetMainThreadBlocked); | 152 DISALLOW_COPY_AND_ASSIGN(DebugScopedSetMainThreadBlocked); |
147 }; | 153 }; |
148 #endif | 154 #endif |
149 | 155 |
150 } // namespace cc | 156 } // namespace cc |
151 | 157 |
152 #endif // CC_TREES_PROXY_H_ | 158 #endif // CC_TREES_PROXY_H_ |
OLD | NEW |