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

Unified Diff: third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.cpp

Issue 2116563003: [DevTools] Report unhandled exceptions and promise rejections through Runtime. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tests pass Created 4 years, 5 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/core/workers/SharedWorkerGlobalScope.cpp
diff --git a/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.cpp b/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.cpp
index a43edb0191633ee1cd7c3857b18f25f40b58118c..d39a744d353a257a82138481e9d481afe534d223 100644
--- a/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.cpp
+++ b/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.cpp
@@ -34,6 +34,7 @@
#include "core/events/MessageEvent.h"
#include "core/frame/LocalDOMWindow.h"
#include "core/inspector/ConsoleMessage.h"
+#include "core/inspector/WorkerThreadDebugger.h"
#include "core/origin_trials/OriginTrialContext.h"
#include "core/workers/SharedWorkerThread.h"
#include "core/workers/WorkerClients.h"
@@ -86,8 +87,8 @@ SharedWorkerThread* SharedWorkerGlobalScope::thread()
void SharedWorkerGlobalScope::logExceptionToConsole(const String& errorMessage, std::unique_ptr<SourceLocation> location)
{
WorkerGlobalScope::logExceptionToConsole(errorMessage, location->clone());
- ConsoleMessage* consoleMessage = ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, errorMessage, std::move(location));
- addMessageToWorkerConsole(consoleMessage);
+ if (WorkerThreadDebugger* debugger = WorkerThreadDebugger::from(thread()->isolate()))
+ debugger->exceptionUnhandled(errorMessage, std::move(location));
}
DEFINE_TRACE(SharedWorkerGlobalScope)

Powered by Google App Engine
This is Rietveld 408576698