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

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

Issue 2251343003: [DevTools] Generate separate copies of inspector_protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 71debf9c29c15b660c51e525dda77b54ef816853..182e8689f57d83d3bc9f029ff2bc6863d285c231 100644
--- a/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp
+++ b/third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp
@@ -40,6 +40,7 @@
#include "core/inspector/ConsoleMessage.h"
#include "core/inspector/ConsoleMessageStorage.h"
#include "core/inspector/IdentifiersFactory.h"
+#include "core/inspector/V8InspectorStringConversion.h"
#include "core/workers/WorkerGlobalScope.h"
#include "core/workers/WorkerReportingProxy.h"
#include "core/workers/WorkerThread.h"
@@ -87,7 +88,7 @@ int WorkerThreadDebugger::contextGroupId(ExecutionContext* context)
void WorkerThreadDebugger::contextCreated(v8::Local<v8::Context> context)
{
v8_inspector::V8ContextInfo contextInfo(context, workerContextGroupId, "");
- contextInfo.origin = m_workerThread->globalScope()->url().getString();
+ contextInfo.origin = toV8InspectorString(m_workerThread->globalScope()->url().getString());
v8Inspector()->contextCreated(contextInfo);
}
@@ -100,13 +101,13 @@ void WorkerThreadDebugger::exceptionThrown(ErrorEvent* event)
{
m_workerThread->workerReportingProxy().reportConsoleMessage(JSMessageSource, ErrorMessageLevel, event->messageForConsole(), event->location());
- const String16 defaultMessage = "Uncaught";
+ const v8_inspector::String16 defaultMessage = "Uncaught";
ScriptState* scriptState = m_workerThread->globalScope()->scriptController()->getScriptState();
if (scriptState && scriptState->contextIsValid()) {
ScriptState::Scope scope(scriptState);
v8::Local<v8::Value> exception = V8ErrorHandler::loadExceptionFromErrorEventWrapper(scriptState, event, scriptState->context()->Global());
SourceLocation* location = event->location();
- v8Inspector()->exceptionThrown(scriptState->context(), defaultMessage, exception, event->messageForConsole(), location->url(), location->lineNumber(), location->columnNumber(), location->takeStackTrace(), location->scriptId());
+ v8Inspector()->exceptionThrown(scriptState->context(), defaultMessage, exception, toV8InspectorString(event->messageForConsole()), toV8InspectorString(location->url()), location->lineNumber(), location->columnNumber(), location->takeStackTrace(), location->scriptId());
}
}
@@ -165,13 +166,13 @@ void WorkerThreadDebugger::runIfWaitingForDebugger(int contextGroupId)
m_workerThread->stopRunningDebuggerTasksOnPauseOnWorkerThread();
}
-void WorkerThreadDebugger::consoleAPIMessage(int contextGroupId, v8_inspector::V8ConsoleAPIType type, const String16& message, const String16& url, unsigned lineNumber, unsigned columnNumber, v8_inspector::V8StackTrace* stackTrace)
+void WorkerThreadDebugger::consoleAPIMessage(int contextGroupId, v8_inspector::V8ConsoleAPIType type, const v8_inspector::String16& message, const v8_inspector::String16& url, unsigned lineNumber, unsigned columnNumber, v8_inspector::V8StackTrace* stackTrace)
{
DCHECK(contextGroupId == workerContextGroupId);
if (type == v8_inspector::V8ConsoleAPIType::kClear)
m_workerThread->consoleMessageStorage()->clear();
- std::unique_ptr<SourceLocation> location = SourceLocation::create(url, lineNumber, columnNumber, stackTrace ? stackTrace->clone() : nullptr, 0);
- m_workerThread->workerReportingProxy().reportConsoleMessage(ConsoleAPIMessageSource, consoleAPITypeToMessageLevel(type), message, location.get());
+ std::unique_ptr<SourceLocation> location = SourceLocation::create(toCoreString(url), lineNumber, columnNumber, stackTrace ? stackTrace->clone() : nullptr, 0);
+ m_workerThread->workerReportingProxy().reportConsoleMessage(ConsoleAPIMessageSource, consoleAPITypeToMessageLevel(type), toCoreString(message), location.get());
}
v8::MaybeLocal<v8::Value> WorkerThreadDebugger::memoryInfo(v8::Isolate*, v8::Local<v8::Context>)

Powered by Google App Engine
This is Rietveld 408576698