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

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

Issue 1164883002: Ignore attempts to navigate once a provisional commit has gotten too far along. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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: Source/core/loader/NavigationScheduler.cpp
diff --git a/Source/core/loader/NavigationScheduler.cpp b/Source/core/loader/NavigationScheduler.cpp
index 2ac74b8ed38c84b0d4aca49c8d1f9eb81f40c468..adc2ecc84541d3e8cc14e6c5bb31eac0785b23ed 100644
--- a/Source/core/loader/NavigationScheduler.cpp
+++ b/Source/core/loader/NavigationScheduler.cpp
@@ -52,7 +52,18 @@
namespace blink {
-unsigned NavigationDisablerForBeforeUnload::s_navigationDisableCount = 0;
+unsigned NavigationDisabler::s_navigationDisableCount = 0;
+
+FrameNavigationDisabler::FrameNavigationDisabler(LocalFrame* frame)
+ : m_navigationScheduler(frame->navigationScheduler())
+{
+ m_navigationScheduler.disableFrameNavigation();
+}
+
+FrameNavigationDisabler::~FrameNavigationDisabler()
+{
+ m_navigationScheduler.enableFrameNavigation();
Nate Chapin 2015/06/09 00:15:20 Is it possible for NavigationScheduler to be delet
michaeln 2015/06/09 01:15:02 Not as currently used at its only callsite. It's u
+}
class ScheduledNavigation : public NoBaseWillBeGarbageCollectedFinalized<ScheduledNavigation> {
WTF_MAKE_NONCOPYABLE(ScheduledNavigation); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(ScheduledNavigation);
@@ -263,12 +274,12 @@ bool NavigationScheduler::locationChangePending()
inline bool NavigationScheduler::shouldScheduleReload() const
{
- return m_frame->page() && NavigationDisablerForBeforeUnload::isNavigationAllowed();
+ return m_frame->page() && isFrameNavigationAllowed() && NavigationDisabler::isNavigationAllowed();
}
inline bool NavigationScheduler::shouldScheduleNavigation(const String& url) const
{
- return m_frame->page() && (protocolIsJavaScript(url) || NavigationDisablerForBeforeUnload::isNavigationAllowed());
+ return m_frame->page() && isFrameNavigationAllowed() && (protocolIsJavaScript(url) || NavigationDisabler::isNavigationAllowed());
}
void NavigationScheduler::scheduleRedirect(double delay, const String& url)
« Source/core/loader/NavigationScheduler.h ('K') | « Source/core/loader/NavigationScheduler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698