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

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 e6c209c3648a07d629b48e8457e1350eba198ec9..423e4011607d49e28f4e4b6a343cd1ff62df0ac2 100644
--- a/Source/web/WebFrameImpl.cpp
+++ b/Source/web/WebFrameImpl.cpp
@@ -924,8 +924,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()->shouldTreatURLAsSameAsCurrent(historyItem->url());
frame()->page()->goToItem(historyItem.get());
m_inSameDocumentHistoryLoad = false;
}
@@ -998,7 +997,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
@@ -1016,11 +1015,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)
@@ -2193,12 +2192,12 @@ PassRefPtr<Frame> WebFrameImpl::createChildFrame(const FrameLoadRequest& request
if (!childFrame->tree()->parent())
return 0;
- HistoryItem* parentItem = frame()->loader()->history()->currentItem();
+ HistoryItem* parentItem = frame()->loader()->history()->currentItem(frame());
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 (parentItem && 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