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

Unified Diff: Source/core/inspector/InspectorPageAgent.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/inspector/InspectorDatabaseAgent.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorPageAgent.cpp
diff --git a/Source/core/inspector/InspectorPageAgent.cpp b/Source/core/inspector/InspectorPageAgent.cpp
index 999c67734948f1c41d159f6893c4e40ee7849d52..077d556cf7778db1b0654c3c02062ec0763445e1 100644
--- a/Source/core/inspector/InspectorPageAgent.cpp
+++ b/Source/core/inspector/InspectorPageAgent.cpp
@@ -801,21 +801,23 @@ void InspectorPageAgent::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWor
void InspectorPageAgent::domContentLoadedEventFired(Frame* frame)
{
- if (frame->page()->mainFrame() != frame)
+ if (!frame->isMainFrame())
return;
-
m_frontend->domContentEventFired(currentTime());
}
void InspectorPageAgent::loadEventFired(Frame* frame)
{
- if (frame->page()->mainFrame() != frame)
+ if (!frame->isMainFrame())
return;
m_frontend->loadEventFired(currentTime());
}
void InspectorPageAgent::didCommitLoad(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 (loader->frame() == m_page->mainFrame()) {
m_scriptToEvaluateOnLoadOnce = m_pendingScriptToEvaluateOnLoadOnce;
m_scriptPreprocessorSource = m_pendingScriptPreprocessor;
« no previous file with comments | « Source/core/inspector/InspectorDatabaseAgent.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698