Chromium Code Reviews| 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) |