| Index: Source/core/loader/NavigationScheduler.h
|
| diff --git a/Source/core/loader/NavigationScheduler.h b/Source/core/loader/NavigationScheduler.h
|
| index 4baf377af2f0c3e362a2ce47595300018272beac..23de7a33d7772ae01cffc7377b29aadc481bbaa2 100644
|
| --- a/Source/core/loader/NavigationScheduler.h
|
| +++ b/Source/core/loader/NavigationScheduler.h
|
| @@ -47,11 +47,12 @@ namespace blink {
|
| class Document;
|
| class FormSubmission;
|
| class LocalFrame;
|
| +class NavigationScheduler;
|
| class ScheduledNavigation;
|
|
|
| class NavigationDisablerForBeforeUnload {
|
| WTF_MAKE_NONCOPYABLE(NavigationDisablerForBeforeUnload);
|
| -
|
| + STACK_ALLOCATED();
|
| public:
|
| NavigationDisablerForBeforeUnload()
|
| {
|
| @@ -68,6 +69,19 @@ private:
|
| static unsigned s_navigationDisableCount;
|
| };
|
|
|
| +class FrameNavigationDisabler {
|
| + WTF_MAKE_NONCOPYABLE(FrameNavigationDisabler);
|
| + STACK_ALLOCATED();
|
| +public:
|
| + explicit FrameNavigationDisabler(LocalFrame*);
|
| + ~FrameNavigationDisabler();
|
| +
|
| +private:
|
| + FrameNavigationDisabler() = delete;
|
| +
|
| + NavigationScheduler& m_navigationScheduler;
|
| +};
|
| +
|
| class CORE_EXPORT NavigationScheduler final {
|
| WTF_MAKE_NONCOPYABLE(NavigationScheduler);
|
| DISALLOW_ALLOCATION();
|
| @@ -89,6 +103,12 @@ public:
|
| DECLARE_TRACE();
|
|
|
| private:
|
| + friend class FrameNavigationDisabler;
|
| +
|
| + void disableFrameNavigation() { ++m_navigationDisableCount; }
|
| + void enableFrameNavigation() { --m_navigationDisableCount; }
|
| + bool isFrameNavigationAllowed() const { return !m_navigationDisableCount; }
|
| +
|
| bool shouldScheduleReload() const;
|
| bool shouldScheduleNavigation(const String& url) const;
|
|
|
| @@ -100,6 +120,7 @@ private:
|
| RawPtrWillBeMember<LocalFrame> m_frame;
|
| Timer<NavigationScheduler> m_timer;
|
| OwnPtrWillBeMember<ScheduledNavigation> m_redirect;
|
| + int m_navigationDisableCount;
|
| };
|
|
|
| } // namespace blink
|
|
|