Index: third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp |
diff --git a/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp b/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp |
index 19531b0375fa3d77f1c49923cd3d17531d5b4fe2..b01a4226d689b9dfdf32f906a8296d36551bb97c 100644 |
--- a/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp |
+++ b/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp |
@@ -56,6 +56,8 @@ |
#include "core/inspector/IdentifiersFactory.h" |
#include "core/inspector/InspectedFrames.h" |
#include "core/inspector/InspectorTaskRunner.h" |
+#include "core/inspector/V8InspectorStringConversion.h" |
+#include "core/inspector/protocol/InspectorProtocol.h" |
#include "core/timing/MemoryInfo.h" |
#include "core/workers/MainThreadWorkletGlobalScope.h" |
#include "core/xml/XPathEvaluator.h" |
@@ -148,10 +150,10 @@ void MainThreadDebugger::contextCreated(ScriptState* scriptState, LocalFrame* fr |
std::unique_ptr<protocol::DictionaryValue> auxData = protocol::DictionaryValue::create(); |
auxData->setBoolean("isDefault", world.isMainWorld()); |
auxData->setString("frameId", IdentifiersFactory::frameId(frame)); |
- v8_inspector::V8ContextInfo contextInfo(scriptState->context(), contextGroupId(frame), world.isIsolatedWorld() ? world.isolatedWorldHumanReadableName() : ""); |
+ v8_inspector::V8ContextInfo contextInfo(scriptState->context(), contextGroupId(frame), world.isIsolatedWorld() ? toV8InspectorString(world.isolatedWorldHumanReadableName()) : v8_inspector::String16()); |
if (origin) |
- contextInfo.origin = origin->toRawString(); |
- contextInfo.auxData = auxData->toJSONString(); |
+ contextInfo.origin = toV8InspectorString(origin->toRawString()); |
+ contextInfo.auxData = toV8InspectorString(auxData->toJSONString()); |
contextInfo.hasMemoryOnConsole = scriptState->getExecutionContext()->isDocument(); |
v8Inspector()->contextCreated(contextInfo); |
} |
@@ -182,12 +184,12 @@ void MainThreadDebugger::exceptionThrown(ExecutionContext* context, ErrorEvent* |
frame->console().reportMessageToClient(JSMessageSource, ErrorMessageLevel, event->messageForConsole(), event->location()); |
- const String16 defaultMessage = "Uncaught"; |
+ const v8_inspector::String16 defaultMessage = "Uncaught"; |
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()); |
} |
} |
@@ -287,15 +289,15 @@ void MainThreadDebugger::runIfWaitingForDebugger(int contextGroupId) |
m_clientMessageLoop->runIfWaitingForDebugger(frame); |
} |
-void MainThreadDebugger::consoleAPIMessage(int contextGroupId, v8_inspector::V8ConsoleAPIType type, const String16& message, const String16& url, unsigned lineNumber, unsigned columnNumber, v8_inspector::V8StackTrace* stackTrace) |
+void MainThreadDebugger::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) |
{ |
LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); |
if (!frame) |
return; |
if (type == v8_inspector::V8ConsoleAPIType::kClear && frame->host()) |
frame->host()->consoleMessageStorage().clear(); |
- std::unique_ptr<SourceLocation> location = SourceLocation::create(url, lineNumber, columnNumber, stackTrace ? stackTrace->clone() : nullptr, 0); |
- frame->console().reportMessageToClient(ConsoleAPIMessageSource, consoleAPITypeToMessageLevel(type), message, location.get()); |
+ std::unique_ptr<SourceLocation> location = SourceLocation::create(toCoreString(url), lineNumber, columnNumber, stackTrace ? stackTrace->clone() : nullptr, 0); |
+ frame->console().reportMessageToClient(ConsoleAPIMessageSource, consoleAPITypeToMessageLevel(type), toCoreString(message), location.get()); |
} |
v8::MaybeLocal<v8::Value> MainThreadDebugger::memoryInfo(v8::Isolate* isolate, v8::Local<v8::Context> context) |