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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
index 0968152830361b412d220efe1313534f49a52a5b..75282894728d5271478170370fd6d9dd605d635b 100644
--- a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
@@ -35,6 +35,7 @@
#include "core/dom/SecurityContext.h"
#include "core/fetch/SubstituteData.h"
#include "core/frame/csp/ContentSecurityPolicy.h"
+#include "core/inspector/ConsoleMessage.h"
#include "core/inspector/InspectorInstrumentation.h"
#include "core/inspector/WorkerDebuggerAgent.h"
#include "core/inspector/WorkerInspectorController.h"
@@ -55,6 +56,7 @@
#include "public/platform/Platform.h"
#include "public/platform/WebURLRequest.h"
#include "public/platform/modules/serviceworker/WebServiceWorkerProvider.h"
+#include "public/web/WebConsoleMessage.h"
#include "public/web/WebDevToolsAgent.h"
#include "public/web/WebSettings.h"
#include "public/web/WebView.h"
@@ -203,6 +205,30 @@ void WebEmbeddedWorkerImpl::dispatchDevToolsMessage(int sessionId, const WebStri
devtoolsAgent->dispatchOnInspectorBackend(sessionId, message);
}
+void WebEmbeddedWorkerImpl::addMessageToConsole(const WebConsoleMessage& message)
+{
+ MessageLevel webCoreMessageLevel;
+ switch (message.level) {
+ case WebConsoleMessage::LevelDebug:
+ webCoreMessageLevel = DebugMessageLevel;
+ break;
+ case WebConsoleMessage::LevelLog:
+ webCoreMessageLevel = LogMessageLevel;
+ break;
+ case WebConsoleMessage::LevelWarning:
+ webCoreMessageLevel = WarningMessageLevel;
+ break;
+ case WebConsoleMessage::LevelError:
+ webCoreMessageLevel = ErrorMessageLevel;
+ break;
+ default:
+ NOTREACHED();
+ return;
+ }
+
+ m_mainFrame->frame()->document()->addConsoleMessage(ConsoleMessage::create(OtherMessageSource, webCoreMessageLevel, message.text, message.url, message.lineNumber, message.columnNumber));
+}
+
void WebEmbeddedWorkerImpl::postMessageToPageInspector(const String& message)
{
m_workerInspectorProxy->dispatchMessageFromWorker(message);
« 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