Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: third_party/WebKit/Source/core/dom/CompositorProxy.cpp

Issue 2104913002: Rename threadSafeBind() to crossThreadBind() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@TRV_CTCPointer
Patch Set: Rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "core/dom/CompositorProxy.h" 5 #include "core/dom/CompositorProxy.h"
6 6
7 #include "bindings/core/v8/ExceptionMessages.h" 7 #include "bindings/core/v8/ExceptionMessages.h"
8 #include "bindings/core/v8/ExceptionState.h" 8 #include "bindings/core/v8/ExceptionState.h"
9 #include "core/dom/DOMNodeIds.h" 9 #include "core/dom/DOMNodeIds.h"
10 #include "core/dom/ExceptionCode.h" 10 #include "core/dom/ExceptionCode.h"
11 #include "core/dom/ExecutionContext.h" 11 #include "core/dom/ExecutionContext.h"
12 #include "core/workers/WorkerClients.h" 12 #include "core/workers/WorkerClients.h"
13 #include "core/workers/WorkerGlobalScope.h" 13 #include "core/workers/WorkerGlobalScope.h"
14 #include "platform/ThreadSafeFunctional.h" 14 #include "platform/CrossThreadFunctional.h"
15 #include "platform/graphics/CompositorMutableProperties.h" 15 #include "platform/graphics/CompositorMutableProperties.h"
16 #include "public/platform/Platform.h" 16 #include "public/platform/Platform.h"
17 #include "public/platform/WebTraceLocation.h" 17 #include "public/platform/WebTraceLocation.h"
18 #include <algorithm> 18 #include <algorithm>
19 19
20 namespace blink { 20 namespace blink {
21 21
22 static const struct { 22 static const struct {
23 const char* name; 23 const char* name;
24 uint32_t property; 24 uint32_t property;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 , m_client(nullptr) 132 , m_client(nullptr)
133 { 133 {
134 DCHECK(m_compositorMutableProperties); 134 DCHECK(m_compositorMutableProperties);
135 #if DCHECK_IS_ON() 135 #if DCHECK_IS_ON()
136 DCHECK(sanityCheckMutableProperties(m_compositorMutableProperties)); 136 DCHECK(sanityCheckMutableProperties(m_compositorMutableProperties));
137 #endif 137 #endif
138 138
139 if (isMainThread()) { 139 if (isMainThread()) {
140 incrementCompositorProxiedPropertiesForElement(m_elementId, m_compositor MutableProperties); 140 incrementCompositorProxiedPropertiesForElement(m_elementId, m_compositor MutableProperties);
141 } else { 141 } else {
142 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FR OM_HERE, threadSafeBind(&incrementCompositorProxiedPropertiesForElement, m_eleme ntId, m_compositorMutableProperties)); 142 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FR OM_HERE, crossThreadBind(&incrementCompositorProxiedPropertiesForElement, m_elem entId, m_compositorMutableProperties));
143 } 143 }
144 } 144 }
145 145
146 CompositorProxy::CompositorProxy(Element& element, const Vector<String>& attribu teArray) 146 CompositorProxy::CompositorProxy(Element& element, const Vector<String>& attribu teArray)
147 : CompositorProxy(DOMNodeIds::idForNode(&element), compositorMutableProperti esFromNames(attributeArray)) 147 : CompositorProxy(DOMNodeIds::idForNode(&element), compositorMutableProperti esFromNames(attributeArray))
148 { 148 {
149 DCHECK(isMainThread()); 149 DCHECK(isMainThread());
150 } 150 }
151 151
152 CompositorProxy::CompositorProxy(uint64_t elementId, uint32_t compositorMutableP roperties, CompositorProxyClient* client) 152 CompositorProxy::CompositorProxy(uint64_t elementId, uint32_t compositorMutableP roperties, CompositorProxyClient* client)
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 } 269 }
270 270
271 void CompositorProxy::disconnectInternal() 271 void CompositorProxy::disconnectInternal()
272 { 272 {
273 if (!m_connected) 273 if (!m_connected)
274 return; 274 return;
275 m_connected = false; 275 m_connected = false;
276 if (isMainThread()) { 276 if (isMainThread()) {
277 decrementCompositorProxiedPropertiesForElement(m_elementId, m_compositor MutableProperties); 277 decrementCompositorProxiedPropertiesForElement(m_elementId, m_compositor MutableProperties);
278 } else { 278 } else {
279 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FR OM_HERE, threadSafeBind(&decrementCompositorProxiedPropertiesForElement, m_eleme ntId, m_compositorMutableProperties)); 279 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FR OM_HERE, crossThreadBind(&decrementCompositorProxiedPropertiesForElement, m_elem entId, m_compositorMutableProperties));
280 } 280 }
281 } 281 }
282 282
283 } // namespace blink 283 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp ('k') | third_party/WebKit/Source/core/dom/CrossThreadTask.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698