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_PROXY_H_ | 5 #ifndef CC_PROXY_H_ |
6 #define CC_PROXY_H_ | 6 #define CC_PROXY_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
110 DISALLOW_COPY_AND_ASSIGN(Proxy); | 110 DISALLOW_COPY_AND_ASSIGN(Proxy); |
111 | 111 |
112 scoped_ptr<Thread> m_mainThread; | 112 scoped_ptr<Thread> m_mainThread; |
113 scoped_ptr<Thread> m_implThread; | 113 scoped_ptr<Thread> m_implThread; |
114 #ifndef NDEBUG | 114 #ifndef NDEBUG |
115 bool m_implThreadIsOverridden; | 115 bool m_implThreadIsOverridden; |
116 bool m_isMainThreadBlocked; | 116 bool m_isMainThreadBlocked; |
117 #endif | 117 #endif |
118 }; | 118 }; |
119 | 119 |
120 #ifndef NDEBUG | |
120 class DebugScopedSetMainThreadBlocked { | 121 class DebugScopedSetMainThreadBlocked { |
121 public: | 122 public: |
122 explicit DebugScopedSetMainThreadBlocked(Proxy* proxy) | 123 explicit DebugScopedSetMainThreadBlocked(Proxy* proxy) |
123 : m_proxy(proxy) | 124 : m_proxy(proxy) |
danakj
2012/11/21 20:23:59
Just #ifndef around this and the private variable
piman
2012/11/21 20:44:06
If you prefer, but I found that this version was a
danakj
2012/11/21 20:52:23
Ah, right. I had noticed the parameter in the #els
| |
124 { | 125 { |
125 #ifndef NDEBUG | |
126 DCHECK(!m_proxy->isMainThreadBlocked()); | 126 DCHECK(!m_proxy->isMainThreadBlocked()); |
127 m_proxy->setMainThreadBlocked(true); | 127 m_proxy->setMainThreadBlocked(true); |
128 #endif | |
129 } | 128 } |
130 ~DebugScopedSetMainThreadBlocked() | 129 ~DebugScopedSetMainThreadBlocked() |
131 { | 130 { |
132 #ifndef NDEBUG | |
133 DCHECK(m_proxy->isMainThreadBlocked()); | 131 DCHECK(m_proxy->isMainThreadBlocked()); |
134 m_proxy->setMainThreadBlocked(false); | 132 m_proxy->setMainThreadBlocked(false); |
135 #endif | |
136 } | 133 } |
137 private: | 134 private: |
138 Proxy* m_proxy; | 135 Proxy* m_proxy; |
139 }; | 136 }; |
137 #else | |
138 class DebugScopedSetMainThreadBlocked { | |
139 public: | |
140 explicit DebugScopedSetMainThreadBlocked(Proxy*) { } | |
141 ~DebugScopedSetMainThreadBlocked() { } | |
142 }; | |
143 #endif | |
140 | 144 |
141 } | 145 } |
142 | 146 |
143 #endif // CC_PROXY_H_ | 147 #endif // CC_PROXY_H_ |
OLD | NEW |