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

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
« no previous file with comments | « Source/core/loader/NavigationScheduler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/NavigationScheduler.cpp
diff --git a/Source/core/loader/NavigationScheduler.cpp b/Source/core/loader/NavigationScheduler.cpp
index 2ac74b8ed38c84b0d4aca49c8d1f9eb81f40c468..e87cdbefa33c99325f8e084f8270765c3da8e646 100644
--- a/Source/core/loader/NavigationScheduler.cpp
+++ b/Source/core/loader/NavigationScheduler.cpp
@@ -54,6 +54,17 @@ namespace blink {
unsigned NavigationDisablerForBeforeUnload::s_navigationDisableCount = 0;
+FrameNavigationDisabler::FrameNavigationDisabler(LocalFrame* frame)
+ : m_navigationScheduler(frame->navigationScheduler())
+{
+ m_navigationScheduler.disableFrameNavigation();
+}
+
+FrameNavigationDisabler::~FrameNavigationDisabler()
+{
+ m_navigationScheduler.enableFrameNavigation();
+}
+
class ScheduledNavigation : public NoBaseWillBeGarbageCollectedFinalized<ScheduledNavigation> {
WTF_MAKE_NONCOPYABLE(ScheduledNavigation); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(ScheduledNavigation);
public:
@@ -249,6 +260,7 @@ private:
NavigationScheduler::NavigationScheduler(LocalFrame* frame)
: m_frame(frame)
, m_timer(this, &NavigationScheduler::timerFired)
+ , m_navigationDisableCount(0)
{
}
@@ -263,12 +275,12 @@ bool NavigationScheduler::locationChangePending()
inline bool NavigationScheduler::shouldScheduleReload() const
{
- return m_frame->page() && NavigationDisablerForBeforeUnload::isNavigationAllowed();
+ return m_frame->page() && isFrameNavigationAllowed() && NavigationDisablerForBeforeUnload::isNavigationAllowed();
}
inline bool NavigationScheduler::shouldScheduleNavigation(const String& url) const
{
- return m_frame->page() && (protocolIsJavaScript(url) || NavigationDisablerForBeforeUnload::isNavigationAllowed());
+ return m_frame->page() && isFrameNavigationAllowed() && (protocolIsJavaScript(url) || NavigationDisablerForBeforeUnload::isNavigationAllowed());
}
void NavigationScheduler::scheduleRedirect(double delay, const String& url)
« no previous file with comments | « Source/core/loader/NavigationScheduler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698