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

Unified Diff: Source/core/loader/NavigationScheduler.h

Issue 1330653003: Oilpan: tidy up NavigationScheduler. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove redundant constructor hiding Created 5 years, 3 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/FrameLoader.cpp ('k') | Source/core/loader/NavigationScheduler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/core/loader/FrameLoader.cpp ('k') | Source/core/loader/NavigationScheduler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698