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

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: fix 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/loader/FrameLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
index 59426dd8146ebbc2ff770d250539ebfa8f54c7a1..a63ff3b8205965a6f7bd9ce7aad87a0818f2d6f1 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -287,7 +287,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,9 +1093,6 @@ void FrameLoader::load(const FrameLoadRequest& passedRequest,
HistoryLoadType historyLoadType) {
DCHECK(m_frame->document());
- if (!m_frame->isNavigationAllowed())
- return;
-
if (m_inStopAllLoaders)
return;
@@ -1124,6 +1121,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)) {
@@ -1559,7 +1562,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