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

Unified Diff: Source/platform/Supplementable.h

Issue 335573004: Oilpan: Notify supplements of Page and LocalFrame destruction. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase and null check Created 6 years, 6 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/screen_orientation/ScreenOrientationController.cpp ('k') | Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/Supplementable.h
diff --git a/Source/platform/Supplementable.h b/Source/platform/Supplementable.h
index b35b0123550932ce185295a82d1fde00db242b95..aa7322710921d265d17a67276f4b8d928403b1dd 100644
--- a/Source/platform/Supplementable.h
+++ b/Source/platform/Supplementable.h
@@ -145,6 +145,9 @@ public:
virtual void trace(Visitor*) { }
virtual void willBeDestroyed() { }
+
+ // FIXME: Oilpan: Remove this callback once PersistentHeapSupplementable is removed again.
+ virtual void persistentHostHasBeenDestroyed() { }
};
template<typename T, bool>
@@ -194,8 +197,8 @@ public:
it->value->willBeDestroyed();
}
-private:
- // FIXME: Oilpan: Remove this ignore once PersistentHeapSupplementable is removed again.
+ // FIXME: Oilpan: Make private and remove this ignore once PersistentHeapSupplementable is removed again.
+protected:
GC_PLUGIN_IGNORE("")
typename SupplementableTraits<T, isGarbageCollected>::SupplementMap m_supplements;
@@ -219,6 +222,12 @@ template<typename T>
class PersistentHeapSupplementable : public SupplementableBase<T, true> {
public:
PersistentHeapSupplementable() : m_root(this) { }
+ virtual ~PersistentHeapSupplementable()
+ {
+ typedef typename SupplementableTraits<T, true>::SupplementMap::iterator SupplementIterator;
+ for (SupplementIterator it = this->m_supplements.begin(); it != this->m_supplements.end(); ++it)
+ it->value->persistentHostHasBeenDestroyed();
+ }
private:
class TraceDelegate : PersistentBase<ThreadLocalPersistents<AnyThread>, TraceDelegate> {
public:
« no previous file with comments | « Source/modules/screen_orientation/ScreenOrientationController.cpp ('k') | Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698