| Index: Source/platform/heap/Handle.h
|
| diff --git a/Source/platform/heap/Handle.h b/Source/platform/heap/Handle.h
|
| index 99e61dd12ff8e8015bec8e0343b89ec3f1d6efd8..8c7cedd603ea3dcde1be702b72970e729aef0f12 100644
|
| --- a/Source/platform/heap/Handle.h
|
| +++ b/Source/platform/heap/Handle.h
|
| @@ -44,21 +44,23 @@ namespace WebCore {
|
|
|
| template<typename T> class HeapTerminatedArray;
|
|
|
| -#define COMPILE_ASSERT_IS_GARBAGE_COLLECTED(T, ErrorMessage) \
|
| - typedef typename WTF::RemoveConst<T>::Type NonConstType; \
|
| - typedef WTF::IsSubclassOfTemplate<NonConstType, GarbageCollected> GarbageCollectedSubclass; \
|
| - typedef WTF::IsSubclass<NonConstType, GarbageCollectedMixin> GarbageCollectedMixinSubclass; \
|
| - typedef WTF::IsSubclassOfTemplate3<NonConstType, HeapHashSet> HeapHashSetSubclass; \
|
| - typedef WTF::IsSubclassOfTemplate5<NonConstType, HeapHashMap> HeapHashMapSubclass; \
|
| - typedef WTF::IsSubclassOfTemplateTypenameSize<NonConstType, HeapVector> HeapVectorSubclass; \
|
| - typedef WTF::IsSubclassOfTemplate<NonConstType, HeapTerminatedArray> HeapTerminatedArraySubclass; \
|
| - COMPILE_ASSERT(GarbageCollectedSubclass::value || \
|
| - GarbageCollectedMixinSubclass::value || \
|
| - HeapHashSetSubclass::value || \
|
| - HeapHashMapSubclass::value || \
|
| - HeapVectorSubclass::value || \
|
| - HeapTerminatedArraySubclass::value, \
|
| - ErrorMessage);
|
| +#define COMPILE_ASSERT_IS_GARBAGE_COLLECTED(T, ErrorMessage) \
|
| + do { \
|
| + typedef typename WTF::RemoveConst<T>::Type NonConstType; \
|
| + typedef WTF::IsSubclassOfTemplate<NonConstType, GarbageCollected> GarbageCollectedSubclass; \
|
| + typedef WTF::IsSubclass<NonConstType, GarbageCollectedMixin> GarbageCollectedMixinSubclass; \
|
| + typedef WTF::IsSubclassOfTemplate3<NonConstType, HeapHashSet> HeapHashSetSubclass; \
|
| + typedef WTF::IsSubclassOfTemplate5<NonConstType, HeapHashMap> HeapHashMapSubclass; \
|
| + typedef WTF::IsSubclassOfTemplateTypenameSize<NonConstType, HeapVector> HeapVectorSubclass; \
|
| + typedef WTF::IsSubclassOfTemplate<NonConstType, HeapTerminatedArray> HeapTerminatedArraySubclass; \
|
| + COMPILE_ASSERT(GarbageCollectedSubclass::value || \
|
| + GarbageCollectedMixinSubclass::value || \
|
| + HeapHashSetSubclass::value || \
|
| + HeapHashMapSubclass::value || \
|
| + HeapVectorSubclass::value || \
|
| + HeapTerminatedArraySubclass::value, \
|
| + ErrorMessage); \
|
| + } while (0)
|
|
|
| template<typename T> class Member;
|
|
|
| @@ -448,6 +450,13 @@ public:
|
| COMPILE_ASSERT_IS_GARBAGE_COLLECTED(T, NonGarbageCollectedObjectInMember);
|
| }
|
|
|
| + template<typename U>
|
| + Member(const RawPtr<U>& other) : m_raw(other.get())
|
| + {
|
| + COMPILE_ASSERT_IS_GARBAGE_COLLECTED(T, NonGarbageCollectedObjectInMember);
|
| + COMPILE_ASSERT_IS_GARBAGE_COLLECTED(U, NonGarbageCollectedObjectInMember);
|
| + }
|
| +
|
| Member(WTF::HashTableDeletedValueType) : m_raw(reinterpret_cast<T*>(-1))
|
| {
|
| COMPILE_ASSERT_IS_GARBAGE_COLLECTED(T, NonGarbageCollectedObjectInMember);
|
|
|