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

Unified Diff: Source/core/dom/ContextLifecycleNotifier.h

Issue 18777003: Extract simpler classes for observing context lifecycle and observe Page lifecycle inNavigatorVibra… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebaselined~ Created 7 years, 5 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/core.gypi ('k') | Source/core/dom/ContextLifecycleNotifier.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ContextLifecycleNotifier.h
diff --git a/Source/core/dom/ContextLifecycleNotifier.h b/Source/core/dom/ContextLifecycleNotifier.h
index d442addb85c0cf20577827d52ecaeb5b08dafb01..04801e497928aebbd63abb2f2ffe555d3bb1e440 100644
--- a/Source/core/dom/ContextLifecycleNotifier.h
+++ b/Source/core/dom/ContextLifecycleNotifier.h
@@ -28,6 +28,7 @@
#define ContextLifecycleNotifier_h
#include "core/dom/ActiveDOMObject.h"
+#include "core/platform/LifecycleNotifier.h"
#include "wtf/HashSet.h"
#include "wtf/PassOwnPtr.h"
@@ -37,19 +38,18 @@ class ActiveDOMObject;
class ContextLifecycleObserver;
class ScriptExecutionContext;
-class ContextLifecycleNotifier {
+class ContextLifecycleNotifier : public LifecycleNotifier {
public:
static PassOwnPtr<ContextLifecycleNotifier> create(ScriptExecutionContext*);
virtual ~ContextLifecycleNotifier();
- typedef HashSet<ContextLifecycleObserver*> ContextObserverSet;
typedef HashSet<ActiveDOMObject*> ActiveDOMObjectSet;
const ActiveDOMObjectSet& activeDOMObjects() const { return m_activeDOMObjects; }
- virtual void addObserver(ContextLifecycleObserver*, ContextLifecycleObserver::Type as);
- virtual void removeObserver(ContextLifecycleObserver*, ContextLifecycleObserver::Type as);
+ virtual void addObserver(LifecycleObserver*, LifecycleObserver::Type) OVERRIDE;
+ virtual void removeObserver(LifecycleObserver*, LifecycleObserver::Type) OVERRIDE;
void notifyResumingActiveDOMObjects();
void notifySuspendingActiveDOMObjects(ActiveDOMObject::ReasonForSuspension);
@@ -62,20 +62,8 @@ public:
protected:
explicit ContextLifecycleNotifier(ScriptExecutionContext*);
- enum IterationType {
- IteratingNone,
- IteratingOverActiveDOMObjects,
- IteratingOverContextObservers,
- IteratingOverDocumentObservers
- };
-
- IterationType m_iterating;
-
private:
- ScriptExecutionContext* m_context;
- ContextObserverSet m_contextObservers;
ActiveDOMObjectSet m_activeDOMObjects;
- bool m_inDestructor;
};
inline PassOwnPtr<ContextLifecycleNotifier> ContextLifecycleNotifier::create(ScriptExecutionContext* context)
@@ -86,4 +74,3 @@ inline PassOwnPtr<ContextLifecycleNotifier> ContextLifecycleNotifier::create(Scr
} // namespace WebCore
#endif // ContextLifecycleNotifier_h
-
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/ContextLifecycleNotifier.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698