It should be an error to use adoptPtr with RefCounted subclasses
Created attachment 200063 [details] Patch
Comment on attachment 200063 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=200063&action=review I loooove this. Great idea. > Source/WTF/wtf/PassOwnPtr.h:151 > + COMPILE_ASSERT(!(IsSubclass<T, RefCounted<T> >::value), DoNotUseAdoptPtrWithRefCounted); > + COMPILE_ASSERT(!(IsSubclass<T, ThreadSafeRefCounted<T> >::value), DoNotUseAdoptPtrWithThreadSafeRefCounted); +RefCountedBase
(In reply to comment #2) > (From update of attachment 200063 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=200063&action=review > > I loooove this. Great idea. > > > Source/WTF/wtf/PassOwnPtr.h:151 > > + COMPILE_ASSERT(!(IsSubclass<T, RefCounted<T> >::value), DoNotUseAdoptPtrWithRefCounted); > > + COMPILE_ASSERT(!(IsSubclass<T, ThreadSafeRefCounted<T> >::value), DoNotUseAdoptPtrWithThreadSafeRefCounted); > > +RefCountedBase I’ll use ThreadSafeRefCountedBase and RefCountedBase instead.
Committed r149341: <http://trac.webkit.org/changeset/149341>