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

Unified Diff: Source/core/frame/DOMWindowLifecycleObserver.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/frame/DOMWindowLifecycleObserver.h
diff --git a/Source/core/frame/DOMWindowLifecycleObserver.h b/Source/core/frame/DOMWindowLifecycleObserver.h
index 40fc8e68f4fe0dfa00fc3b43d59ba4ca4dfd33b4..33f6c9b0d574f072b6f1460ba5df08e483bbd9be 100644
--- a/Source/core/frame/DOMWindowLifecycleObserver.h
+++ b/Source/core/frame/DOMWindowLifecycleObserver.h
@@ -33,22 +33,22 @@
namespace blink {
-template<> void observeContext(LocalDOMWindow*, LifecycleObserver<LocalDOMWindow>*);
-template<> void unobserveContext(LocalDOMWindow*, LifecycleObserver<LocalDOMWindow>*);
+class DOMWindowLifecycleNotifier;
-class DOMWindowLifecycleObserver : public LifecycleObserver<LocalDOMWindow> {
+class DOMWindowLifecycleObserver : public LifecycleObserver<LocalDOMWindow, DOMWindowLifecycleObserver, DOMWindowLifecycleNotifier> {
public:
- explicit DOMWindowLifecycleObserver(LocalDOMWindow*);
- virtual ~DOMWindowLifecycleObserver();
-
virtual void contextDestroyed()
{
didRemoveAllEventListeners(lifecycleContext());
- LifecycleObserver<LocalDOMWindow>::contextDestroyed();
+ LifecycleObserver<LocalDOMWindow, DOMWindowLifecycleObserver, DOMWindowLifecycleNotifier>::contextDestroyed();
}
virtual void didAddEventListener(LocalDOMWindow*, const AtomicString&) { }
virtual void didRemoveEventListener(LocalDOMWindow*, const AtomicString&) { }
virtual void didRemoveAllEventListeners(LocalDOMWindow*) { }
+
+protected:
+ explicit DOMWindowLifecycleObserver(LocalDOMWindow*);
+ virtual ~DOMWindowLifecycleObserver();
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698