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

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

Issue 2656633004: DevTools: migrate v8 console client to the new API. (Closed)
Patch Set: rebaselined Created 3 years, 11 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/MainThreadDebugger.cpp
diff --git a/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp b/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp
index 68399b5eeacd312220041b86418842008f0e9a7f..ef59b8bacff11cd96721c518ad11b1eee6219285 100644
--- a/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp
+++ b/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp
@@ -301,7 +301,7 @@ void MainThreadDebugger::runIfWaitingForDebugger(int contextGroupId) {
void MainThreadDebugger::consoleAPIMessage(
int contextGroupId,
- v8_inspector::V8ConsoleAPIType type,
+ v8::Isolate::MessageErrorLevel level,
const v8_inspector::StringView& message,
const v8_inspector::StringView& url,
unsigned lineNumber,
@@ -310,18 +310,24 @@ void MainThreadDebugger::consoleAPIMessage(
LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId);
if (!frame)
return;
- if (type == v8_inspector::V8ConsoleAPIType::kClear && frame->host())
- frame->host()->consoleMessageStorage().clear();
// TODO(dgozman): we can save a copy of message and url here by making
// FrameConsole work with StringView.
std::unique_ptr<SourceLocation> location =
SourceLocation::create(toCoreString(url), lineNumber, columnNumber,
stackTrace ? stackTrace->clone() : nullptr, 0);
frame->console().reportMessageToClient(ConsoleAPIMessageSource,
- consoleAPITypeToMessageLevel(type),
+ v8MessageLevelToMessageLevel(level),
toCoreString(message), location.get());
}
+void MainThreadDebugger::consoleClear(int contextGroupId) {
+ LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId);
+ if (!frame)
+ return;
+ if (frame->host())
+ frame->host()->consoleMessageStorage().clear();
+}
+
v8::MaybeLocal<v8::Value> MainThreadDebugger::memoryInfo(
v8::Isolate* isolate,
v8::Local<v8::Context> context) {

Powered by Google App Engine
This is Rietveld 408576698