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

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

Issue 2621193004: Allow navigations to frames that aren't being unloaded in the unload handler. (Closed)
Patch Set: 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 cadec38f347bc616f6c803954df2aeccdb3d58e4..be17a5ee9c43bf21240ee5b82e17b4b2ec4506a0 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.
@@ -1087,7 +1087,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)
@@ -1118,9 +1118,15 @@ void FrameLoader::load(const FrameLoadRequest& passedRequest,
? nullptr
: m_frame->findFrameForNavigation(
AtomicString(request.frameName()), *m_frame);
+
NavigationPolicy policy = navigationPolicyForRequest(request);
if (targetFrame && targetFrame != m_frame &&
shouldNavigateTargetFrame(policy)) {
+ if (targetFrame->isLocalFrame() &&
+ !toLocalFrame(targetFrame)->isNavigationAllowed()) {
+ return;
+ }
+
bool wasInSamePage = targetFrame->page() == m_frame->page();
request.setFrameName("_self");
@@ -1144,6 +1150,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)
@@ -1553,7 +1562,7 @@ bool FrameLoader::shouldClose(bool isReload) {
bool shouldClose = false;
{
- NavigationDisablerForUnload navigationDisabler;
+ NavigationDisablerForBeforeUnload navigationDisabler;
size_t i;
bool didAllowNavigation = false;
« no previous file with comments | « third_party/WebKit/Source/core/frame/History.cpp ('k') | third_party/WebKit/Source/core/loader/NavigationScheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698