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 "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" |
11 #include "core/frame/csp/ContentSecurityPolicy.h" | 11 #include "core/frame/csp/ContentSecurityPolicy.h" |
12 #include "core/inspector/InspectorInstrumentation.h" | 12 #include "core/inspector/InspectorInstrumentation.h" |
13 #include "core/workers/InProcessWorkerGlobalScopeProxy.h" | 13 #include "core/workers/InProcessWorkerMessagingProxy.h" |
14 #include "core/workers/WorkerScriptLoader.h" | 14 #include "core/workers/WorkerScriptLoader.h" |
15 #include "core/workers/WorkerThread.h" | 15 #include "core/workers/WorkerThread.h" |
16 #include "platform/network/ContentSecurityPolicyResponseHeaders.h" | 16 #include "platform/network/ContentSecurityPolicyResponseHeaders.h" |
17 #include <memory> | 17 #include <memory> |
18 | 18 |
19 namespace blink { | 19 namespace blink { |
20 | 20 |
21 InProcessWorkerBase::InProcessWorkerBase(ExecutionContext* context) | 21 InProcessWorkerBase::InProcessWorkerBase(ExecutionContext* context) |
22 : AbstractWorker(context) | 22 : AbstractWorker(context) |
23 , ActiveScriptWrappable(this) | 23 , ActiveScriptWrappable(this) |
(...skipping 30 matching lines...) Expand all Loading... |
54 | 54 |
55 m_scriptLoader = WorkerScriptLoader::create(); | 55 m_scriptLoader = WorkerScriptLoader::create(); |
56 m_scriptLoader->loadAsynchronously( | 56 m_scriptLoader->loadAsynchronously( |
57 *context, | 57 *context, |
58 scriptURL, | 58 scriptURL, |
59 DenyCrossOriginRequests, | 59 DenyCrossOriginRequests, |
60 context->securityContext().addressSpace(), | 60 context->securityContext().addressSpace(), |
61 WTF::bind(&InProcessWorkerBase::onResponse, wrapPersistent(this)), | 61 WTF::bind(&InProcessWorkerBase::onResponse, wrapPersistent(this)), |
62 WTF::bind(&InProcessWorkerBase::onFinished, wrapPersistent(this))); | 62 WTF::bind(&InProcessWorkerBase::onFinished, wrapPersistent(this))); |
63 | 63 |
64 m_contextProxy = createInProcessWorkerGlobalScopeProxy(context); | 64 m_contextProxy = createInProcessWorkerMessagingProxy(context); |
65 | 65 |
66 return true; | 66 return true; |
67 } | 67 } |
68 | 68 |
69 void InProcessWorkerBase::terminate() | 69 void InProcessWorkerBase::terminate() |
70 { | 70 { |
71 if (m_contextProxy) | 71 if (m_contextProxy) |
72 m_contextProxy->terminateWorkerGlobalScope(); | 72 m_contextProxy->terminateWorkerGlobalScope(); |
73 } | 73 } |
74 | 74 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 m_scriptLoader = nullptr; | 116 m_scriptLoader = nullptr; |
117 } | 117 } |
118 | 118 |
119 DEFINE_TRACE(InProcessWorkerBase) | 119 DEFINE_TRACE(InProcessWorkerBase) |
120 { | 120 { |
121 visitor->trace(m_contentSecurityPolicy); | 121 visitor->trace(m_contentSecurityPolicy); |
122 AbstractWorker::trace(visitor); | 122 AbstractWorker::trace(visitor); |
123 } | 123 } |
124 | 124 |
125 } // namespace blink | 125 } // namespace blink |
OLD | NEW |