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

Unified Diff: third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp

Issue 2139363003: [DevTools] Cleanup v8_inspector API part 1. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased 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/inspector/WorkerThreadDebugger.cpp
diff --git a/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp b/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp
index 9aaf4a3c9fe3b1232e7b9cdbf9cb689b79b0d15d..e5f734e3b4100a4258223bc0199d0d782385de96 100644
--- a/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp
+++ b/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp
@@ -34,6 +34,7 @@
#include "bindings/core/v8/SourceLocation.h"
#include "bindings/core/v8/V8ScriptRunner.h"
#include "core/inspector/ConsoleMessage.h"
+#include "core/inspector/IdentifiersFactory.h"
#include "core/workers/WorkerReportingProxy.h"
#include "core/workers/WorkerThread.h"
#include <v8.h>
@@ -54,6 +55,7 @@ WorkerThreadDebugger* WorkerThreadDebugger::from(v8::Isolate* isolate)
WorkerThreadDebugger::WorkerThreadDebugger(WorkerThread* workerThread, v8::Isolate* isolate)
: ThreadDebugger(isolate)
, m_workerThread(workerThread)
+ , m_muteConsoleCount(0)
{
}
@@ -73,9 +75,29 @@ void WorkerThreadDebugger::contextWillBeDestroyed(v8::Local<v8::Context> context
void WorkerThreadDebugger::exceptionThrown(const String& errorMessage, std::unique_ptr<SourceLocation> location)
{
+ if (m_muteConsoleCount)
+ return;
debugger()->exceptionThrown(workerContextGroupId, errorMessage, location->url(), location->lineNumber(), location->columnNumber(), location->cloneStackTrace(), location->scriptId());
}
+void WorkerThreadDebugger::addConsoleMessage(ConsoleMessage* consoleMessage)
+{
+ if (m_muteConsoleCount)
+ return;
+ debugger()->addConsoleMessage(
+ workerContextGroupId,
+ consoleMessage->source(),
+ consoleMessage->level(),
+ consoleMessage->message(),
+ consoleMessage->location()->url(),
+ consoleMessage->location()->lineNumber(),
+ consoleMessage->location()->columnNumber(),
+ consoleMessage->location()->cloneStackTrace(),
+ consoleMessage->location()->scriptId(),
+ IdentifiersFactory::requestId(consoleMessage->requestIdentifier()),
+ consoleMessage->workerId());
+}
+
int WorkerThreadDebugger::contextGroupId()
{
return workerContextGroupId;
@@ -92,6 +114,16 @@ void WorkerThreadDebugger::quitMessageLoopOnPause()
m_workerThread->stopRunningDebuggerTasksOnPauseOnWorkerThread();
}
+void WorkerThreadDebugger::muteWarningsAndDeprecations()
+{
+ m_muteConsoleCount++;
+}
+
+void WorkerThreadDebugger::unmuteWarningsAndDeprecations()
+{
+ m_muteConsoleCount--;
+}
+
bool WorkerThreadDebugger::callingContextCanAccessContext(v8::Local<v8::Context> calling, v8::Local<v8::Context> target)
{
return true;

Powered by Google App Engine
This is Rietveld 408576698