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

Unified Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 1976573002: Only use pending navigation params for browser-initiated navigations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: consistency Created 4 years, 7 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: third_party/WebKit/Source/core/loader/FrameLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
index 488b56fde73ee5b26389ad709c2336551e1f5490..6ddde49ceac1be74a16692f8beeddd78dc44f8dc 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -685,7 +685,7 @@ bool FrameLoader::allowPlugins(ReasonForCallingAllowPlugins reason)
return allowed;
}
-void FrameLoader::updateForSameDocumentNavigation(const KURL& newURL, SameDocumentNavigationSource sameDocumentNavigationSource, PassRefPtr<SerializedScriptValue> data, HistoryScrollRestorationType scrollRestorationType, FrameLoadType type)
+void FrameLoader::updateForSameDocumentNavigation(const KURL& newURL, SameDocumentNavigationSource sameDocumentNavigationSource, PassRefPtr<SerializedScriptValue> data, HistoryScrollRestorationType scrollRestorationType, FrameLoadType type, Document* initiatingDocument)
{
// Update the data source's request with the new URL to fake the URL change
m_frame->document()->setURL(newURL);
@@ -707,7 +707,7 @@ void FrameLoader::updateForSameDocumentNavigation(const KURL& newURL, SameDocume
m_currentItem->setStateObject(data);
m_currentItem->setScrollRestorationType(scrollRestorationType);
}
- client()->dispatchDidNavigateWithinPage(m_currentItem.get(), historyCommitType);
+ client()->dispatchDidNavigateWithinPage(m_currentItem.get(), historyCommitType, !!initiatingDocument);
client()->dispatchDidReceiveTitle(m_frame->document()->title());
if (m_frame->document()->loadEventFinished())
client()->didStopLoading();
@@ -722,7 +722,7 @@ void FrameLoader::detachDocumentLoader(Member<DocumentLoader>& loader)
loader = nullptr;
}
-void FrameLoader::loadInSameDocument(const KURL& url, PassRefPtr<SerializedScriptValue> stateObject, FrameLoadType frameLoadType, HistoryLoadType historyLoadType, ClientRedirectPolicy clientRedirect)
+void FrameLoader::loadInSameDocument(const KURL& url, PassRefPtr<SerializedScriptValue> stateObject, FrameLoadType frameLoadType, HistoryLoadType historyLoadType, ClientRedirectPolicy clientRedirect, Document* initiatingDocument)
{
// If we have a state object, we cannot also be a new navigation.
ASSERT(!stateObject || frameLoadType == FrameLoadTypeBackForward);
@@ -742,7 +742,7 @@ void FrameLoader::loadInSameDocument(const KURL& url, PassRefPtr<SerializedScrip
m_frame->localDOMWindow()->enqueueHashchangeEvent(oldURL, url);
}
m_documentLoader->setIsClientRedirect(clientRedirect == ClientRedirectPolicy::ClientRedirect);
- updateForSameDocumentNavigation(url, SameDocumentNavigationDefault, nullptr, ScrollRestorationAuto, frameLoadType);
+ updateForSameDocumentNavigation(url, SameDocumentNavigationDefault, nullptr, ScrollRestorationAuto, frameLoadType, initiatingDocument);
m_documentLoader->initialScrollState().wasScrolledByUser = false;
@@ -977,7 +977,7 @@ void FrameLoader::load(const FrameLoadRequest& passedRequest, FrameLoadType fram
newLoadType = FrameLoadTypeReplaceCurrentItem;
}
- loadInSameDocument(url, stateObject, newLoadType, historyLoadType, request.clientRedirect());
+ loadInSameDocument(url, stateObject, newLoadType, historyLoadType, request.clientRedirect(), request.originDocument());
return;
}
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoader.h ('k') | third_party/WebKit/Source/core/loader/FrameLoaderClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698