| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 } | 44 } |
| 45 | 45 |
| 46 bool InProcessWorkerBase::initialize(ExecutionContext* context, const String& ur
l, ExceptionState& exceptionState) | 46 bool InProcessWorkerBase::initialize(ExecutionContext* context, const String& ur
l, ExceptionState& exceptionState) |
| 47 { | 47 { |
| 48 suspendIfNeeded(); | 48 suspendIfNeeded(); |
| 49 | 49 |
| 50 KURL scriptURL = resolveURL(url, exceptionState); | 50 KURL scriptURL = resolveURL(url, exceptionState); |
| 51 if (scriptURL.isEmpty()) | 51 if (scriptURL.isEmpty()) |
| 52 return false; | 52 return false; |
| 53 | 53 |
| 54 m_scriptLoader = adoptPtr(new WorkerScriptLoader()); | 54 m_scriptLoader = WorkerScriptLoader::create(); |
| 55 m_scriptLoader->loadAsynchronously( | 55 m_scriptLoader->loadAsynchronously( |
| 56 *context, | 56 *context, |
| 57 scriptURL, | 57 scriptURL, |
| 58 DenyCrossOriginRequests, | 58 DenyCrossOriginRequests, |
| 59 bind(&InProcessWorkerBase::onResponse, this), | 59 bind(&InProcessWorkerBase::onResponse, this), |
| 60 bind(&InProcessWorkerBase::onFinished, this)); | 60 bind(&InProcessWorkerBase::onFinished, this)); |
| 61 | 61 |
| 62 m_contextProxy = createWorkerGlobalScopeProxy(context); | 62 m_contextProxy = createWorkerGlobalScopeProxy(context); |
| 63 | 63 |
| 64 return true; | 64 return true; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 m_scriptLoader = nullptr; | 109 m_scriptLoader = nullptr; |
| 110 } | 110 } |
| 111 | 111 |
| 112 DEFINE_TRACE(InProcessWorkerBase) | 112 DEFINE_TRACE(InProcessWorkerBase) |
| 113 { | 113 { |
| 114 visitor->trace(m_contentSecurityPolicy); | 114 visitor->trace(m_contentSecurityPolicy); |
| 115 AbstractWorker::trace(visitor); | 115 AbstractWorker::trace(visitor); |
| 116 } | 116 } |
| 117 | 117 |
| 118 } // namespace blink | 118 } // namespace blink |
| OLD | NEW |