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

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

Issue 2630783003: PlzNavigate: Fix the http/tests/security/cross-frame-access-parent-isolated-world.html and http/tes… (Closed)
Patch Set: Rebased to tip Created 3 years, 11 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 | « third_party/WebKit/LayoutTests/FlagExpectations/enable-browser-side-navigation ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1668aa80c56fac17ba9a3b6a9fe03e8523409b54..8315235fc9018fdbbbf8f9edd89df768ee27884c 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -1355,7 +1355,12 @@ void FrameLoader::commitProvisionalLoad() {
}
client()->transitionToCommittedForNewPage();
- m_frame->navigationScheduler().cancel();
+
+ // PlzNavigate: We need to ensure that script initiated navigations are
+ // honored.
+ if (!m_isNavigationHandledByClient)
+ m_frame->navigationScheduler().cancel();
+
m_frame->editor().clearLastEditCommand();
// If we are still in the process of initializing an empty document then its
@@ -1684,6 +1689,11 @@ void FrameLoader::startLoad(FrameLoadRequest& frameLoadRequest,
// request.
recordLatestRequiredCSP();
modifyRequestForCSP(resourceRequest, nullptr);
+
+ // We remember this flag here because shouldContinueForNavigationPolicy()
+ // resets it.
+ bool navigationWasHandledByClient = m_isNavigationHandledByClient;
+
if (!shouldContinueForNavigationPolicy(
resourceRequest, frameLoadRequest.substituteData(), nullptr,
frameLoadRequest.shouldCheckMainWorldContentSecurityPolicy(),
@@ -1711,8 +1721,13 @@ void FrameLoader::startLoad(FrameLoadRequest& frameLoadRequest,
m_provisionalDocumentLoader->setNavigationType(navigationType);
m_provisionalDocumentLoader->setReplacesCurrentHistoryItem(
type == FrameLoadTypeReplaceCurrentItem);
- m_frame->navigationScheduler().cancel();
- m_checkTimer.stop();
+
+ // PlzNavigate: We need to ensure that script initiated navigations are
+ // honored.
+ if (!navigationWasHandledByClient) {
+ m_frame->navigationScheduler().cancel();
+ m_checkTimer.stop();
+ }
m_loadType = type;
« no previous file with comments | « third_party/WebKit/LayoutTests/FlagExpectations/enable-browser-side-navigation ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698