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

Unified Diff: Source/WebCore/loader/FrameLoader.cpp

Issue 7711011: Merge 93296 - Prepare frames for history navigation. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 4 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/WebCore/loader/FrameLoader.h ('k') | Source/WebKit/chromium/ChangeLog » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/loader/FrameLoader.cpp
===================================================================
--- Source/WebCore/loader/FrameLoader.cpp (revision 93532)
+++ Source/WebCore/loader/FrameLoader.cpp (working copy)
@@ -1082,6 +1082,25 @@
frame->loader()->m_isComplete = false;
}
+void FrameLoader::prepareForHistoryNavigation()
+{
+ // If there is no currentItem, but we still want to engage in
+ // history navigation we need to manufacture one, and update
+ // the state machine of this frame to impersonate having
+ // loaded it.
+ RefPtr<HistoryItem> currentItem = history()->currentItem();
+ if (!currentItem) {
+ currentItem = HistoryItem::create();
+ currentItem->setLastVisitWasFailure(true);
+ history()->setCurrentItem(currentItem.get());
+ frame()->page()->backForward()->setCurrentItem(currentItem.get());
+
+ ASSERT(stateMachine()->isDisplayingInitialEmptyDocument());
+ stateMachine()->advanceTo(FrameLoaderStateMachine::DisplayingInitialEmptyDocumentPostCommit);
+ stateMachine()->advanceTo(FrameLoaderStateMachine::CommittedFirstRealLoad);
+ }
+}
+
void FrameLoader::prepareForLoadStart()
{
if (Page* page = m_frame->page())
« no previous file with comments | « Source/WebCore/loader/FrameLoader.h ('k') | Source/WebKit/chromium/ChangeLog » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698