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

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

Issue 2487403002: Allow navigations to frames that aren't being unloaded in the unload handler. (Closed)
Patch Set: addressing comments 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
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 e330262b19fb0eb8426a68b995ee40a55ccb690f..fd754cad1a12ca8c59b03501f38b8b352991ba7f 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -288,7 +288,7 @@ void FrameLoader::saveScrollState() {
}
void FrameLoader::dispatchUnloadEvent() {
- NavigationDisablerForUnload navigationDisabler;
+ FrameNavigationDisabler navigationDisabler(*m_frame);
// If the frame is unloading, the provisional loader should no longer be
// protected. It will be detached soon.
@@ -1093,7 +1093,7 @@ void FrameLoader::load(const FrameLoadRequest& passedRequest,
HistoryLoadType historyLoadType) {
DCHECK(m_frame->document());
- if (!m_frame->isNavigationAllowed())
+ if (isBackForwardLoadType(frameLoadType) && !m_frame->isNavigationAllowed())
return;
if (m_inStopAllLoaders)
@@ -1124,6 +1124,12 @@ void FrameLoader::load(const FrameLoadRequest& passedRequest,
? nullptr
: m_frame->findFrameForNavigation(
AtomicString(request.frameName()), *m_frame);
+
+ if (targetFrame && targetFrame->isLocalFrame() &&
+ !toLocalFrame(targetFrame)->isNavigationAllowed()) {
+ return;
+ }
+
NavigationPolicy policy = navigationPolicyForRequest(request);
if (targetFrame && targetFrame != m_frame &&
shouldNavigateTargetFrame(policy)) {
@@ -1150,6 +1156,9 @@ void FrameLoader::load(const FrameLoadRequest& passedRequest,
return;
}
+ if (!m_frame->isNavigationAllowed())
+ return;
+
const KURL& url = request.resourceRequest().url();
FrameLoadType newLoadType = (frameLoadType == FrameLoadTypeStandard)
? determineFrameLoadType(request)
@@ -1558,7 +1567,7 @@ bool FrameLoader::shouldClose(bool isReload) {
bool shouldClose = false;
{
- NavigationDisablerForUnload navigationDisabler;
+ NavigationDisablerForBeforeUnload navigationDisabler;
size_t i;
bool didAllowNavigation = false;

Powered by Google App Engine
This is Rietveld 408576698