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

Unified Diff: Source/core/platform/LifecycleContext.h

Issue 38143002: Have LifecycleContext::lifecycleNotifier() return a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years, 2 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/page/Page.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/LifecycleContext.h
diff --git a/Source/core/platform/LifecycleContext.h b/Source/core/platform/LifecycleContext.h
index 8cd975c0a65d8c03ededd01fb771126c0eccdc36..af01ac954364d84398d304ec7f3f861f8b096c0b 100644
--- a/Source/core/platform/LifecycleContext.h
+++ b/Source/core/platform/LifecycleContext.h
@@ -54,7 +54,7 @@ public:
void wasUnobservedBy(Observer*);
protected:
- Notifier* lifecycleNotifier();
+ Notifier& lifecycleNotifier();
private:
virtual PassOwnPtr<Notifier> createLifecycleNotifier();
@@ -66,22 +66,22 @@ template<typename T>
inline void LifecycleContext<T>::wasObservedBy(typename LifecycleContext<T>::Observer* observer)
{
ASSERT(isContextThread());
- lifecycleNotifier()->addObserver(observer);
+ lifecycleNotifier().addObserver(observer);
}
template<typename T>
inline void LifecycleContext<T>::wasUnobservedBy(typename LifecycleContext<T>::Observer* observer)
{
ASSERT(isContextThread());
- lifecycleNotifier()->removeObserver(observer);
+ lifecycleNotifier().removeObserver(observer);
}
template<typename T>
-inline typename LifecycleContext<T>::Notifier* LifecycleContext<T>::lifecycleNotifier()
+inline typename LifecycleContext<T>::Notifier& LifecycleContext<T>::lifecycleNotifier()
{
if (!m_lifecycleNotifier)
m_lifecycleNotifier = const_cast<LifecycleContext*>(this)->createLifecycleNotifier();
- return m_lifecycleNotifier.get();
+ return *m_lifecycleNotifier;
}
template<typename T>
« no previous file with comments | « Source/core/page/Page.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698