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

Unified Diff: Source/platform/LifecycleObserver.h

Issue 901663005: Revert r189385 "Remove LifecycleContext" and r189391, r189530, r189456 that block it (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
« no previous file with comments | « Source/platform/LifecycleNotifier.h ('k') | Source/platform/blink_platform.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/LifecycleObserver.h
diff --git a/Source/platform/LifecycleObserver.h b/Source/platform/LifecycleObserver.h
index 44b5d2a345379cb149506772b252de4000401b4b..12e12fc9504aafcf31dd87c515c1f46a4368a816 100644
--- a/Source/platform/LifecycleObserver.h
+++ b/Source/platform/LifecycleObserver.h
@@ -56,7 +56,7 @@ public:
#if ENABLE(OILPAN)
ThreadState::current()->registerPreFinalizer(*this);
#endif
- setContext(context);
+ observeContext(context);
}
virtual ~LifecycleObserver()
{
@@ -72,7 +72,7 @@ public:
virtual void contextDestroyed() { }
void dispose()
{
- setContext(nullptr);
+ observeContext(nullptr);
}
Context* lifecycleContext() const { return m_lifecycleContext; }
@@ -80,7 +80,7 @@ public:
Type observerType() const { return m_observerType; }
protected:
- void setContext(Context*);
+ void observeContext(Context*);
RawPtrWillBeWeakMember<Context> m_lifecycleContext;
Type m_observerType;
@@ -89,20 +89,20 @@ protected:
//
// These functions should be specialized for each LifecycleObserver instances.
//
-template<typename T> void observeContext(T*, LifecycleObserver<T>*) { ASSERT_NOT_REACHED(); }
-template<typename T> void unobserveContext(T*, LifecycleObserver<T>*) { ASSERT_NOT_REACHED(); }
+template<typename T> void observerContext(T*, LifecycleObserver<T>*) { ASSERT_NOT_REACHED(); }
+template<typename T> void unobserverContext(T*, LifecycleObserver<T>*) { ASSERT_NOT_REACHED(); }
template<typename T>
-inline void LifecycleObserver<T>::setContext(typename LifecycleObserver<T>::Context* context)
+inline void LifecycleObserver<T>::observeContext(typename LifecycleObserver<T>::Context* context)
{
if (m_lifecycleContext)
- unobserveContext(m_lifecycleContext.get(), this);
+ unobserverContext(m_lifecycleContext.get(), this);
m_lifecycleContext = context;
if (m_lifecycleContext)
- observeContext(m_lifecycleContext.get(), this);
+ observerContext(m_lifecycleContext.get(), this);
}
} // namespace blink
« no previous file with comments | « Source/platform/LifecycleNotifier.h ('k') | Source/platform/blink_platform.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698