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

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

Issue 2691333002: Replace [CallWith=ExecutionContext] with [CallWith=ScriptState] (Closed)
Patch Set: Created 3 years, 10 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 <memory>
8 #include "bindings/core/v8/ScriptState.h"
7 #include "bindings/core/v8/SerializedScriptValue.h" 9 #include "bindings/core/v8/SerializedScriptValue.h"
8 #include "core/dom/CompositorWorkerProxyClient.h" 10 #include "core/dom/CompositorWorkerProxyClient.h"
9 #include "core/workers/InProcessWorkerObjectProxy.h" 11 #include "core/workers/InProcessWorkerObjectProxy.h"
10 #include "core/workers/WorkerThreadStartupData.h" 12 #include "core/workers/WorkerThreadStartupData.h"
11 #include "modules/EventTargetModules.h" 13 #include "modules/EventTargetModules.h"
12 #include "modules/compositorworker/CompositorWorkerThread.h" 14 #include "modules/compositorworker/CompositorWorkerThread.h"
13 #include "wtf/AutoReset.h" 15 #include "wtf/AutoReset.h"
14 #include <memory>
15 16
16 namespace blink { 17 namespace blink {
17 18
18 CompositorWorkerGlobalScope* CompositorWorkerGlobalScope::create( 19 CompositorWorkerGlobalScope* CompositorWorkerGlobalScope::create(
19 CompositorWorkerThread* thread, 20 CompositorWorkerThread* thread,
20 std::unique_ptr<WorkerThreadStartupData> startupData, 21 std::unique_ptr<WorkerThreadStartupData> startupData,
21 double timeOrigin) { 22 double timeOrigin) {
22 // Note: startupData is finalized on return. After the relevant parts has been 23 // Note: startupData is finalized on return. After the relevant parts has been
23 // passed along to the created 'context'. 24 // passed along to the created 'context'.
24 CompositorWorkerGlobalScope* context = new CompositorWorkerGlobalScope( 25 CompositorWorkerGlobalScope* context = new CompositorWorkerGlobalScope(
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 DEFINE_TRACE(CompositorWorkerGlobalScope) { 62 DEFINE_TRACE(CompositorWorkerGlobalScope) {
62 visitor->trace(m_callbackCollection); 63 visitor->trace(m_callbackCollection);
63 WorkerGlobalScope::trace(visitor); 64 WorkerGlobalScope::trace(visitor);
64 } 65 }
65 66
66 const AtomicString& CompositorWorkerGlobalScope::interfaceName() const { 67 const AtomicString& CompositorWorkerGlobalScope::interfaceName() const {
67 return EventTargetNames::CompositorWorkerGlobalScope; 68 return EventTargetNames::CompositorWorkerGlobalScope;
68 } 69 }
69 70
70 void CompositorWorkerGlobalScope::postMessage( 71 void CompositorWorkerGlobalScope::postMessage(
71 ExecutionContext* executionContext, 72 ScriptState* scriptState,
72 PassRefPtr<SerializedScriptValue> message, 73 PassRefPtr<SerializedScriptValue> message,
73 const MessagePortArray& ports, 74 const MessagePortArray& ports,
74 ExceptionState& exceptionState) { 75 ExceptionState& exceptionState) {
75 // Disentangle the port in preparation for sending it to the remote context. 76 // Disentangle the port in preparation for sending it to the remote context.
76 std::unique_ptr<MessagePortChannelArray> channels = 77 std::unique_ptr<MessagePortChannelArray> channels =
77 MessagePort::disentanglePorts(executionContext, ports, exceptionState); 78 MessagePort::disentanglePorts(scriptState->getExecutionContext(), ports,
79 exceptionState);
78 if (exceptionState.hadException()) 80 if (exceptionState.hadException())
79 return; 81 return;
80 workerObjectProxy().postMessageToWorkerObject(std::move(message), 82 workerObjectProxy().postMessageToWorkerObject(std::move(message),
81 std::move(channels)); 83 std::move(channels));
82 } 84 }
83 85
84 int CompositorWorkerGlobalScope::requestAnimationFrame( 86 int CompositorWorkerGlobalScope::requestAnimationFrame(
85 FrameRequestCallback* callback) { 87 FrameRequestCallback* callback) {
86 const bool shouldSignal = 88 const bool shouldSignal =
87 !m_executingAnimationFrameCallbacks && m_callbackCollection.isEmpty(); 89 !m_executingAnimationFrameCallbacks && m_callbackCollection.isEmpty();
(...skipping 12 matching lines...) Expand all
100 m_callbackCollection.executeCallbacks(highResTimeMs, highResTimeMs); 102 m_callbackCollection.executeCallbacks(highResTimeMs, highResTimeMs);
101 return !m_callbackCollection.isEmpty(); 103 return !m_callbackCollection.isEmpty();
102 } 104 }
103 105
104 InProcessWorkerObjectProxy& CompositorWorkerGlobalScope::workerObjectProxy() 106 InProcessWorkerObjectProxy& CompositorWorkerGlobalScope::workerObjectProxy()
105 const { 107 const {
106 return static_cast<CompositorWorkerThread*>(thread())->workerObjectProxy(); 108 return static_cast<CompositorWorkerThread*>(thread())->workerObjectProxy();
107 } 109 }
108 110
109 } // namespace blink 111 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698