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 "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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 const AtomicString& CompositorWorkerGlobalScope::interfaceName() const { | 65 const AtomicString& CompositorWorkerGlobalScope::interfaceName() const { |
66 return EventTargetNames::CompositorWorkerGlobalScope; | 66 return EventTargetNames::CompositorWorkerGlobalScope; |
67 } | 67 } |
68 | 68 |
69 void CompositorWorkerGlobalScope::postMessage( | 69 void CompositorWorkerGlobalScope::postMessage( |
70 ExecutionContext* executionContext, | 70 ExecutionContext* executionContext, |
71 PassRefPtr<SerializedScriptValue> message, | 71 PassRefPtr<SerializedScriptValue> message, |
72 const MessagePortArray& ports, | 72 const MessagePortArray& ports, |
73 ExceptionState& exceptionState) { | 73 ExceptionState& exceptionState) { |
74 // Disentangle the port in preparation for sending it to the remote context. | 74 // Disentangle the port in preparation for sending it to the remote context. |
75 std::unique_ptr<MessagePortChannelArray> channels = | 75 MessagePortChannelArray channels = |
76 MessagePort::disentanglePorts(executionContext, ports, exceptionState); | 76 MessagePort::disentanglePorts(executionContext, ports, exceptionState); |
77 if (exceptionState.hadException()) | 77 if (exceptionState.hadException()) |
78 return; | 78 return; |
79 workerObjectProxy().postMessageToWorkerObject(std::move(message), | 79 workerObjectProxy().postMessageToWorkerObject(std::move(message), |
80 std::move(channels)); | 80 std::move(channels)); |
81 } | 81 } |
82 | 82 |
83 int CompositorWorkerGlobalScope::requestAnimationFrame( | 83 int CompositorWorkerGlobalScope::requestAnimationFrame( |
84 FrameRequestCallback* callback) { | 84 FrameRequestCallback* callback) { |
85 const bool shouldSignal = | 85 const bool shouldSignal = |
(...skipping 13 matching lines...) Expand all Loading... |
99 m_callbackCollection.executeCallbacks(highResTimeMs, highResTimeMs); | 99 m_callbackCollection.executeCallbacks(highResTimeMs, highResTimeMs); |
100 return !m_callbackCollection.isEmpty(); | 100 return !m_callbackCollection.isEmpty(); |
101 } | 101 } |
102 | 102 |
103 InProcessWorkerObjectProxy& CompositorWorkerGlobalScope::workerObjectProxy() | 103 InProcessWorkerObjectProxy& CompositorWorkerGlobalScope::workerObjectProxy() |
104 const { | 104 const { |
105 return static_cast<CompositorWorkerThread*>(thread())->workerObjectProxy(); | 105 return static_cast<CompositorWorkerThread*>(thread())->workerObjectProxy(); |
106 } | 106 } |
107 | 107 |
108 } // namespace blink | 108 } // namespace blink |
OLD | NEW |