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

Unified Diff: Source/web/WebFrameImpl.cpp

Issue 28983004: Split the frame tree logic out of HistoryItem (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
Index: Source/web/WebFrameImpl.cpp
diff --git a/Source/web/WebFrameImpl.cpp b/Source/web/WebFrameImpl.cpp
index 59e09e5bf1e1aa298b0ce98c6c8024aafe3398fd..71d8ec43d316b9a433b802c7129cbf33e8ff1b43 100644
--- a/Source/web/WebFrameImpl.cpp
+++ b/Source/web/WebFrameImpl.cpp
@@ -926,8 +926,7 @@ void WebFrameImpl::loadHistoryItem(const WebHistoryItem& item)
ASSERT(historyItem);
frame()->loader().prepareForHistoryNavigation();
- RefPtr<HistoryItem> currentItem = frame()->loader().history()->currentItem();
- m_inSameDocumentHistoryLoad = currentItem && currentItem->shouldDoSameDocumentNavigationTo(historyItem.get());
+ m_inSameDocumentHistoryLoad = frame()->loader().history()->shouldPerformSameDocumentHistoryNavigation(frame(), historyItem.get());
frame()->page()->goToItem(historyItem.get());
m_inSameDocumentHistoryLoad = false;
}
@@ -1000,7 +999,7 @@ WebHistoryItem WebFrameImpl::previousHistoryItem() const
// only get saved to history when it becomes the previous item. The caller
// is expected to query the history item after a navigation occurs, after
// the desired history item has become the previous entry.
- return WebHistoryItem(frame()->loader().history()->previousItem());
+ return WebHistoryItem(frame()->loader().history()->previousItemForExport(frame()));
}
WebHistoryItem WebFrameImpl::currentHistoryItem() const
@@ -1018,11 +1017,11 @@ WebHistoryItem WebFrameImpl::currentHistoryItem() const
// clobbering here?
if (!m_inSameDocumentHistoryLoad && (frame()->loader().loadType() == FrameLoadTypeStandard
|| !frame()->loader().activeDocumentLoader()->isLoadingInAPISense()))
- frame()->loader().history()->saveDocumentAndScrollState();
+ frame()->loader().history()->saveDocumentAndScrollState(frame());
- if (HistoryItem* item = frame()->loader().history()->provisionalItem())
+ if (RefPtr<HistoryItem> item = frame()->loader().history()->provisionalItemForExport(frame()))
return WebHistoryItem(item);
- return WebHistoryItem(frame()->page()->mainFrame()->loader().history()->currentItem());
+ return WebHistoryItem(frame()->loader().history()->currentItemForExport(frame()));
}
void WebFrameImpl::enableViewSourceMode(bool enable)
@@ -2198,12 +2197,11 @@ PassRefPtr<Frame> WebFrameImpl::createChildFrame(const FrameLoadRequest& request
if (!childFrame->tree().parent())
return 0;
- HistoryItem* parentItem = frame()->loader().history()->currentItem();
HistoryItem* childItem = 0;
// If we're moving in the back/forward list, we might want to replace the content
// of this child frame with whatever was there at that point.
- if (parentItem && parentItem->children().size() && isBackForwardLoadType(frame()->loader().loadType()) && !frame()->document()->loadEventFinished())
- childItem = parentItem->childItemWithTarget(childFrame->tree().uniqueName());
+ if (isBackForwardLoadType(frame()->loader().loadType()) && !frame()->document()->loadEventFinished())
+ childItem = frame()->loader().history()->currentItem(childFrame.get());
if (childItem)
childFrame->loader().loadHistoryItem(childItem);

Powered by Google App Engine
This is Rietveld 408576698