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

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

Issue 2422793002: HTML MessagePort as mojo::MessagePipeHandle (Closed)
Patch Set: Add missing ScopedAsyncTaskScheduler instance for the new unit tests; required by a recent change t… 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> 7 #include <memory>
8 #include "bindings/core/v8/ScriptState.h" 8 #include "bindings/core/v8/ScriptState.h"
9 #include "bindings/core/v8/SerializedScriptValue.h" 9 #include "bindings/core/v8/SerializedScriptValue.h"
10 #include "core/dom/CompositorWorkerProxyClient.h" 10 #include "core/dom/CompositorWorkerProxyClient.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 const AtomicString& CompositorWorkerGlobalScope::interfaceName() const { 67 const AtomicString& CompositorWorkerGlobalScope::interfaceName() const {
68 return EventTargetNames::CompositorWorkerGlobalScope; 68 return EventTargetNames::CompositorWorkerGlobalScope;
69 } 69 }
70 70
71 void CompositorWorkerGlobalScope::postMessage( 71 void CompositorWorkerGlobalScope::postMessage(
72 ScriptState* scriptState, 72 ScriptState* scriptState,
73 PassRefPtr<SerializedScriptValue> message, 73 PassRefPtr<SerializedScriptValue> message,
74 const MessagePortArray& ports, 74 const MessagePortArray& ports,
75 ExceptionState& exceptionState) { 75 ExceptionState& exceptionState) {
76 // 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.
77 std::unique_ptr<MessagePortChannelArray> channels = 77 MessagePortChannelArray channels =
78 MessagePort::disentanglePorts(scriptState->getExecutionContext(), ports, 78 MessagePort::disentanglePorts(scriptState->getExecutionContext(), ports,
79 exceptionState); 79 exceptionState);
80 if (exceptionState.hadException()) 80 if (exceptionState.hadException())
81 return; 81 return;
82 workerObjectProxy().postMessageToWorkerObject(std::move(message), 82 workerObjectProxy().postMessageToWorkerObject(std::move(message),
83 std::move(channels)); 83 std::move(channels));
84 } 84 }
85 85
86 int CompositorWorkerGlobalScope::requestAnimationFrame( 86 int CompositorWorkerGlobalScope::requestAnimationFrame(
87 FrameRequestCallback* callback) { 87 FrameRequestCallback* callback) {
(...skipping 14 matching lines...) Expand all
102 m_callbackCollection.executeCallbacks(highResTimeMs, highResTimeMs); 102 m_callbackCollection.executeCallbacks(highResTimeMs, highResTimeMs);
103 return !m_callbackCollection.isEmpty(); 103 return !m_callbackCollection.isEmpty();
104 } 104 }
105 105
106 InProcessWorkerObjectProxy& CompositorWorkerGlobalScope::workerObjectProxy() 106 InProcessWorkerObjectProxy& CompositorWorkerGlobalScope::workerObjectProxy()
107 const { 107 const {
108 return static_cast<CompositorWorkerThread*>(thread())->workerObjectProxy(); 108 return static_cast<CompositorWorkerThread*>(thread())->workerObjectProxy();
109 } 109 }
110 110
111 } // namespace blink 111 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698