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

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

Issue 968633002: Simplify lifecycle notifiers and observers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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
Index: Source/core/dom/ContextLifecycleObserver.h
diff --git a/Source/core/dom/ContextLifecycleObserver.h b/Source/core/dom/ContextLifecycleObserver.h
index 4bf29e2970b1fefda5aa0c8c4e4c394fa79434f4..19fa6f9c7bb8b4eac6cb90a4003931aba3424f7e 100644
--- a/Source/core/dom/ContextLifecycleObserver.h
+++ b/Source/core/dom/ContextLifecycleObserver.h
@@ -31,15 +31,26 @@
namespace blink {
-template<> void observeContext(ExecutionContext*, LifecycleObserver<ExecutionContext>*);
-template<> void unobserveContext(ExecutionContext*, LifecycleObserver<ExecutionContext>*);
+class ContextLifecycleNotifier;
-class ContextLifecycleObserver : public LifecycleObserver<ExecutionContext> {
+class ContextLifecycleObserver : public LifecycleObserver<ExecutionContext, ContextLifecycleObserver, ContextLifecycleNotifier> {
public:
- explicit ContextLifecycleObserver(ExecutionContext*, Type = GenericType);
ExecutionContext* executionContext() const { return lifecycleContext(); }
+
+ enum Type {
+ GenericType,
+ ActiveDOMObjectType,
+ };
+
+ Type observerType() const { return m_observerType; }
+
protected:
+ explicit ContextLifecycleObserver(ExecutionContext*, Type = GenericType);
+
virtual ~ContextLifecycleObserver();
+
+private:
+ Type m_observerType;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698