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

Side by Side Diff: third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp

Issue 1908313003: Shows the error message while fetching the SW script in the DevTools console. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated falken's comment 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 /* 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 17 matching lines...) Expand all
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 "core/dom/CrossThreadTask.h" 33 #include "core/dom/CrossThreadTask.h"
34 #include "core/dom/Document.h" 34 #include "core/dom/Document.h"
35 #include "core/dom/SecurityContext.h" 35 #include "core/dom/SecurityContext.h"
36 #include "core/fetch/SubstituteData.h" 36 #include "core/fetch/SubstituteData.h"
37 #include "core/frame/csp/ContentSecurityPolicy.h" 37 #include "core/frame/csp/ContentSecurityPolicy.h"
38 #include "core/inspector/ConsoleMessage.h"
38 #include "core/inspector/InspectorInstrumentation.h" 39 #include "core/inspector/InspectorInstrumentation.h"
39 #include "core/inspector/WorkerDebuggerAgent.h" 40 #include "core/inspector/WorkerDebuggerAgent.h"
40 #include "core/inspector/WorkerInspectorController.h" 41 #include "core/inspector/WorkerInspectorController.h"
41 #include "core/loader/FrameLoadRequest.h" 42 #include "core/loader/FrameLoadRequest.h"
42 #include "core/workers/WorkerClients.h" 43 #include "core/workers/WorkerClients.h"
43 #include "core/workers/WorkerGlobalScope.h" 44 #include "core/workers/WorkerGlobalScope.h"
44 #include "core/workers/WorkerInspectorProxy.h" 45 #include "core/workers/WorkerInspectorProxy.h"
45 #include "core/workers/WorkerLoaderProxy.h" 46 #include "core/workers/WorkerLoaderProxy.h"
46 #include "core/workers/WorkerScriptLoader.h" 47 #include "core/workers/WorkerScriptLoader.h"
47 #include "core/workers/WorkerThreadStartupData.h" 48 #include "core/workers/WorkerThreadStartupData.h"
48 #include "modules/serviceworkers/ServiceWorkerContainerClient.h" 49 #include "modules/serviceworkers/ServiceWorkerContainerClient.h"
49 #include "modules/serviceworkers/ServiceWorkerThread.h" 50 #include "modules/serviceworkers/ServiceWorkerThread.h"
50 #include "platform/Histogram.h" 51 #include "platform/Histogram.h"
51 #include "platform/SharedBuffer.h" 52 #include "platform/SharedBuffer.h"
52 #include "platform/heap/Handle.h" 53 #include "platform/heap/Handle.h"
53 #include "platform/network/ContentSecurityPolicyParsers.h" 54 #include "platform/network/ContentSecurityPolicyParsers.h"
54 #include "platform/network/ContentSecurityPolicyResponseHeaders.h" 55 #include "platform/network/ContentSecurityPolicyResponseHeaders.h"
55 #include "public/platform/Platform.h" 56 #include "public/platform/Platform.h"
56 #include "public/platform/WebURLRequest.h" 57 #include "public/platform/WebURLRequest.h"
57 #include "public/platform/modules/serviceworker/WebServiceWorkerProvider.h" 58 #include "public/platform/modules/serviceworker/WebServiceWorkerProvider.h"
59 #include "public/web/WebConsoleMessage.h"
58 #include "public/web/WebDevToolsAgent.h" 60 #include "public/web/WebDevToolsAgent.h"
59 #include "public/web/WebSettings.h" 61 #include "public/web/WebSettings.h"
60 #include "public/web/WebView.h" 62 #include "public/web/WebView.h"
61 #include "public/web/WebWorkerContentSettingsClientProxy.h" 63 #include "public/web/WebWorkerContentSettingsClientProxy.h"
62 #include "public/web/modules/serviceworker/WebServiceWorkerContextClient.h" 64 #include "public/web/modules/serviceworker/WebServiceWorkerContextClient.h"
63 #include "public/web/modules/serviceworker/WebServiceWorkerNetworkProvider.h" 65 #include "public/web/modules/serviceworker/WebServiceWorkerNetworkProvider.h"
64 #include "web/IndexedDBClientImpl.h" 66 #include "web/IndexedDBClientImpl.h"
65 #include "web/ServiceWorkerGlobalScopeClientImpl.h" 67 #include "web/ServiceWorkerGlobalScopeClientImpl.h"
66 #include "web/ServiceWorkerGlobalScopeProxy.h" 68 #include "web/ServiceWorkerGlobalScopeProxy.h"
67 #include "web/WebDataSourceImpl.h" 69 #include "web/WebDataSourceImpl.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 198
197 void WebEmbeddedWorkerImpl::dispatchDevToolsMessage(int sessionId, const WebStri ng& message) 199 void WebEmbeddedWorkerImpl::dispatchDevToolsMessage(int sessionId, const WebStri ng& message)
198 { 200 {
199 if (m_askedToTerminate) 201 if (m_askedToTerminate)
200 return; 202 return;
201 WebDevToolsAgent* devtoolsAgent = m_mainFrame->devToolsAgent(); 203 WebDevToolsAgent* devtoolsAgent = m_mainFrame->devToolsAgent();
202 if (devtoolsAgent) 204 if (devtoolsAgent)
203 devtoolsAgent->dispatchOnInspectorBackend(sessionId, message); 205 devtoolsAgent->dispatchOnInspectorBackend(sessionId, message);
204 } 206 }
205 207
208 void WebEmbeddedWorkerImpl::addMessageToConsole(const WebConsoleMessage& message )
209 {
210 MessageLevel webCoreMessageLevel;
211 switch (message.level) {
212 case WebConsoleMessage::LevelDebug:
213 webCoreMessageLevel = DebugMessageLevel;
214 break;
215 case WebConsoleMessage::LevelLog:
216 webCoreMessageLevel = LogMessageLevel;
217 break;
218 case WebConsoleMessage::LevelWarning:
219 webCoreMessageLevel = WarningMessageLevel;
220 break;
221 case WebConsoleMessage::LevelError:
222 webCoreMessageLevel = ErrorMessageLevel;
223 break;
224 default:
225 NOTREACHED();
226 return;
227 }
228
229 m_mainFrame->frame()->document()->addConsoleMessage(ConsoleMessage::create(O therMessageSource, webCoreMessageLevel, message.text, message.url, message.lineN umber, message.columnNumber));
230 }
231
206 void WebEmbeddedWorkerImpl::postMessageToPageInspector(const String& message) 232 void WebEmbeddedWorkerImpl::postMessageToPageInspector(const String& message)
207 { 233 {
208 m_workerInspectorProxy->dispatchMessageFromWorker(message); 234 m_workerInspectorProxy->dispatchMessageFromWorker(message);
209 } 235 }
210 236
211 void WebEmbeddedWorkerImpl::postTaskToLoader(PassOwnPtr<ExecutionContextTask> ta sk) 237 void WebEmbeddedWorkerImpl::postTaskToLoader(PassOwnPtr<ExecutionContextTask> ta sk)
212 { 238 {
213 m_mainFrame->frame()->document()->postTask(BLINK_FROM_HERE, task); 239 m_mainFrame->frame()->document()->postTask(BLINK_FROM_HERE, task);
214 } 240 }
215 241
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 m_mainScriptLoader.clear(); 401 m_mainScriptLoader.clear();
376 402
377 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc ument, *m_workerContextClient); 403 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc ument, *m_workerContextClient);
378 m_loaderProxy = WorkerLoaderProxy::create(this); 404 m_loaderProxy = WorkerLoaderProxy::create(this);
379 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS copeProxy); 405 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS copeProxy);
380 m_workerThread->start(startupData.release()); 406 m_workerThread->start(startupData.release());
381 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(), scriptURL); 407 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(), scriptURL);
382 } 408 }
383 409
384 } // namespace blink 410 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.h ('k') | third_party/WebKit/public/web/WebEmbeddedWorker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698