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

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

Issue 2260233002: [DevTools] Migrate v8_inspector/public from String16 to String{View,Buffer}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: better 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/ThreadDebugger.cpp
diff --git a/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp b/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp
index db93b851e86ce39301a4b4bab054583de1917e23..bc52492af0caf878e2acce65151cfaedfd205acf 100644
--- a/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp
+++ b/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp
@@ -20,6 +20,7 @@
#include "core/inspector/ConsoleMessage.h"
#include "core/inspector/InspectorDOMDebuggerAgent.h"
#include "core/inspector/InspectorTraceEvents.h"
+#include "core/inspector/V8InspectorStringView.h"
#include "platform/ScriptForbiddenScope.h"
#include "wtf/CurrentTime.h"
#include "wtf/PtrUtil.h"
@@ -85,7 +86,7 @@ void ThreadDebugger::idleFinished(v8::Isolate* isolate)
void ThreadDebugger::asyncTaskScheduled(const String& operationName, void* task, bool recurring)
{
- m_v8Inspector->asyncTaskScheduled(operationName, task, recurring);
+ m_v8Inspector->asyncTaskScheduled(toV8InspectorStringView(operationName), task, recurring);
}
void ThreadDebugger::asyncTaskCanceled(void* task)
@@ -118,13 +119,14 @@ unsigned ThreadDebugger::promiseRejected(v8::Local<v8::Context> context, const S
message = message.substring(0, 8) + " (in promise)" + message.substring(8);
reportConsoleMessage(toExecutionContext(context), JSMessageSource, ErrorMessageLevel, message, location.get());
- return v8Inspector()->exceptionThrown(context, defaultMessage, exception, message, location->url(), location->lineNumber(), location->columnNumber(), location->takeStackTrace(), location->scriptId());
+ String url = location->url();
+ return v8Inspector()->exceptionThrown(context, toV8InspectorStringView(defaultMessage), exception, toV8InspectorStringView(message), toV8InspectorStringView(url), location->lineNumber(), location->columnNumber(), location->takeStackTrace(), location->scriptId());
}
void ThreadDebugger::promiseRejectionRevoked(v8::Local<v8::Context> context, unsigned promiseRejectionId)
{
const String message = "Handler added to rejected promise";
- v8Inspector()->exceptionRevoked(context, promiseRejectionId, message);
+ v8Inspector()->exceptionRevoked(context, promiseRejectionId, toV8InspectorStringView(message));
}
void ThreadDebugger::beginUserGesture()
@@ -137,19 +139,22 @@ void ThreadDebugger::endUserGesture()
m_userGestureIndicator.reset();
}
-String16 ThreadDebugger::valueSubtype(v8::Local<v8::Value> value)
+v8_inspector::StringView ThreadDebugger::valueSubtype(v8::Local<v8::Value> value)
{
+ static const char kNode[] = "node";
+ static const char kArray[] = "array";
+ static const char kError[] = "error";
if (V8Node::hasInstance(value, m_isolate))
- return "node";
+ return toV8InspectorStringView(kNode);
if (V8NodeList::hasInstance(value, m_isolate)
|| V8DOMTokenList::hasInstance(value, m_isolate)
|| V8HTMLCollection::hasInstance(value, m_isolate)
|| V8HTMLAllCollection::hasInstance(value, m_isolate)) {
- return "array";
+ return toV8InspectorStringView(kArray);
}
if (V8DOMException::hasInstance(value, m_isolate))
- return "error";
- return String();
+ return toV8InspectorStringView(kError);
+ return v8_inspector::StringView();
}
bool ThreadDebugger::formatAccessorsAsProperties(v8::Local<v8::Value> value)
@@ -327,20 +332,20 @@ void ThreadDebugger::getEventListenersCallback(const v8::FunctionCallbackInfo<v8
info.GetReturnValue().Set(result);
}
-void ThreadDebugger::consoleTime(const String16& title)
+void ThreadDebugger::consoleTime(const v8_inspector::StringView& title)
{
- TRACE_EVENT_COPY_ASYNC_BEGIN0("blink.console", String(title).utf8().data(), this);
+ TRACE_EVENT_COPY_ASYNC_BEGIN0("blink.console", toCoreString(title).utf8().data(), this);
}
-void ThreadDebugger::consoleTimeEnd(const String16& title)
+void ThreadDebugger::consoleTimeEnd(const v8_inspector::StringView& title)
{
- TRACE_EVENT_COPY_ASYNC_END0("blink.console", String(title).utf8().data(), this);
+ TRACE_EVENT_COPY_ASYNC_END0("blink.console", toCoreString(title).utf8().data(), this);
}
-void ThreadDebugger::consoleTimeStamp(const String16& title)
+void ThreadDebugger::consoleTimeStamp(const v8_inspector::StringView& title)
{
v8::Isolate* isolate = m_isolate;
- TRACE_EVENT_INSTANT1("devtools.timeline", "TimeStamp", TRACE_EVENT_SCOPE_THREAD, "data", InspectorTimeStampEvent::data(currentExecutionContext(isolate), title));
+ TRACE_EVENT_INSTANT1("devtools.timeline", "TimeStamp", TRACE_EVENT_SCOPE_THREAD, "data", InspectorTimeStampEvent::data(currentExecutionContext(isolate), toCoreString(title)));
}
void ThreadDebugger::startRepeatingTimer(double interval, V8InspectorClient::TimerCallback callback, void* data)

Powered by Google App Engine
This is Rietveld 408576698