Index: Source/core/loader/NavigationScheduler.h |
diff --git a/Source/core/loader/NavigationScheduler.h b/Source/core/loader/NavigationScheduler.h |
index e755265cf207afa5ff463122026729f05a4f16d8..f51dabe08b966eca93fd6183cacd9ddd00d51b91 100644 |
--- a/Source/core/loader/NavigationScheduler.h |
+++ b/Source/core/loader/NavigationScheduler.h |
@@ -32,9 +32,7 @@ |
#define NavigationScheduler_h |
#include "core/CoreExport.h" |
-#include "platform/Timer.h" |
#include "platform/heap/Handle.h" |
-#include "platform/scheduler/CancellableTaskFactory.h" |
#include "wtf/Forward.h" |
#include "wtf/HashMap.h" |
#include "wtf/Noncopyable.h" |
@@ -45,49 +43,21 @@ |
namespace blink { |
+class CancellableTaskFactory; |
class Document; |
class FormSubmission; |
class LocalFrame; |
-class NavigationScheduler; |
class ScheduledNavigation; |
-class NavigationDisablerForBeforeUnload { |
- WTF_MAKE_NONCOPYABLE(NavigationDisablerForBeforeUnload); |
- STACK_ALLOCATED(); |
+class CORE_EXPORT NavigationScheduler final : public NoBaseWillBeGarbageCollectedFinalized<NavigationScheduler> { |
+ WTF_MAKE_NONCOPYABLE(NavigationScheduler); |
+ WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(NavigationScheduler); |
public: |
- NavigationDisablerForBeforeUnload() |
+ static PassOwnPtrWillBeRawPtr<NavigationScheduler> create(LocalFrame* frame) |
{ |
- s_navigationDisableCount++; |
+ return adoptPtrWillBeNoop(new NavigationScheduler(frame)); |
} |
- ~NavigationDisablerForBeforeUnload() |
- { |
- ASSERT(s_navigationDisableCount); |
- s_navigationDisableCount--; |
- } |
- static bool isNavigationAllowed() { return !s_navigationDisableCount; } |
- |
-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(); |
-public: |
- explicit NavigationScheduler(LocalFrame*); |
~NavigationScheduler(); |
bool locationChangePending(); |
@@ -106,6 +76,7 @@ public: |
private: |
friend class FrameNavigationDisabler; |
+ explicit NavigationScheduler(LocalFrame*); |
void disableFrameNavigation() { ++m_navigationDisableCount; } |
void enableFrameNavigation() { --m_navigationDisableCount; } |
@@ -120,11 +91,41 @@ private: |
static bool mustReplaceCurrentItem(LocalFrame* targetFrame); |
RawPtrWillBeMember<LocalFrame> m_frame; |
- CancellableTaskFactory m_navigateTaskFactory; |
+ OwnPtr<CancellableTaskFactory> m_navigateTaskFactory; |
OwnPtrWillBeMember<ScheduledNavigation> m_redirect; |
int m_navigationDisableCount; |
}; |
+class NavigationDisablerForBeforeUnload { |
+ WTF_MAKE_NONCOPYABLE(NavigationDisablerForBeforeUnload); |
+ STACK_ALLOCATED(); |
+public: |
+ NavigationDisablerForBeforeUnload() |
+ { |
+ s_navigationDisableCount++; |
+ } |
+ ~NavigationDisablerForBeforeUnload() |
+ { |
+ ASSERT(s_navigationDisableCount); |
+ s_navigationDisableCount--; |
+ } |
+ static bool isNavigationAllowed() { return !s_navigationDisableCount; } |
+ |
+private: |
+ static unsigned s_navigationDisableCount; |
+}; |
+ |
+class FrameNavigationDisabler { |
+ WTF_MAKE_NONCOPYABLE(FrameNavigationDisabler); |
+ STACK_ALLOCATED(); |
+public: |
+ explicit FrameNavigationDisabler(LocalFrame*); |
+ ~FrameNavigationDisabler(); |
+ |
+private: |
+ RawPtrWillBeMember<NavigationScheduler> m_navigationScheduler; |
+}; |
+ |
} // namespace blink |
#endif // NavigationScheduler_h |