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

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

Issue 115693002: Remove several calls to Page::mainFrame (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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/css/MediaQueryEvaluator.cpp ('k') | Source/core/inspector/InspectorDatabaseAgent.cpp » ('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 8637e7a4364f000b9cb031b01cb9e147547d5be9..4d48c5c2866b92fdc2aaf91f972e7e7a35b15ccf 100644
--- a/Source/core/inspector/InspectorDOMAgent.cpp
+++ b/Source/core/inspector/InspectorDOMAgent.cpp
@@ -1698,7 +1698,7 @@ bool InspectorDOMAgent::isWhitespace(Node* node)
void InspectorDOMAgent::domContentLoadedEventFired(Frame* frame)
{
- if (frame->page()->mainFrame() != frame)
+ if (!frame->isMainFrame())
return;
// Re-push document once it is loaded.
@@ -1730,6 +1730,9 @@ void InspectorDOMAgent::invalidateFrameOwnerElement(Frame* frame)
void InspectorDOMAgent::didCommitLoad(Frame* 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.
Frame* mainFrame = frame->page()->mainFrame();
if (loader->frame() != mainFrame) {
invalidateFrameOwnerElement(loader->frame());
« no previous file with comments | « Source/core/css/MediaQueryEvaluator.cpp ('k') | Source/core/inspector/InspectorDatabaseAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698