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

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

Issue 2249743006: [DevTools] Fill ExceptionDetails with more details, unify usage across protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: browser test 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/platform/v8_inspector/V8ConsoleMessage.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8ConsoleMessage.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8ConsoleMessage.cpp
index 808508f75e0dcd612f0aff65a7475c2daffcdc59..160ec7417df6b9de8c59f15616b9fceeb02bfb02 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8ConsoleMessage.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8ConsoleMessage.cpp
@@ -262,22 +262,23 @@ void V8ConsoleMessage::reportToFrontend(protocol::Runtime::Frontend* frontend, V
{
if (m_origin == V8MessageOrigin::kException) {
std::unique_ptr<protocol::Runtime::RemoteObject> exception = wrapException(session, generatePreview);
- // TODO(dgozman): unify with InjectedScript::createExceptionDetails.
- std::unique_ptr<protocol::Runtime::ExceptionDetails> details = protocol::Runtime::ExceptionDetails::create()
+ std::unique_ptr<protocol::Runtime::ExceptionDetails> exceptionDetails = protocol::Runtime::ExceptionDetails::create()
+ .setExceptionId(m_exceptionId)
.setText(exception ? m_message : m_detailedMessage)
.setLineNumber(m_lineNumber ? m_lineNumber - 1 : 0)
.setColumnNumber(m_columnNumber ? m_columnNumber - 1 : 0)
- .setScriptId(m_scriptId ? String16::fromInteger(m_scriptId) : String16())
.build();
+ if (m_scriptId)
+ exceptionDetails->setScriptId(String16::fromInteger(m_scriptId));
if (!m_url.isEmpty())
- details->setUrl(m_url);
+ exceptionDetails->setUrl(m_url);
if (m_stackTrace)
- details->setStackTrace(m_stackTrace->buildInspectorObjectImpl());
-
+ exceptionDetails->setStackTrace(m_stackTrace->buildInspectorObjectImpl());
+ if (m_contextId)
+ exceptionDetails->setExecutionContextId(m_contextId);
if (exception)
- frontend->exceptionThrown(m_exceptionId, m_timestamp, std::move(details), std::move(exception), m_contextId);
- else
- frontend->exceptionThrown(m_exceptionId, m_timestamp, std::move(details));
+ exceptionDetails->setException(std::move(exception));
+ frontend->exceptionThrown(m_timestamp, std::move(exceptionDetails));
return;
}
if (m_origin == V8MessageOrigin::kRevokedException) {

Powered by Google App Engine
This is Rietveld 408576698