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

Unified Diff: Source/platform/LifecycleNotifier.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/modules/webmidi/MIDIAccessInitializer.cpp ('k') | Source/platform/LifecycleObserver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/LifecycleNotifier.h
diff --git a/Source/platform/LifecycleNotifier.h b/Source/platform/LifecycleNotifier.h
index f465555b68199f20cde0ffa1a8b5039b385257bf..44dcf07aa07a67ccd65a54ba279a6a7c0e0ffd09 100644
--- a/Source/platform/LifecycleNotifier.h
+++ b/Source/platform/LifecycleNotifier.h
@@ -48,7 +48,12 @@ public:
// is still valid and safe to use during the notification.
virtual void notifyContextDestroyed();
- DEFINE_INLINE_VIRTUAL_TRACE() { }
+ DEFINE_INLINE_VIRTUAL_TRACE()
+ {
+#if ENABLE(OILPAN)
+ visitor->trace(m_observers);
+#endif
+ }
bool isIteratingOverObservers() const { return m_iterating != IteratingNone; }
@@ -68,8 +73,12 @@ protected:
IterationType m_iterating;
protected:
- using ObserverSet = HashSet<Observer*>;
+ using ObserverSet = WillBeHeapHashSet<RawPtrWillBeWeakMember<Observer>>;
+ // FIXME: Oilpan: make LifecycleNotifier<> a GC mixin, somehow. ExecutionContext
+ // is the problematic case, as it would then be a class with two GC mixin
+ // bases, but cannot itself derive from a GC base class also.
+ GC_PLUGIN_IGNORE("467502")
ObserverSet m_observers;
#if ENABLE(ASSERT)
« no previous file with comments | « Source/modules/webmidi/MIDIAccessInitializer.cpp ('k') | Source/platform/LifecycleObserver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698