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 11 matching lines...) Expand all Loading... |
22 } | 22 } |
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 class BlockingTaskRunner; |
33 class LayerTreeDebugState; | 33 class LayerTreeDebugState; |
34 class OutputSurface; | 34 class OutputSurface; |
35 struct RendererCapabilities; | 35 struct RendererCapabilities; |
36 | 36 |
37 // Abstract class responsible for proxying commands from the main-thread side of | 37 // Abstract class responsible for proxying commands from the main-thread side of |
38 // the compositor over to the compositor implementation. | 38 // the compositor over to the compositor implementation. |
39 class CC_EXPORT Proxy { | 39 class CC_EXPORT Proxy { |
40 public: | 40 public: |
41 base::SingleThreadTaskRunner* MainThreadTaskRunner() const; | 41 base::SingleThreadTaskRunner* MainThreadTaskRunner() const; |
42 bool HasImplThread() const; | 42 bool HasImplThread() const; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 virtual bool SupportsImplScrolling() const = 0; | 97 virtual bool SupportsImplScrolling() const = 0; |
98 | 98 |
99 virtual void AsValueInto(base::debug::TracedValue* value) const = 0; | 99 virtual void AsValueInto(base::debug::TracedValue* value) const = 0; |
100 | 100 |
101 virtual void SetDebugState(const LayerTreeDebugState& debug_state) = 0; | 101 virtual void SetDebugState(const LayerTreeDebugState& debug_state) = 0; |
102 | 102 |
103 // Testing hooks | 103 // Testing hooks |
104 virtual bool MainFrameWillHappenForTesting() = 0; | 104 virtual bool MainFrameWillHappenForTesting() = 0; |
105 | 105 |
| 106 BlockingTaskRunner* blocking_main_thread_task_runner() const { |
| 107 return blocking_main_thread_task_runner_.get(); |
| 108 } |
| 109 |
106 protected: | 110 protected: |
107 Proxy(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 111 Proxy(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
108 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 112 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
109 friend class DebugScopedSetImplThread; | 113 friend class DebugScopedSetImplThread; |
110 friend class DebugScopedSetMainThread; | 114 friend class DebugScopedSetMainThread; |
111 friend class DebugScopedSetMainThreadBlocked; | 115 friend class DebugScopedSetMainThreadBlocked; |
112 | 116 |
113 private: | 117 private: |
114 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 118 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
115 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_; | 119 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_; |
| 120 scoped_ptr<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 |