Index: third_party/WebKit/Source/platform/heap/Handle.h |
diff --git a/third_party/WebKit/Source/platform/heap/Handle.h b/third_party/WebKit/Source/platform/heap/Handle.h |
index 358cf68921795c0a9aeb6040f23c4396207fecda..f45c10d5309883a2827e7af09289873f2c170ea5 100644 |
--- a/third_party/WebKit/Source/platform/heap/Handle.h |
+++ b/third_party/WebKit/Source/platform/heap/Handle.h |
@@ -1047,15 +1047,16 @@ class PLATFORM_EXPORT DummyBase<void> { }; |
template<typename T> T* adoptRefWillBeNoop(T* ptr) |
{ |
- static const bool notRefCounted = !WTF::IsSubclassOfTemplate<typename std::remove_const<T>::type, RefCounted>::value; |
- static_assert(notRefCounted, "you must adopt"); |
+ static const bool isGarbageCollected = IsGarbageCollectedType<T>::value; |
+ static const bool isRefCounted = WTF::IsSubclassOfTemplate<typename std::remove_const<T>::type, RefCounted>::value; |
+ static_assert(isGarbageCollected && !isRefCounted, "T needs to be a non-refcounted, garbage collected type."); |
return ptr; |
} |
template<typename T> T* adoptPtrWillBeNoop(T* ptr) |
{ |
- static const bool notRefCounted = !WTF::IsSubclassOfTemplate<typename std::remove_const<T>::type, RefCounted>::value; |
- static_assert(notRefCounted, "you must adopt"); |
+ static const bool isGarbageCollected = IsGarbageCollectedType<T>::value; |
+ static_assert(isGarbageCollected, "T needs to be a garbage collected type."); |
return ptr; |
} |