Chromium Code Reviews| 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" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/threading/platform_thread.h" | 14 #include "base/threading/platform_thread.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "base/values.h" | 16 #include "base/values.h" |
| 17 #include "cc/base/cc_export.h" | 17 #include "cc/base/cc_export.h" |
| 18 #include "cc/trees/blocking_task_runner.h" | |
| 18 | 19 |
| 19 namespace base { | 20 namespace base { |
| 20 namespace debug { | 21 namespace debug { |
| 21 class TracedValue; | 22 class TracedValue; |
| 22 } | 23 } |
| 23 class SingleThreadTaskRunner; | 24 class SingleThreadTaskRunner; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace gfx { | 27 namespace gfx { |
| 27 class Rect; | 28 class Rect; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 | 97 |
| 97 virtual bool SupportsImplScrolling() const = 0; | 98 virtual bool SupportsImplScrolling() const = 0; |
| 98 | 99 |
| 99 virtual void AsValueInto(base::debug::TracedValue* value) const = 0; | 100 virtual void AsValueInto(base::debug::TracedValue* value) const = 0; |
| 100 | 101 |
| 101 virtual void SetDebugState(const LayerTreeDebugState& debug_state) = 0; | 102 virtual void SetDebugState(const LayerTreeDebugState& debug_state) = 0; |
| 102 | 103 |
| 103 // Testing hooks | 104 // Testing hooks |
| 104 virtual bool MainFrameWillHappenForTesting() = 0; | 105 virtual bool MainFrameWillHappenForTesting() = 0; |
| 105 | 106 |
| 107 scoped_refptr<BlockingTaskRunner> blocking_main_thread_task_runner() const { | |
|
danakj
2014/08/28 17:10:46
could this return a raw pointer?
Sami
2014/08/28 18:21:17
Yep, done.
| |
| 108 return blocking_main_thread_task_runner_; | |
| 109 } | |
| 110 | |
| 106 protected: | 111 protected: |
| 107 Proxy(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 112 Proxy(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 108 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 113 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
| 109 friend class DebugScopedSetImplThread; | 114 friend class DebugScopedSetImplThread; |
| 110 friend class DebugScopedSetMainThread; | 115 friend class DebugScopedSetMainThread; |
| 111 friend class DebugScopedSetMainThreadBlocked; | 116 friend class DebugScopedSetMainThreadBlocked; |
| 112 | 117 |
| 113 private: | 118 private: |
| 114 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 119 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
| 115 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_; | 120 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_; |
| 121 scoped_refptr<BlockingTaskRunner> blocking_main_thread_task_runner_; | |
| 122 | |
| 116 #if DCHECK_IS_ON | 123 #if DCHECK_IS_ON |
| 117 const base::PlatformThreadId main_thread_id_; | 124 const base::PlatformThreadId main_thread_id_; |
| 118 bool impl_thread_is_overridden_; | 125 bool impl_thread_is_overridden_; |
| 119 bool is_main_thread_blocked_; | 126 bool is_main_thread_blocked_; |
| 120 #endif | 127 #endif |
| 121 | 128 |
| 122 DISALLOW_COPY_AND_ASSIGN(Proxy); | 129 DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 123 }; | 130 }; |
| 124 | 131 |
| 125 #if DCHECK_IS_ON | 132 #if DCHECK_IS_ON |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 143 explicit DebugScopedSetMainThreadBlocked(Proxy* proxy) {} | 150 explicit DebugScopedSetMainThreadBlocked(Proxy* proxy) {} |
| 144 ~DebugScopedSetMainThreadBlocked() {} | 151 ~DebugScopedSetMainThreadBlocked() {} |
| 145 private: | 152 private: |
| 146 DISALLOW_COPY_AND_ASSIGN(DebugScopedSetMainThreadBlocked); | 153 DISALLOW_COPY_AND_ASSIGN(DebugScopedSetMainThreadBlocked); |
| 147 }; | 154 }; |
| 148 #endif | 155 #endif |
| 149 | 156 |
| 150 } // namespace cc | 157 } // namespace cc |
| 151 | 158 |
| 152 #endif // CC_TREES_PROXY_H_ | 159 #endif // CC_TREES_PROXY_H_ |
| OLD | NEW |