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 "config.h" | 5 #include "config.h" |
6 #include "core/workers/InProcessWorkerBase.h" | 6 #include "core/workers/InProcessWorkerBase.h" |
7 | 7 |
8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
9 #include "core/events/MessageEvent.h" | 9 #include "core/events/MessageEvent.h" |
10 #include "core/fetch/ResourceFetcher.h" | 10 #include "core/fetch/ResourceFetcher.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 InProcessWorkerBase::InProcessWorkerBase(ExecutionContext* context) | 22 InProcessWorkerBase::InProcessWorkerBase(ExecutionContext* context) |
23 : AbstractWorker(context) | 23 : AbstractWorker(context) |
24 , m_contextProxy(nullptr) | 24 , m_contextProxy(nullptr) |
25 { | 25 { |
26 } | 26 } |
27 | 27 |
28 InProcessWorkerBase::~InProcessWorkerBase() | 28 InProcessWorkerBase::~InProcessWorkerBase() |
29 { | 29 { |
30 ASSERT(isMainThread()); | 30 ASSERT(isMainThread()); |
| 31 #if !ENABLE(OILPAN) |
31 if (!m_contextProxy) | 32 if (!m_contextProxy) |
32 return; | 33 return; |
33 m_contextProxy->workerObjectDestroyed(); | 34 m_contextProxy->workerObjectDestroyed(); |
| 35 #endif |
34 } | 36 } |
35 | 37 |
36 void InProcessWorkerBase::postMessage(ExecutionContext* context, PassRefPtr<Seri
alizedScriptValue> message, const MessagePortArray* ports, ExceptionState& excep
tionState) | 38 void InProcessWorkerBase::postMessage(ExecutionContext* context, PassRefPtr<Seri
alizedScriptValue> message, const MessagePortArray* ports, ExceptionState& excep
tionState) |
37 { | 39 { |
38 ASSERT(m_contextProxy); | 40 ASSERT(m_contextProxy); |
39 // Disentangle the port in preparation for sending it to the remote context. | 41 // Disentangle the port in preparation for sending it to the remote context. |
40 OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(con
text, ports, exceptionState); | 42 OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(con
text, ports, exceptionState); |
41 if (exceptionState.hadException()) | 43 if (exceptionState.hadException()) |
42 return; | 44 return; |
43 m_contextProxy->postMessageToWorkerGlobalScope(message, channels.release()); | 45 m_contextProxy->postMessageToWorkerGlobalScope(message, channels.release()); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 m_contextProxy->startWorkerGlobalScope(m_scriptLoader->url(), executionC
ontext()->userAgent(m_scriptLoader->url()), m_scriptLoader->script(), startMode)
; | 107 m_contextProxy->startWorkerGlobalScope(m_scriptLoader->url(), executionC
ontext()->userAgent(m_scriptLoader->url()), m_scriptLoader->script(), startMode)
; |
106 InspectorInstrumentation::scriptImported(executionContext(), m_scriptLoa
der->identifier(), m_scriptLoader->script()); | 108 InspectorInstrumentation::scriptImported(executionContext(), m_scriptLoa
der->identifier(), m_scriptLoader->script()); |
107 } | 109 } |
108 m_contentSecurityPolicy = m_scriptLoader->releaseContentSecurityPolicy(); | 110 m_contentSecurityPolicy = m_scriptLoader->releaseContentSecurityPolicy(); |
109 m_scriptLoader = nullptr; | 111 m_scriptLoader = nullptr; |
110 } | 112 } |
111 | 113 |
112 DEFINE_TRACE(InProcessWorkerBase) | 114 DEFINE_TRACE(InProcessWorkerBase) |
113 { | 115 { |
114 visitor->trace(m_contentSecurityPolicy); | 116 visitor->trace(m_contentSecurityPolicy); |
| 117 visitor->trace(m_contextProxy); |
115 AbstractWorker::trace(visitor); | 118 AbstractWorker::trace(visitor); |
116 } | 119 } |
117 | 120 |
118 } // namespace blink | 121 } // namespace blink |
OLD | NEW |