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

Unified Diff: Source/core/dom/LifecycleObserver.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: Ensure m_scriptExecutionContext is maintained and not just null. 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
Index: Source/core/dom/LifecycleObserver.h
diff --git a/Source/core/dom/ContextLifecycleObserver.h b/Source/core/dom/LifecycleObserver.h
similarity index 74%
copy from Source/core/dom/ContextLifecycleObserver.h
copy to Source/core/dom/LifecycleObserver.h
index 574455e861a357cf4f33514367aaf69b3657d5a9..5e3ca2ccc2569b82e5279590140b7f533245eade 100644
--- a/Source/core/dom/ContextLifecycleObserver.h
+++ b/Source/core/dom/LifecycleObserver.h
@@ -24,33 +24,36 @@
*
*/
-#ifndef ContextLifecycleObserver_h
-#define ContextLifecycleObserver_h
+#ifndef LifecycleObserver_h
+#define LifecycleObserver_h
namespace WebCore {
-class ScriptExecutionContext;
+class LifecycleContext;
-class ContextLifecycleObserver {
+class LifecycleObserver {
public:
enum Type {
ActiveDOMObjectType,
DocumentLifecycleObserverType,
- GenericType
+ GenericType,
+ PageLifecycleObserverType
};
- explicit ContextLifecycleObserver(ScriptExecutionContext*, Type = GenericType);
+ explicit LifecycleObserver(LifecycleContext*, Type = GenericType);
+
virtual void contextDestroyed();
- ScriptExecutionContext* scriptExecutionContext() const { return m_scriptExecutionContext; }
+ LifecycleContext* lifecycleContext() const { return m_lifecycleContext; }
protected:
- virtual ~ContextLifecycleObserver();
- void observeContext(ScriptExecutionContext*, Type);
+ virtual ~LifecycleObserver();
+
+ void observeContext(LifecycleContext*, Type);
- ScriptExecutionContext* m_scriptExecutionContext;
+ LifecycleContext* m_lifecycleContext;
};
} // namespace WebCore
-#endif // ContextLifecycleObserver_h
+#endif // LifecycleObserver_h

Powered by Google App Engine
This is Rietveld 408576698