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

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

Issue 2487403002: Allow navigations to frames that aren't being unloaded in the unload handler. (Closed)
Patch Set: early return on back/forward navigations 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/NavigationScheduler.cpp
diff --git a/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp b/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp
index a7740dee751fef5abacb5fb385336f76fb858521..f19b8dbad513d50b75df68d955fc6ff9c4fc3655 100644
--- a/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp
+++ b/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp
@@ -105,7 +105,7 @@ void maybeLogScheduledNavigationClobber(ScheduledNavigationType type,
} // namespace
-unsigned NavigationDisablerForUnload::s_navigationDisableCount = 0;
+unsigned NavigationDisablerForBeforeUnload::s_navigationDisableCount = 0;
class ScheduledNavigation
: public GarbageCollectedFinalized<ScheduledNavigation> {
@@ -360,12 +360,10 @@ bool NavigationScheduler::isNavigationScheduledWithin(double interval) const {
// TODO(dcheng): There are really two different load blocking concepts at work
// here and they have been incorrectly tangled together.
//
-// 1. NavigationDisablerForUnload is for blocking navigation scheduling during
-// a beforeunload or unload events. Scheduled navigations during
-// beforeunload would make it possible to get trapped in an endless loop of
-// beforeunload dialogs. Scheduled navigations during the unload handler
-// makes is possible to cancel a navigation that was initiated right before
-// it commits.
+// 1. NavigationDisablerForBeforeUnload is for blocking navigation scheduling
+// during a beforeunload events. Scheduled navigations during beforeunload
+// would make it possible to get trapped in an endless loop of beforeunload
+// dialogs.
//
// Checking Frame::isNavigationAllowed() doesn't make sense in this context:
// NavigationScheduler is always cleared when a new load commits, so it's
@@ -379,14 +377,14 @@ bool NavigationScheduler::isNavigationScheduledWithin(double interval) const {
// Document::detachLayoutTree().
inline bool NavigationScheduler::shouldScheduleReload() const {
return m_frame->page() && m_frame->isNavigationAllowed() &&
- NavigationDisablerForUnload::isNavigationAllowed();
+ NavigationDisablerForBeforeUnload::isNavigationAllowed();
}
inline bool NavigationScheduler::shouldScheduleNavigation(
const String& url) const {
return m_frame->page() && m_frame->isNavigationAllowed() &&
(protocolIsJavaScript(url) ||
- NavigationDisablerForUnload::isNavigationAllowed());
+ NavigationDisablerForBeforeUnload::isNavigationAllowed());
}
void NavigationScheduler::scheduleRedirect(double delay, const String& url) {

Powered by Google App Engine
This is Rietveld 408576698