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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp

Issue 2139543002: [DevTools] Report console API calls through Runtime. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tests pass Created 4 years, 5 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/platform/v8_inspector/V8DebuggerImpl.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp
index bfbcd974baa3f7eb43d69e108269c88d0925f6e3..5c83833bf20681c1baae4b39919965c444dcaa69 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp
@@ -1011,7 +1011,7 @@ void V8DebuggerImpl::addConsoleMessage(int contextGroupId, MessageSource source,
ensureConsoleMessageStorage(contextGroupId)->addMessage(V8ConsoleMessage::createExternal(m_client->currentTimeMS(), source, level, message, url, lineNumber, columnNumber, std::move(stackTrace), scriptId, requestIdentifier, workerId));
}
-void V8DebuggerImpl::logToConsole(v8::Local<v8::Context> context, const String16& message, v8::Local<v8::Value> arg1, v8::Local<v8::Value> arg2)
+void V8DebuggerImpl::logToConsole(v8::Local<v8::Context> context, v8::Local<v8::Value> arg1, v8::Local<v8::Value> arg2)
{
int contextGroupId = getGroupId(context);
InspectedContext* inspectedContext = getContext(contextGroupId, contextId(context));
@@ -1022,12 +1022,11 @@ void V8DebuggerImpl::logToConsole(v8::Local<v8::Context> context, const String16
arguments.push_back(arg1);
if (!arg2.IsEmpty())
arguments.push_back(arg2);
- ensureConsoleMessageStorage(contextGroupId)->addMessage(V8ConsoleMessage::createForConsoleAPI(m_client->currentTimeMS(), ConsoleAPIType::kLog, LogMessageLevel, message, arguments.size() ? &arguments : nullptr, captureStackTrace(false), inspectedContext));
+ ensureConsoleMessageStorage(contextGroupId)->addMessage(V8ConsoleMessage::createForConsoleAPI(m_client->currentTimeMS(), ConsoleAPIType::kLog, arguments, captureStackTrace(false), inspectedContext));
}
void V8DebuggerImpl::exceptionThrown(int contextGroupId, const String16& errorMessage, const String16& url, unsigned lineNumber, unsigned columnNumber, std::unique_ptr<V8StackTrace> stackTrace, int scriptId)
{
- m_client->messageAddedToConsole(contextGroupId, JSMessageSource, ErrorMessageLevel, errorMessage, url, lineNumber, columnNumber, stackTrace.get());
unsigned exceptionId = ++m_lastExceptionId;
std::unique_ptr<V8ConsoleMessage> consoleMessage = V8ConsoleMessage::createForException(m_client->currentTimeMS(), errorMessage, url, lineNumber, columnNumber, std::move(stackTrace), scriptId, m_isolate, 0, v8::Local<v8::Value>(), exceptionId);
ensureConsoleMessageStorage(contextGroupId)->addMessage(std::move(consoleMessage));
@@ -1046,7 +1045,6 @@ unsigned V8DebuggerImpl::promiseRejected(v8::Local<v8::Context> context, const S
else if (message.startWith("Uncaught "))
message = message.substring(0, 8) + " (in promise)" + message.substring(8);
- m_client->messageAddedToConsole(contextGroupId, JSMessageSource, ErrorMessageLevel, message, url, lineNumber, columnNumber, stackTrace.get());
unsigned exceptionId = ++m_lastExceptionId;
std::unique_ptr<V8ConsoleMessage> consoleMessage = V8ConsoleMessage::createForException(m_client->currentTimeMS(), message, url, lineNumber, columnNumber, std::move(stackTrace), scriptId, m_isolate, contextId(context), exception, exceptionId);
ensureConsoleMessageStorage(contextGroupId)->addMessage(std::move(consoleMessage));

Powered by Google App Engine
This is Rietveld 408576698