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

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

Issue 2139543002: [DevTools] Report console API calls through Runtime. (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 e5f734e3b4100a4258223bc0199d0d782385de96..531919df7e7a55be0a3f54ce27a1cbbbc58e1c7b 100644
--- a/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp
+++ b/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp
@@ -63,6 +63,14 @@ WorkerThreadDebugger::~WorkerThreadDebugger()
{
}
+void WorkerThreadDebugger::reportConsoleMessage(ExecutionContext* context, ConsoleMessage* message)
+{
+ if (!context)
+ return;
+ DCHECK(context == m_workerThread->workerGlobalScope());
+ m_workerThread->workerReportingProxy().reportConsoleMessage(message);
+}
+
void WorkerThreadDebugger::contextCreated(v8::Local<v8::Context> context)
{
debugger()->contextCreated(V8ContextInfo(context, workerContextGroupId, true, m_workerThread->workerGlobalScope()->url().getString(), "", "", false));
@@ -78,6 +86,7 @@ void WorkerThreadDebugger::exceptionThrown(const String& errorMessage, std::uniq
if (m_muteConsoleCount)
return;
debugger()->exceptionThrown(workerContextGroupId, errorMessage, location->url(), location->lineNumber(), location->columnNumber(), location->cloneStackTrace(), location->scriptId());
+ m_workerThread->workerReportingProxy().reportConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, errorMessage, std::move(location)));
}
void WorkerThreadDebugger::addConsoleMessage(ConsoleMessage* consoleMessage)
@@ -136,10 +145,11 @@ v8::Local<v8::Context> WorkerThreadDebugger::ensureDefaultContextInGroup(int con
return scriptState ? scriptState->context() : v8::Local<v8::Context>();
}
-void WorkerThreadDebugger::messageAddedToConsole(int contextGroupId, MessageSource source, MessageLevel level, const String16& message, const String16& url, unsigned lineNumber, unsigned columnNumber, V8StackTrace* stackTrace)
+void WorkerThreadDebugger::consoleAPIMessage(int contextGroupId, MessageLevel level, const String16& message, const String16& url, unsigned lineNumber, unsigned columnNumber, V8StackTrace* stackTrace)
{
DCHECK(contextGroupId == workerContextGroupId);
- ConsoleMessage* consoleMessage = ConsoleMessage::create(source, level, message, SourceLocation::create(url, lineNumber, columnNumber, stackTrace ? stackTrace->clone() : nullptr, 0));
+ // TODO(dgozman): maybe not wrap with ConsoleMessage.
+ ConsoleMessage* consoleMessage = ConsoleMessage::create(ConsoleAPIMessageSource, level, message, SourceLocation::create(url, lineNumber, columnNumber, stackTrace ? stackTrace->clone() : nullptr, 0));
m_workerThread->workerReportingProxy().reportConsoleMessage(consoleMessage);
}

Powered by Google App Engine
This is Rietveld 408576698