| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "web/WebEmbeddedWorkerImpl.h" | 31 #include "web/WebEmbeddedWorkerImpl.h" |
| 32 | 32 |
| 33 #include "bindings/core/v8/SourceLocation.h" |
| 33 #include "core/dom/CrossThreadTask.h" | 34 #include "core/dom/CrossThreadTask.h" |
| 34 #include "core/dom/Document.h" | 35 #include "core/dom/Document.h" |
| 35 #include "core/dom/SecurityContext.h" | 36 #include "core/dom/SecurityContext.h" |
| 36 #include "core/fetch/SubstituteData.h" | 37 #include "core/fetch/SubstituteData.h" |
| 37 #include "core/frame/csp/ContentSecurityPolicy.h" | 38 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 38 #include "core/inspector/ConsoleMessage.h" | 39 #include "core/inspector/ConsoleMessage.h" |
| 39 #include "core/inspector/InspectorInstrumentation.h" | 40 #include "core/inspector/InspectorInstrumentation.h" |
| 40 #include "core/loader/FrameLoadRequest.h" | 41 #include "core/loader/FrameLoadRequest.h" |
| 41 #include "core/workers/WorkerClients.h" | 42 #include "core/workers/WorkerClients.h" |
| 42 #include "core/workers/WorkerGlobalScope.h" | 43 #include "core/workers/WorkerGlobalScope.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 webCoreMessageLevel = WarningMessageLevel; | 236 webCoreMessageLevel = WarningMessageLevel; |
| 236 break; | 237 break; |
| 237 case WebConsoleMessage::LevelError: | 238 case WebConsoleMessage::LevelError: |
| 238 webCoreMessageLevel = ErrorMessageLevel; | 239 webCoreMessageLevel = ErrorMessageLevel; |
| 239 break; | 240 break; |
| 240 default: | 241 default: |
| 241 NOTREACHED(); | 242 NOTREACHED(); |
| 242 return; | 243 return; |
| 243 } | 244 } |
| 244 | 245 |
| 245 m_mainFrame->frame()->document()->addConsoleMessage(ConsoleMessage::create(O
therMessageSource, webCoreMessageLevel, message.text, message.url, message.lineN
umber, message.columnNumber)); | 246 m_mainFrame->frame()->document()->addConsoleMessage(ConsoleMessage::create(O
therMessageSource, webCoreMessageLevel, message.text, SourceLocation::create(mes
sage.url, message.lineNumber, message.columnNumber, nullptr))); |
| 246 } | 247 } |
| 247 | 248 |
| 248 void WebEmbeddedWorkerImpl::postMessageToPageInspector(const String& message) | 249 void WebEmbeddedWorkerImpl::postMessageToPageInspector(const String& message) |
| 249 { | 250 { |
| 250 m_workerInspectorProxy->dispatchMessageFromWorker(message); | 251 m_workerInspectorProxy->dispatchMessageFromWorker(message); |
| 251 } | 252 } |
| 252 | 253 |
| 253 void WebEmbeddedWorkerImpl::postTaskToLoader(std::unique_ptr<ExecutionContextTas
k> task) | 254 void WebEmbeddedWorkerImpl::postTaskToLoader(std::unique_ptr<ExecutionContextTas
k> task) |
| 254 { | 255 { |
| 255 m_mainFrame->frame()->document()->postTask(BLINK_FROM_HERE, std::move(task))
; | 256 m_mainFrame->frame()->document()->postTask(BLINK_FROM_HERE, std::move(task))
; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 m_mainScriptLoader.clear(); | 425 m_mainScriptLoader.clear(); |
| 425 | 426 |
| 426 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc
ument, *m_workerContextClient); | 427 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc
ument, *m_workerContextClient); |
| 427 m_loaderProxy = WorkerLoaderProxy::create(this); | 428 m_loaderProxy = WorkerLoaderProxy::create(this); |
| 428 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS
copeProxy); | 429 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS
copeProxy); |
| 429 m_workerThread->start(std::move(startupData)); | 430 m_workerThread->start(std::move(startupData)); |
| 430 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(),
scriptURL); | 431 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(),
scriptURL); |
| 431 } | 432 } |
| 432 | 433 |
| 433 } // namespace blink | 434 } // namespace blink |
| OLD | NEW |