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

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: Don't cancel navigations pending in the NavigationScheduler when a PlzNavigate navigation is commit… 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 e664eb27cae54417d51390f29bb50218095ea927..9bf2eef1d2b206a28637dc60907f120db718bf87 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -1355,7 +1355,13 @@ void FrameLoader::commitProvisionalLoad() {
}
client()->transitionToCommittedForNewPage();
- m_frame->navigationScheduler().cancel();
+
+ // PlzNavigate: We need to ensure that script initiated navigations are
+ // honored. Exceptions being navigations initiated by the user.
+ if (!m_isNavigationHandledByClient ||
+ UserGestureIndicator::processingUserGesture()) {
Nate Chapin 2017/01/19 21:02:59 Is this user gesture check necessary to get the te
ananta 2017/01/19 21:38:08 The user gesture flag is passed via the FrameHostM
Nate Chapin 2017/01/19 23:33:50 Right, I got that. I just don't immediately see wh
ananta 2017/01/20 00:00:33 Based on our discussion, removing this check
+ m_frame->navigationScheduler().cancel();
+ }
m_frame->editor().clearLastEditCommand();
// If we are still in the process of initializing an empty document then its
@@ -1684,6 +1690,9 @@ void FrameLoader::startLoad(FrameLoadRequest& frameLoadRequest,
// request.
recordLatestRequiredCSP();
modifyRequestForCSP(resourceRequest, nullptr);
+
+ bool navigationHandledByClient = m_isNavigationHandledByClient;
Nate Chapin 2017/01/19 21:02:59 This should be probably have a "was" in the name,
ananta 2017/01/19 21:38:08 Done.
+
if (!shouldContinueForNavigationPolicy(
resourceRequest, frameLoadRequest.substituteData(), nullptr,
frameLoadRequest.shouldCheckMainWorldContentSecurityPolicy(),
@@ -1711,8 +1720,14 @@ 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. Exceptions being navigations initiated by the user.
+ if (!navigationHandledByClient ||
+ UserGestureIndicator::processingUserGesture()) {
+ 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