Index: Source/platform/Supplementable.h |
diff --git a/Source/platform/Supplementable.h b/Source/platform/Supplementable.h |
index 650a204bd57cbbee12b7ebf1ad25f73e6e3b5791..f148734e003f11811ce5de2f76adb71f20dcf6bb 100644 |
--- a/Source/platform/Supplementable.h |
+++ b/Source/platform/Supplementable.h |
@@ -159,8 +159,6 @@ |
template<typename T> |
class SupplementableTracing<T, false> { }; |
-// Helper class for implementing Supplementable, HeapSupplementable, and |
-// PersistentHeapSupplementable. |
template<typename T, bool isGarbageCollected = false> |
class SupplementableBase : public SupplementableTracing<T, isGarbageCollected> { |
public: |
@@ -190,11 +188,7 @@ |
#endif |
} |
- // We have a trace method in the SupplementableBase class to ensure we have |
- // the vtable at the first word of the object. However we don't trace the |
- // m_supplements here, but in the partially specialized template subclasses |
- // since we only want to trace it for garbage collected classes. |
- virtual void trace(Visitor*) { } |
+ virtual void trace(Visitor* visitor) { visitor->trace(m_supplements); } |
void willBeDestroyed() |
{ |
@@ -217,8 +211,6 @@ |
#endif |
}; |
-// This class is used to make an on-heap class supplementable. Its supplements |
-// must be HeapSupplement. |
template<typename T> |
class HeapSupplement : public SupplementBase<T, true> { }; |
@@ -226,17 +218,11 @@ |
template<typename T> |
class GC_PLUGIN_IGNORE("http://crbug.com/395036") HeapSupplementable : public SupplementableBase<T, true>, public GarbageCollectedMixin { |
public: |
- virtual void trace(Visitor* visitor) OVERRIDE |
- { |
- visitor->trace(this->m_supplements); |
- SupplementableBase<T, true>::trace(visitor); |
- } |
-}; |
- |
-// This class is used to make an off-heap class supplementable with supplements |
-// that are on-heap, aka. HeapSupplements. |
-template<typename T> |
-class GC_PLUGIN_IGNORE("http://crbug.com/395036") PersistentHeapSupplementable : public SupplementableBase<T, true> { |
+ virtual void trace(Visitor* visitor) { SupplementableBase<T, true>::trace(visitor); } |
+}; |
+ |
+template<typename T> |
+class PersistentHeapSupplementable : public SupplementableBase<T, true> { |
public: |
PersistentHeapSupplementable() : m_root(this) { } |
virtual ~PersistentHeapSupplementable() |
@@ -245,13 +231,6 @@ |
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); |
- SupplementableBase<T, true>::trace(visitor); |
- } |
- |
private: |
class TraceDelegate : PersistentBase<ThreadLocalPersistents<AnyThread>, TraceDelegate> { |
public: |
@@ -267,21 +246,8 @@ |
template<typename T> |
class Supplement : public SupplementBase<T, false> { }; |
-// This class is used to make an off-heap class supplementable with off-heap |
-// supplements (Supplement). |
-template<typename T> |
-class GC_PLUGIN_IGNORE("http://crbug.com/395036") Supplementable : public SupplementableBase<T, false> { |
-public: |
- virtual void trace(Visitor* 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); |
- SupplementableBase<T, false>::trace(visitor); |
- } |
-}; |
+template<typename T> |
+class Supplementable : public SupplementableBase<T, false> { }; |
template<typename T> |
struct ThreadingTrait<blink::SupplementBase<T, true> > { |