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

Unified Diff: third_party/WebKit/Source/core/frame/History.cpp

Issue 2555963003: FasterLocationReload: use ReloadMainResource for JS exposed reloads (Closed)
Patch Set: test Created 4 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
Index: third_party/WebKit/Source/core/frame/History.cpp
diff --git a/third_party/WebKit/Source/core/frame/History.cpp b/third_party/WebKit/Source/core/frame/History.cpp
index 470ca16087c63cbb837afa5ff975fed1a70900a9..56494e97c0edd4297d7d17e110f8ef91d0747c10 100644
--- a/third_party/WebKit/Source/core/frame/History.cpp
+++ b/third_party/WebKit/Source/core/frame/History.cpp
@@ -145,14 +145,19 @@ void History::go(ExecutionContext* context, int delta) {
if (!NavigationDisablerForUnload::isNavigationAllowed())
return;
- // We intentionally call reload() for the current frame if delta is zero.
- // Otherwise, navigation happens on the root frame.
- // This behavior is designed in the following spec.
- // https://html.spec.whatwg.org/multipage/browsers.html#dom-history-go
- if (delta)
+ if (delta) {
frame()->loader().client()->navigateBackForward(delta);
- else
- frame()->reload(FrameLoadTypeReload, ClientRedirectPolicy::ClientRedirect);
+ } else {
+ // We intentionally call reload() for the current frame if delta is zero.
+ // Otherwise, navigation happens on the root frame.
+ // This behavior is designed in the following spec.
+ // https://html.spec.whatwg.org/multipage/browsers.html#dom-history-go
+ FrameLoadType reloadType =
+ RuntimeEnabledFeatures::fasterLocationReloadEnabled()
+ ? FrameLoadTypeReloadMainResource
+ : FrameLoadTypeReload;
+ frame()->reload(reloadType, ClientRedirectPolicy::ClientRedirect);
+ }
}
KURL History::urlForState(const String& urlString) {

Powered by Google App Engine
This is Rietveld 408576698