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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/InspectorDatabaseAgent.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 if (it->value->asString(&scriptText)) 794 if (it->value->asString(&scriptText))
795 frame->script().executeScriptInMainWorld(scriptText); 795 frame->script().executeScriptInMainWorld(scriptText);
796 } 796 }
797 } 797 }
798 if (!m_scriptToEvaluateOnLoadOnce.isEmpty()) 798 if (!m_scriptToEvaluateOnLoadOnce.isEmpty())
799 frame->script().executeScriptInMainWorld(m_scriptToEvaluateOnLoadOnce); 799 frame->script().executeScriptInMainWorld(m_scriptToEvaluateOnLoadOnce);
800 } 800 }
801 801
802 void InspectorPageAgent::domContentLoadedEventFired(Frame* frame) 802 void InspectorPageAgent::domContentLoadedEventFired(Frame* frame)
803 { 803 {
804 if (frame->page()->mainFrame() != frame) 804 if (!frame->isMainFrame())
805 return; 805 return;
806
807 m_frontend->domContentEventFired(currentTime()); 806 m_frontend->domContentEventFired(currentTime());
808 } 807 }
809 808
810 void InspectorPageAgent::loadEventFired(Frame* frame) 809 void InspectorPageAgent::loadEventFired(Frame* frame)
811 { 810 {
812 if (frame->page()->mainFrame() != frame) 811 if (!frame->isMainFrame())
813 return; 812 return;
814 m_frontend->loadEventFired(currentTime()); 813 m_frontend->loadEventFired(currentTime());
815 } 814 }
816 815
817 void InspectorPageAgent::didCommitLoad(Frame*, DocumentLoader* loader) 816 void InspectorPageAgent::didCommitLoad(Frame*, DocumentLoader* loader)
818 { 817 {
818 // FIXME: If "frame" is always guarenteed to be in the same Page as loader-> frame()
819 // then all we need to check here is loader->frame()->isMainFrame()
820 // and we don't need "frame" at all.
819 if (loader->frame() == m_page->mainFrame()) { 821 if (loader->frame() == m_page->mainFrame()) {
820 m_scriptToEvaluateOnLoadOnce = m_pendingScriptToEvaluateOnLoadOnce; 822 m_scriptToEvaluateOnLoadOnce = m_pendingScriptToEvaluateOnLoadOnce;
821 m_scriptPreprocessorSource = m_pendingScriptPreprocessor; 823 m_scriptPreprocessorSource = m_pendingScriptPreprocessor;
822 m_pendingScriptToEvaluateOnLoadOnce = String(); 824 m_pendingScriptToEvaluateOnLoadOnce = String();
823 m_pendingScriptPreprocessor = String(); 825 m_pendingScriptPreprocessor = String();
824 } 826 }
825 m_frontend->frameNavigated(buildObjectForFrame(loader->frame())); 827 m_frontend->frameNavigated(buildObjectForFrame(loader->frame()));
826 } 828 }
827 829
828 void InspectorPageAgent::frameAttachedToParent(Frame* frame) 830 void InspectorPageAgent::frameAttachedToParent(Frame* frame)
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
1267 } 1269 }
1268 1270
1269 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid) 1271 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid)
1270 { 1272 {
1271 m_state->setBoolean(PageAgentState::showSizeOnResize, show); 1273 m_state->setBoolean(PageAgentState::showSizeOnResize, show);
1272 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid) ; 1274 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid) ;
1273 } 1275 }
1274 1276
1275 } // namespace WebCore 1277 } // namespace WebCore
1276 1278
OLDNEW
« 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