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

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

Issue 2035653006: [DevTools] Move Console to v8 inspector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improved api a bit Created 4 years, 6 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 8f7d53f68da6255f6cd2f1f92f758ed886094ff9..80129d3d546136f46fb6788412a1e793e986bc38 100644
--- a/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp
+++ b/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp
@@ -31,7 +31,10 @@
#include "core/inspector/WorkerThreadDebugger.h"
#include "bindings/core/v8/ScriptState.h"
+#include "bindings/core/v8/SourceLocation.h"
#include "bindings/core/v8/V8ScriptRunner.h"
+#include "core/inspector/ConsoleMessage.h"
+#include "core/workers/WorkerReportingProxy.h"
#include "core/workers/WorkerThread.h"
#include <v8.h>
@@ -89,21 +92,18 @@ bool WorkerThreadDebugger::callingContextCanAccessContext(v8::Local<v8::Context>
return true;
}
-int WorkerThreadDebugger::ensureDefaultContextInGroup(int contextGroupId)
+v8::Local<v8::Context> WorkerThreadDebugger::ensureDefaultContextInGroup(int contextGroupId)
{
ASSERT(contextGroupId == workerContextGroupId);
ScriptState* scriptState = m_workerThread->workerGlobalScope()->scriptController()->getScriptState();
- if (!scriptState)
- return 0;
- v8::HandleScope scopes(scriptState->isolate());
- return V8Debugger::contextId(scriptState->context());
+ return scriptState ? scriptState->context() : v8::Local<v8::Context>();
}
-void WorkerThreadDebugger::reportMessageToConsole(v8::Local<v8::Context> context, ConsoleMessage* message)
+void WorkerThreadDebugger::messageAddedToConsole(int contextGroupId, MessageSource source, MessageLevel level, const String16& message, const String16& url, unsigned lineNumber, unsigned columnNumber, V8StackTrace* stackTrace)
{
- ExecutionContext* executionContext = toExecutionContext(context);
- ASSERT(executionContext->isWorkerGlobalScope());
- executionContext->addConsoleMessage(message);
+ DCHECK(contextGroupId == workerContextGroupId);
+ ConsoleMessage* consoleMessage = ConsoleMessage::create(source, level, message, SourceLocation::create(url, lineNumber, columnNumber, stackTrace ? stackTrace->clone() : nullptr, 0));
+ m_workerThread->workerReportingProxy().reportConsoleMessage(consoleMessage);
}
v8::MaybeLocal<v8::Value> WorkerThreadDebugger::memoryInfo(v8::Isolate*, v8::Local<v8::Context>)

Powered by Google App Engine
This is Rietveld 408576698