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

Unified Diff: Source/core/loader/HistoryController.cpp

Issue 31063004: Have Frame::loader() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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/loader/FrameLoader.cpp ('k') | Source/core/loader/MixedContentChecker.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/HistoryController.cpp
diff --git a/Source/core/loader/HistoryController.cpp b/Source/core/loader/HistoryController.cpp
index d1b5a10aea4beecab21b08f041c4b260ea13699d..51edac66d54f4707a6cab3a725102cd2c1437989 100644
--- a/Source/core/loader/HistoryController.cpp
+++ b/Source/core/loader/HistoryController.cpp
@@ -80,7 +80,7 @@ void HistoryController::clearScrollPositionAndViewState()
*/
void HistoryController::restoreScrollPositionAndViewState()
{
- if (!m_currentItem || !m_frame->loader()->stateMachine()->committedFirstRealDocumentLoad())
+ if (!m_currentItem || !m_frame->loader().stateMachine()->committedFirstRealDocumentLoad())
return;
if (FrameView* view = m_frame->view()) {
@@ -129,7 +129,7 @@ void HistoryController::saveDocumentAndScrollState()
void HistoryController::restoreDocumentState()
{
- if (m_currentItem && m_frame->loader()->loadType() == FrameLoadTypeBackForward)
+ if (m_currentItem && m_frame->loader().loadType() == FrameLoadTypeBackForward)
m_frame->document()->setStateForNewFormElements(m_currentItem->documentState());
}
@@ -182,7 +182,7 @@ void HistoryController::setDefersLoading(bool defer)
void HistoryController::clearProvisionalItemsInAllFrames()
{
for (RefPtr<Frame> frame = m_frame->page()->mainFrame(); frame; frame = frame->tree().traverseNext())
- frame->loader()->history()->m_provisionalItem = 0;
+ frame->loader().history()->m_provisionalItem = 0;
}
// There are 2 things you might think of as "history", all of which are handled by these functions.
@@ -192,25 +192,25 @@ void HistoryController::clearProvisionalItemsInAllFrames()
//
void HistoryController::updateForStandardLoad()
{
- LOG(History, "WebCoreHistory: Updating History for Standard Load in frame %s", m_frame->loader()->documentLoader()->url().string().ascii().data());
+ LOG(History, "WebCoreHistory: Updating History for Standard Load in frame %s", m_frame->loader().documentLoader()->url().string().ascii().data());
createNewBackForwardItem(true);
}
void HistoryController::updateForInitialLoadInChildFrame()
{
Frame* parentFrame = m_frame->tree().parent();
- if (parentFrame && parentFrame->loader()->history()->m_currentItem)
- parentFrame->loader()->history()->m_currentItem->setChildItem(createItem());
+ if (parentFrame && parentFrame->loader().history()->m_currentItem)
+ parentFrame->loader().history()->m_currentItem->setChildItem(createItem());
}
void HistoryController::updateForCommit()
{
- FrameLoader* frameLoader = m_frame->loader();
+ FrameLoader& frameLoader = m_frame->loader();
#if !LOG_DISABLED
if (m_frame->document())
LOG(History, "WebCoreHistory: Updating History for commit in frame %s", m_frame->document()->title().utf8().data());
#endif
- FrameLoadType type = frameLoader->loadType();
+ FrameLoadType type = frameLoader.loadType();
if (isBackForwardLoadType(type)) {
// Once committed, we want to use current item for saving DocState, and
// the provisional item for restoring state.
@@ -226,7 +226,7 @@ void HistoryController::updateForCommit()
// committed) and its children (which will be replaced).
Page* page = m_frame->page();
ASSERT(page);
- page->mainFrame()->loader()->history()->recursiveUpdateForCommit();
+ page->mainFrame()->loader().history()->recursiveUpdateForCommit();
} else if (type != FrameLoadTypeRedirectWithLockedBackForwardList) {
m_provisionalItem = 0;
}
@@ -264,7 +264,7 @@ void HistoryController::recursiveUpdateForCommit()
// Iterate over the rest of the tree
for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree().nextSibling())
- child->loader()->history()->recursiveUpdateForCommit();
+ child->loader().history()->recursiveUpdateForCommit();
}
void HistoryController::updateForSameDocumentNavigation()
@@ -276,7 +276,7 @@ void HistoryController::updateForSameDocumentNavigation()
if (!page)
return;
- page->mainFrame()->loader()->history()->recursiveUpdateForSameDocumentNavigation();
+ page->mainFrame()->loader().history()->recursiveUpdateForSameDocumentNavigation();
if (m_currentItem)
m_currentItem->setURL(m_frame->document()->url());
@@ -301,7 +301,7 @@ void HistoryController::recursiveUpdateForSameDocumentNavigation()
// Iterate over the rest of the tree.
for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree().nextSibling())
- child->loader()->history()->recursiveUpdateForSameDocumentNavigation();
+ child->loader().history()->recursiveUpdateForSameDocumentNavigation();
}
void HistoryController::setCurrentItem(HistoryItem* item)
@@ -326,7 +326,7 @@ void HistoryController::setProvisionalItem(HistoryItem* item)
void HistoryController::initializeItem(HistoryItem* item)
{
- DocumentLoader* documentLoader = m_frame->loader()->documentLoader();
+ DocumentLoader* documentLoader = m_frame->loader().documentLoader();
ASSERT(documentLoader);
KURL unreachableURL = documentLoader->unreachableURL();
@@ -394,9 +394,9 @@ PassRefPtr<HistoryItem> HistoryController::createItemTree(Frame* targetFrame, bo
// If the child is a frame corresponding to an <object> element that never loaded,
// we don't want to create a history item, because that causes fallback content
// to be ignored on reload.
- FrameLoader* childLoader = child->loader();
- if (childLoader->stateMachine()->startedFirstRealLoad() || !child->ownerElement()->isObjectElement())
- bfItem->addChildItem(childLoader->history()->createItemTree(targetFrame, clipAtTarget));
+ FrameLoader& childLoader = child->loader();
+ if (childLoader.stateMachine()->startedFirstRealLoad() || !child->ownerElement()->isObjectElement())
+ bfItem->addChildItem(childLoader.history()->createItemTree(targetFrame, clipAtTarget));
}
}
return bfItem;
@@ -424,7 +424,7 @@ void HistoryController::recursiveSetProvisionalItem(HistoryItem* item, HistoryIt
ASSERT(fromChildItem);
Frame* childFrame = m_frame->tree().child(childFrameName);
ASSERT(childFrame);
- childFrame->loader()->history()->recursiveSetProvisionalItem(childItems[i].get(), fromChildItem);
+ childFrame->loader().history()->recursiveSetProvisionalItem(childItems[i].get(), fromChildItem);
}
}
}
@@ -446,10 +446,10 @@ void HistoryController::recursiveGoToItem(HistoryItem* item, HistoryItem* fromIt
ASSERT(fromChildItem);
Frame* childFrame = m_frame->tree().child(childFrameName);
ASSERT(childFrame);
- childFrame->loader()->history()->recursiveGoToItem(childItems[i].get(), fromChildItem);
+ childFrame->loader().history()->recursiveGoToItem(childItems[i].get(), fromChildItem);
}
} else {
- m_frame->loader()->loadHistoryItem(item);
+ m_frame->loader().loadHistoryItem(item);
}
}
@@ -500,14 +500,14 @@ void HistoryController::createNewBackForwardItem(bool doClip)
if (!page)
return;
- if (!m_frame->loader()->documentLoader()->isURLValidForNewHistoryEntry())
+ if (!m_frame->loader().documentLoader()->isURLValidForNewHistoryEntry())
return;
Frame* mainFrame = page->mainFrame();
ASSERT(mainFrame);
- RefPtr<HistoryItem> topItem = mainFrame->loader()->history()->createItemTree(m_frame, doClip);
- LOG(BackForward, "WebCoreBackForward - Adding backforward item %p for frame %s", topItem.get(), m_frame->loader()->documentLoader()->url().string().ascii().data());
+ RefPtr<HistoryItem> topItem = mainFrame->loader().history()->createItemTree(m_frame, doClip);
+ LOG(BackForward, "WebCoreBackForward - Adding backforward item %p for frame %s", topItem.get(), m_frame->loader().documentLoader()->url().string().ascii().data());
}
void HistoryController::updateWithoutCreatingNewBackForwardItem()
@@ -515,7 +515,7 @@ void HistoryController::updateWithoutCreatingNewBackForwardItem()
if (!m_currentItem)
return;
- DocumentLoader* documentLoader = m_frame->loader()->documentLoader();
+ DocumentLoader* documentLoader = m_frame->loader().documentLoader();
if (!documentLoader->unreachableURL().isEmpty())
return;
@@ -538,7 +538,7 @@ void HistoryController::pushState(PassRefPtr<SerializedScriptValue> stateObject,
ASSERT(page);
// Get a HistoryItem tree for the current frame tree.
- RefPtr<HistoryItem> topItem = page->mainFrame()->loader()->history()->createItemTree(m_frame, false);
+ RefPtr<HistoryItem> topItem = page->mainFrame()->loader().history()->createItemTree(m_frame, false);
// Override data in the current item (created by createItemTree) to reflect
// the pushState() arguments.
« no previous file with comments | « Source/core/loader/FrameLoader.cpp ('k') | Source/core/loader/MixedContentChecker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698