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

Unified Diff: Source/platform/LifecycleObserver.h

Issue 1006253002: Oilpan: have LifetimeNotifier<T> track its observers weakly. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 5 years, 9 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') | no next file » | 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 d60981bf8a6d60671462d04f7d587b7af363087e..cc7dcc31fc07009a31fa29bfc722ec8a9f07c3dc 100644
--- a/Source/platform/LifecycleObserver.h
+++ b/Source/platform/LifecycleObserver.h
@@ -34,19 +34,12 @@ namespace blink {
template<typename T, typename Observer, typename Notifier>
class LifecycleObserver : public WillBeGarbageCollectedMixin {
- // FIXME: Oilpan: Remove the pre-finalizer by moving LifecycleNotifier
- // to Oilpan's heap and making LifecycleNotifier::m_observers
- // a hash set of weak members.
- WILL_BE_USING_PRE_FINALIZER(LifecycleObserver, dispose);
public:
using Context = T;
explicit LifecycleObserver(Context* context)
: m_lifecycleContext(nullptr)
{
-#if ENABLE(OILPAN)
- ThreadState::current()->registerPreFinalizer(*this);
-#endif
}
virtual ~LifecycleObserver()
@@ -61,6 +54,7 @@ public:
visitor->trace(m_lifecycleContext);
}
virtual void contextDestroyed() { }
+
void dispose()
{
setContext(nullptr);
« no previous file with comments | « Source/platform/LifecycleNotifier.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698