Title: [155319] trunk/Source/WTF
Revision
155319
Author
[email protected]
Date
2013-09-08 20:54:14 -0700 (Sun, 08 Sep 2013)

Log Message

Deprecate AdoptCF and AdoptNS (on all platforms except iOS for now)
https://bugs.webkit.org/show_bug.cgi?id=121017

Reviewed by Andreas Kling.

* wtf/RetainPtr.h: Use the preprocessor to rename AdoptCF and AdoptNS
to DeprecatedAdoptCF and DeprecatedAdoptNS on all platforms except
for iOS. Also removed an unneeded explicit conversion in the retainPtr
function. Also re-sorted the using lines at the end of the file.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (155318 => 155319)


--- trunk/Source/WTF/ChangeLog	2013-09-09 02:11:06 UTC (rev 155318)
+++ trunk/Source/WTF/ChangeLog	2013-09-09 03:54:14 UTC (rev 155319)
@@ -1,3 +1,15 @@
+2013-09-08  Darin Adler  <[email protected]>
+
+        Deprecate AdoptCF and AdoptNS (on all platforms except iOS for now)
+        https://bugs.webkit.org/show_bug.cgi?id=121017
+
+        Reviewed by Andreas Kling.
+
+        * wtf/RetainPtr.h: Use the preprocessor to rename AdoptCF and AdoptNS
+        to DeprecatedAdoptCF and DeprecatedAdoptNS on all platforms except
+        for iOS. Also removed an unneeded explicit conversion in the retainPtr
+        function. Also re-sorted the using lines at the end of the file.
+
 2013-09-08  Anders Carlsson  <[email protected]>
 
         Move WTF::notFound to Vector.h and delete NotFound.h

Modified: trunk/Source/WTF/wtf/RetainPtr.h (155318 => 155319)


--- trunk/Source/WTF/wtf/RetainPtr.h	2013-09-09 02:11:06 UTC (rev 155318)
+++ trunk/Source/WTF/wtf/RetainPtr.h	2013-09-09 03:54:14 UTC (rev 155319)
@@ -49,6 +49,11 @@
     // Unlike most most of our smart pointers, RetainPtr can take either the pointer type or the pointed-to type,
     // so both RetainPtr<NSDictionary> and RetainPtr<CFDictionaryRef> will work.
 
+#if !PLATFORM(IOS)
+    #define AdoptCF DeprecatedAdoptCF
+    #define AdoptNS DeprecatedAdoptNS
+#endif
+
     enum AdoptCFTag { AdoptCF };
     enum AdoptNSTag { AdoptNS };
     
@@ -294,7 +299,7 @@
     template<typename T> inline RetainPtr<T> retainPtr(T) WARN_UNUSED_RETURN;
     template<typename T> inline RetainPtr<T> retainPtr(T o)
     {
-        return RetainPtr<T>(o);
+        return o;
     }
 
     template<typename P> struct HashTraits<RetainPtr<P> > : SimpleClassHashTraits<RetainPtr<P> > { };
@@ -332,15 +337,24 @@
         }
         static const bool safeToCompareToEmptyOrDeleted = false;
     };
+
+#if !PLATFORM(IOS)
+    #undef AdoptCF
+    #undef AdoptNS
+#endif
+
 } // namespace WTF
 
-using WTF::AdoptCF;
-using WTF::AdoptNS;
+using WTF::RetainPtr;
 using WTF::adoptCF;
 using WTF::adoptNS;
-using WTF::RetainPtr;
 using WTF::retainPtr;
 
+#if PLATFORM(IOS)
+using WTF::AdoptCF;
+using WTF::AdoptNS;
+#endif
+
 #endif // USE(CF) || defined(__OBJC__)
 
 #endif // WTF_RetainPtr_h
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to