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

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, 1 month 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/web/WebFrameImpl.h ('k') | Source/web/WebHistoryItem.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebFrameImpl.cpp
diff --git a/Source/web/WebFrameImpl.cpp b/Source/web/WebFrameImpl.cpp
index b51ac33b17741609182ab51fe3dbdbfc68680446..b08befe6e4240b73c4c72df0e46e6208d0b08a3d 100644
--- a/Source/web/WebFrameImpl.cpp
+++ b/Source/web/WebFrameImpl.cpp
@@ -922,12 +922,7 @@ void WebFrameImpl::loadHistoryItem(const WebHistoryItem& item)
ASSERT(frame());
RefPtr<HistoryItem> historyItem = PassRefPtr<HistoryItem>(item);
ASSERT(historyItem);
-
- frame()->loader().prepareForHistoryNavigation();
- RefPtr<HistoryItem> currentItem = frame()->loader().history()->currentItem();
- m_inSameDocumentHistoryLoad = currentItem && currentItem->shouldDoSameDocumentNavigationTo(historyItem.get());
- frame()->page()->goToItem(historyItem.get());
- m_inSameDocumentHistoryLoad = false;
+ frame()->page()->history()->goToItem(historyItem.get());
}
void WebFrameImpl::loadData(const WebData& data, const WebString& mimeType, const WebString& textEncoding, const WebURL& baseURL, const WebURL& unreachableURL, bool replace)
@@ -998,7 +993,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()->page()->history()->previousItemForExport(frame()));
}
WebHistoryItem WebFrameImpl::currentHistoryItem() const
@@ -1014,13 +1009,13 @@ WebHistoryItem WebFrameImpl::currentHistoryItem() const
// document state. However, it is OK for new navigations.
// FIXME: Can we make this a plain old getter, instead of worrying about
// clobbering here?
- if (!m_inSameDocumentHistoryLoad && (frame()->loader().loadType() == FrameLoadTypeStandard
+ if (!frame()->page()->history()->inSameDocumentLoad() && (frame()->loader().loadType() == FrameLoadTypeStandard
|| !frame()->loader().activeDocumentLoader()->isLoadingInAPISense()))
- frame()->loader().history()->saveDocumentAndScrollState();
+ frame()->page()->history()->saveDocumentAndScrollState(frame());
- if (HistoryItem* item = frame()->loader().history()->provisionalItem())
+ if (RefPtr<HistoryItem> item = frame()->page()->history()->provisionalItemForExport(frame()))
return WebHistoryItem(item);
- return WebHistoryItem(frame()->page()->mainFrame()->loader().history()->currentItem());
+ return WebHistoryItem(frame()->page()->history()->currentItemForExport(frame()));
}
void WebFrameImpl::enableViewSourceMode(bool enable)
@@ -2104,7 +2099,6 @@ WebFrameImpl::WebFrameImpl(WebFrameClient* client, long long embedderIdentifier)
, m_nextInvalidateAfter(0)
, m_findMatchMarkersVersion(0)
, m_findMatchRectsAreValid(false)
- , m_inSameDocumentHistoryLoad(false)
, m_inputEventsScaleFactorForEmulation(1)
{
blink::Platform::current()->incrementStatsCounter(webFrameActiveCount);
@@ -2193,12 +2187,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()->page()->history()->currentItem(childFrame.get());
if (childItem)
childFrame->loader().loadHistoryItem(childItem);
« no previous file with comments | « Source/web/WebFrameImpl.h ('k') | Source/web/WebHistoryItem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698