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

Unified Diff: third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp

Issue 1422333009: OOPIF: History navigations for new child frames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improve comment. Created 5 years 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 | « testing/buildbot/chromium.fyi.json ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp
diff --git a/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp b/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp
index dbfba72aa888f8f5df1bda12a1eb038eb39d7f77..69945adfa3f99e33f0ccd29afef975bdc6b9ee08 100644
--- a/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp
+++ b/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp
@@ -583,12 +583,23 @@ NavigationPolicy FrameLoaderClientImpl::decidePolicyForNavigation(const Resource
WebDataSourceImpl* ds = WebDataSourceImpl::fromDocumentLoader(loader);
+ // Newly created child frames may need to be navigated to a history item
+ // during a back/forward navigation. This will only happen when the parent
+ // is a LocalFrame doing a back/forward navigation that has not completed.
+ // (If the load has completed and the parent later adds a frame with script,
+ // we do not want to use a history item for it.)
+ bool isHistoryNavigationInNewChildFrame = m_webFrame->parent()
+ && m_webFrame->parent()->isWebLocalFrame()
+ && isBackForwardLoadType(toWebLocalFrameImpl(m_webFrame->parent())->frame()->loader().loadType())
+ && !toWebLocalFrameImpl(m_webFrame->parent())->frame()->document()->loadEventFinished();
+
WrappedResourceRequest wrappedResourceRequest(request);
WebFrameClient::NavigationPolicyInfo navigationInfo(wrappedResourceRequest);
navigationInfo.navigationType = static_cast<WebNavigationType>(type);
navigationInfo.defaultPolicy = static_cast<WebNavigationPolicy>(policy);
navigationInfo.extraData = ds ? ds->extraData() : nullptr;
navigationInfo.replacesCurrentHistoryItem = replacesCurrentHistoryItem;
+ navigationInfo.isHistoryNavigationInNewChildFrame = isHistoryNavigationInNewChildFrame;
WebNavigationPolicy webPolicy = m_webFrame->client()->decidePolicyForNavigation(navigationInfo);
return static_cast<NavigationPolicy>(webPolicy);
« no previous file with comments | « testing/buildbot/chromium.fyi.json ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698