Chromium Code Reviews| Index: Source/platform/Supplementable.h |
| diff --git a/Source/platform/Supplementable.h b/Source/platform/Supplementable.h |
| index f148734e003f11811ce5de2f76adb71f20dcf6bb..0465f9e2dedd6d0e5faa5aab853c0e5a8e29790d 100644 |
| --- a/Source/platform/Supplementable.h |
| +++ b/Source/platform/Supplementable.h |
| @@ -188,8 +188,6 @@ public: |
| #endif |
| } |
| - 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,16 @@ 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 |
|
sof
2014/07/21 13:43:15
I think it is unlikely that this slips through, bu
wibling-chromium
2014/07/21 14:37:43
Good idea. I added a compile assert checking that
|
| + // 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. |
| + } |
| +}; |
| template<typename T> |
| struct ThreadingTrait<blink::SupplementBase<T, true> > { |