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

Unified Diff: Source/core/inspector/ConsoleMessage.cpp

Issue 221923003: DevTools: Add executionContextId in ConsoleMessage in backend (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix compilation on linux bots Created 6 years, 9 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
« no previous file with comments | « Source/core/inspector/ConsoleMessage.h ('k') | Source/devtools/front_end/ConsoleModel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/ConsoleMessage.cpp
diff --git a/Source/core/inspector/ConsoleMessage.cpp b/Source/core/inspector/ConsoleMessage.cpp
index 17b80861e289844cdb3164fc6d25d8d353780204..b19ce845650cf5685ba01b351dbdd33f92628060 100644
--- a/Source/core/inspector/ConsoleMessage.cpp
+++ b/Source/core/inspector/ConsoleMessage.cpp
@@ -35,6 +35,7 @@
#include "bindings/v8/ScriptCallStackFactory.h"
#include "bindings/v8/ScriptValue.h"
+#include "core/dom/ExecutionContext.h"
#include "core/inspector/IdentifiersFactory.h"
#include "core/inspector/InjectedScript.h"
#include "core/inspector/InjectedScriptManager.h"
@@ -64,6 +65,7 @@ ConsoleMessage::ConsoleMessage(bool canGenerateCallStack, MessageSource source,
, m_type(type)
, m_level(level)
, m_message(message)
+ , m_scriptState(state)
, m_url(url)
, m_line(line)
, m_column(column)
@@ -78,6 +80,7 @@ ConsoleMessage::ConsoleMessage(bool, MessageSource source, MessageType type, Mes
, m_type(type)
, m_level(level)
, m_message(message)
+ , m_scriptState(0)
, m_arguments(nullptr)
, m_line(0)
, m_column(0)
@@ -98,6 +101,7 @@ ConsoleMessage::ConsoleMessage(bool canGenerateCallStack, MessageSource source,
, m_type(type)
, m_level(level)
, m_message(message)
+ , m_scriptState(state)
, m_arguments(arguments)
, m_url()
, m_line(0)
@@ -194,6 +198,8 @@ void ConsoleMessage::addToFrontend(InspectorFrontend::Console* frontend, Injecte
jsonObj->setLine(static_cast<int>(m_line));
jsonObj->setColumn(static_cast<int>(m_column));
jsonObj->setUrl(m_url);
+ if (m_scriptState && m_scriptState->executionContext()->isDocument())
+ jsonObj->setExecutionContextId(injectedScriptManager->injectedScriptIdFor(m_scriptState));
if (m_source == NetworkMessageSource && !m_requestId.isEmpty())
jsonObj->setNetworkRequestId(m_requestId);
if (m_arguments && m_arguments->argumentCount()) {
@@ -229,6 +235,9 @@ void ConsoleMessage::addToFrontend(InspectorFrontend::Console* frontend, Injecte
void ConsoleMessage::windowCleared(DOMWindow* window)
{
+ if (m_scriptState && m_scriptState->domWindow() == window)
+ m_scriptState = 0;
+
if (!m_arguments)
return;
if (m_arguments->globalState()->domWindow() != window)
« no previous file with comments | « Source/core/inspector/ConsoleMessage.h ('k') | Source/devtools/front_end/ConsoleModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698