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

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

Issue 898593002: 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, 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: Source/core/inspector/InspectorDOMAgent.cpp
diff --git a/Source/core/inspector/InspectorDOMAgent.cpp b/Source/core/inspector/InspectorDOMAgent.cpp
index 95745c5ab4e572aa4876721bf792a9246fbf8022..fc07b0e7b44bd8cda93b0fb3b23706dae2554674 100644
--- a/Source/core/inspector/InspectorDOMAgent.cpp
+++ b/Source/core/inspector/InspectorDOMAgent.cpp
@@ -1900,7 +1900,7 @@ bool InspectorDOMAgent::isWhitespace(Node* node)
void InspectorDOMAgent::domContentLoadedEventFired(LocalFrame* frame)
{
- if (!frame->isMainFrame())
+ if (frame != m_pageAgent->mainFrame())
return;
// Re-push document once it is loaded.
@@ -1930,14 +1930,9 @@ void InspectorDOMAgent::invalidateFrameOwnerElement(LocalFrame* frame)
m_frontend->childNodeInserted(parentId, prevId, value.release());
}
-void InspectorDOMAgent::didCommitLoad(LocalFrame* frame, DocumentLoader* loader)
+void InspectorDOMAgent::didCommitLoad(LocalFrame*, 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();
+ LocalFrame* mainFrame = m_pageAgent->mainFrame();
if (loader->frame() != mainFrame) {
invalidateFrameOwnerElement(loader->frame());
return;
@@ -2134,9 +2129,7 @@ void InspectorDOMAgent::frameDocumentUpdated(LocalFrame* frame)
if (!document)
return;
- Page* page = frame->page();
- ASSERT(page);
- if (frame != page->mainFrame())
+ if (frame != m_pageAgent->mainFrame())
return;
// Only update the main frame document, nested frame document updates are not required
@@ -2242,7 +2235,7 @@ void InspectorDOMAgent::pushNodesByBackendIdsToFrontend(ErrorString* errorString
}
Node* node = InspectorNodeIds::nodeForId(backendNodeId);
- if (node && node->document().page() == m_pageAgent->page())
+ if (node && node->document().frame()->instrumentingAgents() == m_pageAgent->mainFrame()->instrumentingAgents())
result->addItem(pushNodePathToFrontend(node));
else
result->addItem(0);

Powered by Google App Engine
This is Rietveld 408576698