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

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

Issue 1893983002: Simplify handling of Transferable objects while (de)serializing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove Transferable.cpp, not needed after all. Created 4 years, 8 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/WorkerObjectProxy.h" 8 #include "core/workers/WorkerObjectProxy.h"
9 #include "core/workers/WorkerThreadStartupData.h" 9 #include "core/workers/WorkerThreadStartupData.h"
10 #include "modules/EventTargetModules.h" 10 #include "modules/EventTargetModules.h"
(...skipping 25 matching lines...) Expand all
36 { 36 {
37 visitor->trace(m_callbackCollection); 37 visitor->trace(m_callbackCollection);
38 WorkerGlobalScope::trace(visitor); 38 WorkerGlobalScope::trace(visitor);
39 } 39 }
40 40
41 const AtomicString& CompositorWorkerGlobalScope::interfaceName() const 41 const AtomicString& CompositorWorkerGlobalScope::interfaceName() const
42 { 42 {
43 return EventTargetNames::CompositorWorkerGlobalScope; 43 return EventTargetNames::CompositorWorkerGlobalScope;
44 } 44 }
45 45
46 void CompositorWorkerGlobalScope::postMessage(ExecutionContext* executionContext , PassRefPtr<SerializedScriptValue> message, const MessagePortArray* ports, Exce ptionState& exceptionState) 46 void CompositorWorkerGlobalScope::postMessage(ExecutionContext* executionContext , PassRefPtr<SerializedScriptValue> message, const MessagePortArray& ports, Exce ptionState& exceptionState)
47 { 47 {
48 // Disentangle the port in preparation for sending it to the remote context. 48 // Disentangle the port in preparation for sending it to the remote context.
49 OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(exe cutionContext, ports, exceptionState); 49 OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(exe cutionContext, ports, exceptionState);
50 if (exceptionState.hadException()) 50 if (exceptionState.hadException())
51 return; 51 return;
52 thread()->workerObjectProxy().postMessageToWorkerObject(message, channels.re lease()); 52 thread()->workerObjectProxy().postMessageToWorkerObject(message, channels.re lease());
53 } 53 }
54 54
55 int CompositorWorkerGlobalScope::requestAnimationFrame(FrameRequestCallback* cal lback) 55 int CompositorWorkerGlobalScope::requestAnimationFrame(FrameRequestCallback* cal lback)
56 { 56 {
57 return m_callbackCollection.registerCallback(callback); 57 return m_callbackCollection.registerCallback(callback);
58 } 58 }
59 59
60 void CompositorWorkerGlobalScope::cancelAnimationFrame(int id) 60 void CompositorWorkerGlobalScope::cancelAnimationFrame(int id)
61 { 61 {
62 m_callbackCollection.cancelCallback(id); 62 m_callbackCollection.cancelCallback(id);
63 } 63 }
64 64
65 void CompositorWorkerGlobalScope::executeAnimationFrameCallbacks(double highResT imeNow) 65 void CompositorWorkerGlobalScope::executeAnimationFrameCallbacks(double highResT imeNow)
66 { 66 {
67 m_callbackCollection.executeCallbacks(highResTimeNow, highResTimeNow); 67 m_callbackCollection.executeCallbacks(highResTimeNow, highResTimeNow);
68 } 68 }
69 69
70 CompositorWorkerThread* CompositorWorkerGlobalScope::thread() const 70 CompositorWorkerThread* CompositorWorkerGlobalScope::thread() const
71 { 71 {
72 return static_cast<CompositorWorkerThread*>(WorkerGlobalScope::thread()); 72 return static_cast<CompositorWorkerThread*>(WorkerGlobalScope::thread());
73 } 73 }
74 74
75 } // namespace blink 75 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698