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

Unified Diff: Source/platform/heap/Handle.h

Issue 225303010: Oilpan: add Member<T>(RawPtr<U>) constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698