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 52d1db4806643ad54bad11fe12dc1a5c583a2511..5e3705bedd145f622293f229c90b553ccef417af 100644 |
--- a/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp |
+++ b/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp |
@@ -97,7 +97,7 @@ void maybeLogScheduledNavigationClobber(ScheduledNavigationType type, LocalFrame |
} // namespace |
unsigned NavigationDisablerForBeforeUnload::s_navigationDisableCount = 0; |
-unsigned NavigationCounterForUnload::s_inUnloadHandler = 0; |
+unsigned NavigationDisablerForUnload::s_inUnloadHandler = 0; |
class ScheduledNavigation : public GarbageCollectedFinalized<ScheduledNavigation> { |
WTF_MAKE_NONCOPYABLE(ScheduledNavigation); |
@@ -343,12 +343,12 @@ bool NavigationScheduler::isNavigationScheduledWithin(double interval) const |
// to block /synchronous/ navigations during things lke Document::detachLayoutTree(). |
inline bool NavigationScheduler::shouldScheduleReload() const |
{ |
- return m_frame->page() && m_frame->isNavigationAllowed() && NavigationDisablerForBeforeUnload::isNavigationAllowed(); |
+ return m_frame->page() && m_frame->isNavigationAllowed() && NavigationDisablerForBeforeUnload::isNavigationAllowed() && !NavigationDisablerForUnload::inUnloadHandler(); |
} |
inline bool NavigationScheduler::shouldScheduleNavigation(const String& url) const |
{ |
- return m_frame->page() && m_frame->isNavigationAllowed() && (protocolIsJavaScript(url) || NavigationDisablerForBeforeUnload::isNavigationAllowed()); |
+ return m_frame->page() && m_frame->isNavigationAllowed() && (protocolIsJavaScript(url) || NavigationDisablerForBeforeUnload::isNavigationAllowed()) && !NavigationDisablerForUnload::inUnloadHandler(); |
} |
void NavigationScheduler::scheduleRedirect(double delay, const String& url) |
@@ -393,8 +393,6 @@ void NavigationScheduler::scheduleLocationChange(Document* originDocument, const |
if (originDocument->getSecurityOrigin()->canAccess(m_frame->document()->getSecurityOrigin())) { |
KURL parsedURL(ParsedURLString, url); |
if (parsedURL.hasFragmentIdentifier() && equalIgnoringFragmentIdentifier(m_frame->document()->url(), parsedURL)) { |
- if (NavigationCounterForUnload::inUnloadHandler()) |
- Deprecation::countDeprecation(m_frame, UseCounter::UnloadHandler_Navigation); |
FrameLoadRequest request(originDocument, m_frame->document()->completeURL(url), "_self"); |
request.setReplacesCurrentItem(replacesCurrentItem); |