Chromium Code Reviews| Index: Source/platform/Supplementable.h |
| diff --git a/Source/platform/Supplementable.h b/Source/platform/Supplementable.h |
| index f148734e003f11811ce5de2f76adb71f20dcf6bb..32c4761a085ce63ac16a97ece6c2f03ae4cc3f39 100644 |
| --- a/Source/platform/Supplementable.h |
| +++ b/Source/platform/Supplementable.h |
| @@ -188,8 +188,6 @@ public: |
| #endif |
| } |
|
Erik Corry
2014/07/22 09:37:51
I think this should have a virtual trace method to
wibling-chromium
2014/07/22 11:03:42
Done. It does require me to add back the GC_PLUGIN
|
| - virtual void trace(Visitor* visitor) { visitor->trace(m_supplements); } |
| - |
| void willBeDestroyed() |
| { |
| typedef typename SupplementableTraits<T, isGarbageCollected>::SupplementMap::iterator SupplementIterator; |
| @@ -216,9 +214,9 @@ class HeapSupplement : public SupplementBase<T, true> { }; |
| // FIXME: Oilpan: Move GarbageCollectedMixin to SupplementableBase<T, true> once PersistentHeapSupplementable is removed again. |
| template<typename T> |
| -class GC_PLUGIN_IGNORE("http://crbug.com/395036") HeapSupplementable : public SupplementableBase<T, true>, public GarbageCollectedMixin { |
| +class HeapSupplementable : public SupplementableBase<T, true>, public GarbageCollectedMixin { |
| public: |
| - virtual void trace(Visitor* visitor) { SupplementableBase<T, true>::trace(visitor); } |
| + virtual void trace(Visitor* visitor) OVERRIDE { visitor->trace(this->m_supplements); } |
| }; |
| template<typename T> |
| @@ -231,6 +229,9 @@ public: |
| for (SupplementIterator it = this->m_supplements.begin(); it != this->m_supplements.end(); ++it) |
| it->value->persistentHostHasBeenDestroyed(); |
| } |
| + |
| + virtual void trace(Visitor* visitor) { visitor->trace(this->m_supplements); } |
| + |
| private: |
| class TraceDelegate : PersistentBase<ThreadLocalPersistents<AnyThread>, TraceDelegate> { |
| public: |
| @@ -247,7 +248,17 @@ template<typename T> |
| class Supplement : public SupplementBase<T, false> { }; |
| template<typename T> |
| -class Supplementable : public SupplementableBase<T, false> { }; |
| +class Supplementable : public SupplementableBase<T, false> { |
| +public: |
| + virtual void trace(Visitor*) |
| + { |
| + // No tracing of off-heap supplements. We should not have any Supplementable |
| + // object on the heap. Either the object is HeapSupplementable or if it is |
| + // off heap it should use PersistentHeapSupplementable to trace any on-heap |
| + // supplements. |
| + COMPILE_ASSERT(!IsGarbageCollectedType<T>::value, GarbageCollectedObjectMustBeHeapSupplementable); |
| + } |
| +}; |
| template<typename T> |
| struct ThreadingTrait<blink::SupplementBase<T, true> > { |