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 #include "config.h" | 5 #include "config.h" |
6 #include "core/dom/CompositorProxy.h" | 6 #include "core/dom/CompositorProxy.h" |
7 | 7 |
8 #include "bindings/core/v8/ExceptionMessages.h" | 8 #include "bindings/core/v8/ExceptionMessages.h" |
9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
10 #include "core/dom/DOMNodeIds.h" | 10 #include "core/dom/DOMNodeIds.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 incrementProxyCountForElement(m_elementId); | 141 incrementProxyCountForElement(m_elementId); |
142 } | 142 } |
143 | 143 |
144 CompositorProxy::CompositorProxy(uint64_t elementId, uint32_t attributeFlags) | 144 CompositorProxy::CompositorProxy(uint64_t elementId, uint32_t attributeFlags) |
145 : m_elementId(elementId) | 145 : m_elementId(elementId) |
146 , m_bitfieldsSupported(attributeFlags) | 146 , m_bitfieldsSupported(attributeFlags) |
147 { | 147 { |
148 ASSERT(isControlThread()); | 148 ASSERT(isControlThread()); |
149 ASSERT(sanityCheckAttributeFlags(m_bitfieldsSupported)); | 149 ASSERT(sanityCheckAttributeFlags(m_bitfieldsSupported)); |
150 Platform::current()->mainThread()->postTask(FROM_HERE, threadSafeBind(&incre
mentProxyCountForElement, m_elementId)); | 150 Platform::current()->mainThread()->taskRunner()->postTask(FROM_HERE, threadS
afeBind(&incrementProxyCountForElement, m_elementId)); |
151 } | 151 } |
152 | 152 |
153 CompositorProxy::~CompositorProxy() | 153 CompositorProxy::~CompositorProxy() |
154 { | 154 { |
155 if (m_connected) | 155 if (m_connected) |
156 disconnect(); | 156 disconnect(); |
157 } | 157 } |
158 | 158 |
159 bool CompositorProxy::supports(const String& attributeName) const | 159 bool CompositorProxy::supports(const String& attributeName) const |
160 { | 160 { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 m_connected ? "Attempted to mutate non-mutable attribute." : "Attempted
to mutate attribute on a disconnected proxy."); | 245 m_connected ? "Attempted to mutate non-mutable attribute." : "Attempted
to mutate attribute on a disconnected proxy."); |
246 return true; | 246 return true; |
247 } | 247 } |
248 | 248 |
249 void CompositorProxy::disconnect() | 249 void CompositorProxy::disconnect() |
250 { | 250 { |
251 m_connected = false; | 251 m_connected = false; |
252 if (isMainThread()) | 252 if (isMainThread()) |
253 decrementCountForElement(m_elementId); | 253 decrementCountForElement(m_elementId); |
254 else | 254 else |
255 Platform::current()->mainThread()->postTask(FROM_HERE, threadSafeBind(&d
ecrementCountForElement, m_elementId)); | 255 Platform::current()->mainThread()->taskRunner()->postTask(FROM_HERE, thr
eadSafeBind(&decrementCountForElement, m_elementId)); |
256 } | 256 } |
257 | 257 |
258 } // namespace blink | 258 } // namespace blink |
OLD | NEW |