Title: [101528] trunk/Source/_javascript_Core
Revision
101528
Author
[email protected]
Date
2011-11-30 10:25:50 -0800 (Wed, 30 Nov 2011)

Log Message

Add adoptCF and adoptNS convenience functions to RetainPtr.h
https://bugs.webkit.org/show_bug.cgi?id=73399

Reviewed by Anders Carlsson.

* wtf/RetainPtr.h:
(WTF::adoptCF):
(WTF::adoptNS):
These adoption functions match the pattern we use in other
smart pointer classes.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (101527 => 101528)


--- trunk/Source/_javascript_Core/ChangeLog	2011-11-30 18:11:21 UTC (rev 101527)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-11-30 18:25:50 UTC (rev 101528)
@@ -1,3 +1,16 @@
+2011-11-29  Sam Weinig  <[email protected]>
+
+        Add adoptCF and adoptNS convenience functions to RetainPtr.h
+        https://bugs.webkit.org/show_bug.cgi?id=73399
+
+        Reviewed by Anders Carlsson.
+
+        * wtf/RetainPtr.h:
+        (WTF::adoptCF):
+        (WTF::adoptNS):
+        These adoption functions match the pattern we use in other
+        smart pointer classes.
+
 2011-11-30  Adam Roben  <[email protected]>
 
         Fix RetainPtr's move assignment operators

Modified: trunk/Source/_javascript_Core/wtf/RetainPtr.h (101527 => 101528)


--- trunk/Source/_javascript_Core/wtf/RetainPtr.h	2011-11-30 18:11:21 UTC (rev 101527)
+++ trunk/Source/_javascript_Core/wtf/RetainPtr.h	2011-11-30 18:25:50 UTC (rev 101528)
@@ -255,6 +255,18 @@
         return a != b.get(); 
     }
 
+    template<typename T> inline RetainPtr<T> adoptCF(T) WARN_UNUSED_RETURN;
+    template<typename T> inline RetainPtr<T> adoptCF(T o)
+    {
+        return RetainPtr<T>(AdoptCF, o);
+    }
+
+    template<typename T> inline RetainPtr<T> adoptNS(T) WARN_UNUSED_RETURN;
+    template<typename T> inline RetainPtr<T> adoptNS(T o)
+    {
+        return RetainPtr<T>(AdoptNS, o);
+    }
+
     template<typename P> struct HashTraits<RetainPtr<P> > : SimpleClassHashTraits<RetainPtr<P> > { };
     
     template<typename P> struct PtrHash<RetainPtr<P> > : PtrHash<typename RetainPtr<P>::PtrType> {
@@ -272,6 +284,8 @@
 
 using WTF::AdoptCF;
 using WTF::AdoptNS;
+using WTF::adoptCF;
+using WTF::adoptNS;
 using WTF::RetainPtr;
 
 #endif // WTF_RetainPtr_h
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to