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

Side by Side Diff: third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp

Issue 2332963003: Unset CompositorWorkerGlobalScope during WorkerGlobalScope::dipose. (Closed)
Patch Set: Created 4 years, 3 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 "modules/compositorworker/CompositorWorkerGlobalScope.h" 5 #include "modules/compositorworker/CompositorWorkerGlobalScope.h"
6 6
7 #include "bindings/core/v8/SerializedScriptValue.h" 7 #include "bindings/core/v8/SerializedScriptValue.h"
8 #include "core/workers/InProcessWorkerObjectProxy.h" 8 #include "core/workers/InProcessWorkerObjectProxy.h"
9 #include "core/workers/WorkerThreadStartupData.h" 9 #include "core/workers/WorkerThreadStartupData.h"
10 #include "modules/EventTargetModules.h" 10 #include "modules/EventTargetModules.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 { 42 {
43 visitor->trace(m_callbackCollection); 43 visitor->trace(m_callbackCollection);
44 WorkerGlobalScope::trace(visitor); 44 WorkerGlobalScope::trace(visitor);
45 } 45 }
46 46
47 const AtomicString& CompositorWorkerGlobalScope::interfaceName() const 47 const AtomicString& CompositorWorkerGlobalScope::interfaceName() const
48 { 48 {
49 return EventTargetNames::CompositorWorkerGlobalScope; 49 return EventTargetNames::CompositorWorkerGlobalScope;
50 } 50 }
51 51
52 void CompositorWorkerGlobalScope::removeAllEventListeners()
53 {
54 // Note, we may still have callbacks in m_callbackCollection, but this
55 // ensures that we will no longer try to call them after this global
56 // scope has been disposed.
57 CompositorProxyClient::from(clients())->setGlobalScope(nullptr);
58 }
59
52 void CompositorWorkerGlobalScope::postMessage(ExecutionContext* executionContext , PassRefPtr<SerializedScriptValue> message, const MessagePortArray& ports, Exce ptionState& exceptionState) 60 void CompositorWorkerGlobalScope::postMessage(ExecutionContext* executionContext , PassRefPtr<SerializedScriptValue> message, const MessagePortArray& ports, Exce ptionState& exceptionState)
53 { 61 {
54 // Disentangle the port in preparation for sending it to the remote context. 62 // Disentangle the port in preparation for sending it to the remote context.
55 std::unique_ptr<MessagePortChannelArray> channels = MessagePort::disentangle Ports(executionContext, ports, exceptionState); 63 std::unique_ptr<MessagePortChannelArray> channels = MessagePort::disentangle Ports(executionContext, ports, exceptionState);
56 if (exceptionState.hadException()) 64 if (exceptionState.hadException())
57 return; 65 return;
58 thread()->workerObjectProxy().postMessageToWorkerObject(std::move(message), std::move(channels)); 66 thread()->workerObjectProxy().postMessageToWorkerObject(std::move(message), std::move(channels));
59 } 67 }
60 68
61 int CompositorWorkerGlobalScope::requestAnimationFrame(FrameRequestCallback* cal lback) 69 int CompositorWorkerGlobalScope::requestAnimationFrame(FrameRequestCallback* cal lback)
(...skipping 15 matching lines...) Expand all
77 m_callbackCollection.executeCallbacks(highResTimeMs, highResTimeMs); 85 m_callbackCollection.executeCallbacks(highResTimeMs, highResTimeMs);
78 return !m_callbackCollection.isEmpty(); 86 return !m_callbackCollection.isEmpty();
79 } 87 }
80 88
81 CompositorWorkerThread* CompositorWorkerGlobalScope::thread() const 89 CompositorWorkerThread* CompositorWorkerGlobalScope::thread() const
82 { 90 {
83 return static_cast<CompositorWorkerThread*>(WorkerGlobalScope::thread()); 91 return static_cast<CompositorWorkerThread*>(WorkerGlobalScope::thread());
84 } 92 }
85 93
86 } // namespace blink 94 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698