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

Side by Side Diff: third_party/WebKit/Source/core/workers/InProcessWorkerBase.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 "core/workers/InProcessWorkerBase.h" 5 #include "core/workers/InProcessWorkerBase.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "core/events/MessageEvent.h" 8 #include "core/events/MessageEvent.h"
9 #include "core/fetch/ResourceFetcher.h" 9 #include "core/fetch/ResourceFetcher.h"
10 #include "core/frame/LocalDOMWindow.h" 10 #include "core/frame/LocalDOMWindow.h"
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 InProcessWorkerBase::~InProcessWorkerBase() 27 InProcessWorkerBase::~InProcessWorkerBase()
28 { 28 {
29 ASSERT(isMainThread()); 29 ASSERT(isMainThread());
30 if (!m_contextProxy) 30 if (!m_contextProxy)
31 return; 31 return;
32 m_contextProxy->workerObjectDestroyed(); 32 m_contextProxy->workerObjectDestroyed();
33 } 33 }
34 34
35 void InProcessWorkerBase::postMessage(ExecutionContext* context, PassRefPtr<Seri alizedScriptValue> message, const MessagePortArray* ports, ExceptionState& excep tionState) 35 void InProcessWorkerBase::postMessage(ExecutionContext* context, PassRefPtr<Seri alizedScriptValue> message, const MessagePortArray& ports, ExceptionState& excep tionState)
36 { 36 {
37 ASSERT(m_contextProxy); 37 ASSERT(m_contextProxy);
38 // Disentangle the port in preparation for sending it to the remote context. 38 // Disentangle the port in preparation for sending it to the remote context.
39 OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(con text, ports, exceptionState); 39 OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(con text, ports, exceptionState);
40 if (exceptionState.hadException()) 40 if (exceptionState.hadException())
41 return; 41 return;
42 m_contextProxy->postMessageToWorkerGlobalScope(message, channels.release()); 42 m_contextProxy->postMessageToWorkerGlobalScope(message, channels.release());
43 } 43 }
44 44
45 bool InProcessWorkerBase::initialize(ExecutionContext* context, const String& ur l, ExceptionState& exceptionState) 45 bool InProcessWorkerBase::initialize(ExecutionContext* context, const String& ur l, ExceptionState& exceptionState)
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 m_scriptLoader = nullptr; 106 m_scriptLoader = nullptr;
107 } 107 }
108 108
109 DEFINE_TRACE(InProcessWorkerBase) 109 DEFINE_TRACE(InProcessWorkerBase)
110 { 110 {
111 visitor->trace(m_contentSecurityPolicy); 111 visitor->trace(m_contentSecurityPolicy);
112 AbstractWorker::trace(visitor); 112 AbstractWorker::trace(visitor);
113 } 113 }
114 114
115 } // namespace blink 115 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698