Chromium Code Reviews| Index: Source/wtf/PassRefPtr.h |
| diff --git a/Source/wtf/PassRefPtr.h b/Source/wtf/PassRefPtr.h |
| index a099eef5aa35ca287fa50971a04da5e4b812829d..904d9c6bbd0821ee49bb2f06e26cf2e5072874b7 100644 |
| --- a/Source/wtf/PassRefPtr.h |
| +++ b/Source/wtf/PassRefPtr.h |
| @@ -183,8 +183,11 @@ namespace WTF { |
| return a.get() != b.get(); |
| } |
| + template<typename T> class RefCountedGarbageCollected; |
|
haraken
2014/10/12 15:16:45
I'm not sure if this forward declaration is allowe
sof
2014/10/13 12:11:30
It doesn't quite set a precedent, TypeTraits.h alr
sof
2014/10/13 12:11:30
Don't think there is a "using" for it (or in scope
|
| template<typename T> PassRefPtr<T> adoptRef(T* p) |
| { |
| + static const bool notRefCountedGarbageCollected = !WTF::IsSubclassOfTemplate<typename WTF::RemoveConst<T>::Type, RefCountedGarbageCollected>::value; |
| + COMPILE_ASSERT(notRefCountedGarbageCollected, adoptRefIsNotAllowedForRefCountedGarbageCollected); |
| adopted(p); |
| return PassRefPtr<T>(p, PassRefPtr<T>::AdoptRef); |
| } |