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

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

Issue 14610003: Revert "Remove FrameLoadTypeSame" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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
« no previous file with comments | « no previous file | Source/core/loader/FrameLoaderTypes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/FrameLoader.cpp
diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp
index adf56fc1b060cff3143e707a4906056bd0ea9c7a..10c9a76d2e93b1fc62b6945af5ceb11e32a740e1 100644
--- a/Source/core/loader/FrameLoader.cpp
+++ b/Source/core/loader/FrameLoader.cpp
@@ -1077,6 +1077,8 @@ void FrameLoader::loadURL(const KURL& newURL, const String& referrer, const Stri
addHTTPOriginIfNeeded(request, referrerOrigin->toString());
}
+ ASSERT(newLoadType != FrameLoadTypeSame);
+
// The search for a target frame is done earlier in the case of form submission.
Frame* targetFrame = isFormSubmission ? 0 : findFrameForNavigation(frameName);
if (targetFrame && targetFrame != m_frame) {
@@ -1094,7 +1096,13 @@ void FrameLoader::loadURL(const KURL& newURL, const String& referrer, const Stri
return;
}
+ bool sameURL = shouldTreatURLAsSameAsCurrent(newURL);
loadWithNavigationAction(request, action, newLoadType, formState.release(), defaultSubstituteDataForURL(request.url()));
+ // Example of this case are sites that reload the same URL with a different cookie
+ // driving the generated content, or a master frame with links that drive a target
+ // frame, where the user has clicked on the same link repeatedly.
+ if (sameURL && newLoadType != FrameLoadTypeReload && newLoadType != FrameLoadTypeReloadFromOrigin)
+ m_loadType = FrameLoadTypeSame;
}
SubstituteData FrameLoader::defaultSubstituteDataForURL(const KURL& url)
@@ -1130,7 +1138,7 @@ void FrameLoader::load(const FrameLoadRequest& passedRequest)
FrameLoadType type;
if (shouldTreatURLAsSameAsCurrent(r.url()))
- type = FrameLoadTypeReload;
+ type = FrameLoadTypeSame;
else if (shouldTreatURLAsSameAsCurrent(unreachableURL) && m_loadType == FrameLoadTypeReload)
type = FrameLoadTypeReload;
else
@@ -2065,6 +2073,7 @@ bool FrameLoader::shouldPerformFragmentNavigation(bool isFormSubmission, const S
return (!isFormSubmission || equalIgnoringCase(httpMethod, "GET"))
&& loadType != FrameLoadTypeReload
&& loadType != FrameLoadTypeReloadFromOrigin
+ && loadType != FrameLoadTypeSame
&& !shouldReload(m_frame->document()->url(), url)
// We don't want to just scroll if a link from within a
// frameset is trying to reload the frameset into _top.
« no previous file with comments | « no previous file | Source/core/loader/FrameLoaderTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698