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

Unified Diff: Source/wtf/PassRefPtr.h

Issue 647393002: Oilpan: Forbid adoptRef(X*) where X is RefCountedGarbageCollected (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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/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);
}
« 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