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

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

Issue 892693006: Revert of DevTools: use per-LocalFrame instrumenting agents instead of per-Page ones. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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/InspectorController.cpp ('k') | Source/core/inspector/InspectorDOMStorageAgent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorDOMAgent.cpp
diff --git a/Source/core/inspector/InspectorDOMAgent.cpp b/Source/core/inspector/InspectorDOMAgent.cpp
index 1d1dbc220c76d866fbefc670c65d579d6437b5b8..ecbdd5a17e802bd49363d93138791a520bb51491 100644
--- a/Source/core/inspector/InspectorDOMAgent.cpp
+++ b/Source/core/inspector/InspectorDOMAgent.cpp
@@ -283,7 +283,7 @@
m_frontend = frontend->dom();
m_instrumentingAgents->setInspectorDOMAgent(this);
- m_document = m_pageAgent->inspectedFrame()->document();
+ m_document = m_pageAgent->mainFrame()->document();
}
void InspectorDOMAgent::clearFrontend()
@@ -532,7 +532,7 @@
{
m_state->setBoolean(DOMAgentState::domAgentEnabled, true);
m_document = nullptr;
- setDocument(m_pageAgent->inspectedFrame()->document());
+ setDocument(m_pageAgent->mainFrame()->document());
if (m_listener)
m_listener->domAgentWasEnabled();
}
@@ -1900,7 +1900,7 @@
void InspectorDOMAgent::domContentLoadedEventFired(LocalFrame* frame)
{
- if (frame != m_pageAgent->inspectedFrame())
+ if (!frame->isMainFrame())
return;
// Re-push document once it is loaded.
@@ -1930,15 +1930,20 @@
m_frontend->childNodeInserted(parentId, prevId, value.release());
}
-void InspectorDOMAgent::didCommitLoad(LocalFrame*, DocumentLoader* loader)
-{
- LocalFrame* inspectedFrame = m_pageAgent->inspectedFrame();
- if (loader->frame() != inspectedFrame) {
+void InspectorDOMAgent::didCommitLoad(LocalFrame* frame, DocumentLoader* loader)
+{
+ // FIXME: If "frame" is always guarenteed to be in the same Page as loader->frame()
+ // then all we need to check here is loader->frame()->isMainFrame()
+ // and we don't need "frame" at all.
+ if (!frame->page()->mainFrame()->isLocalFrame())
+ return;
+ LocalFrame* mainFrame = frame->page()->deprecatedLocalMainFrame();
+ if (loader->frame() != mainFrame) {
invalidateFrameOwnerElement(loader->frame());
return;
}
- setDocument(inspectedFrame->document());
+ setDocument(mainFrame->document());
}
void InspectorDOMAgent::didInsertDOMNode(Node* node)
@@ -2129,7 +2134,9 @@
if (!document)
return;
- if (frame != m_pageAgent->inspectedFrame())
+ Page* page = frame->page();
+ ASSERT(page);
+ if (frame != page->mainFrame())
return;
// Only update the main frame document, nested frame document updates are not required
@@ -2235,7 +2242,7 @@
}
Node* node = InspectorNodeIds::nodeForId(backendNodeId);
- if (node && node->document().frame()->instrumentingAgents() == m_pageAgent->inspectedFrame()->instrumentingAgents())
+ if (node && node->document().page() == m_pageAgent->page())
result->addItem(pushNodePathToFrontend(node));
else
result->addItem(0);
« no previous file with comments | « Source/core/inspector/InspectorController.cpp ('k') | Source/core/inspector/InspectorDOMStorageAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698