Title: [149760] trunk/Source/WTF
Revision
149760
Author
[email protected]
Date
2013-05-08 12:47:30 -0700 (Wed, 08 May 2013)

Log Message

Remove RetainPtr::adoptNS and RetainPtr::adoptCF
https://bugs.webkit.org/show_bug.cgi?id=115817

Reviewed by Jessie Berlin.

These functions are now unused so remove them. The preferred way to create a RetainPtr with an
adopted reference is to use the adoptNS/adoptCF free functions.

Rewrite the move assignment operators to just call CFRelease explicitly.

* wtf/RetainPtr.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (149759 => 149760)


--- trunk/Source/WTF/ChangeLog	2013-05-08 19:39:49 UTC (rev 149759)
+++ trunk/Source/WTF/ChangeLog	2013-05-08 19:47:30 UTC (rev 149760)
@@ -1,5 +1,19 @@
 2013-05-08  Anders Carlsson  <[email protected]>
 
+        Remove RetainPtr::adoptNS and RetainPtr::adoptCF
+        https://bugs.webkit.org/show_bug.cgi?id=115817
+
+        Reviewed by Jessie Berlin.
+
+        These functions are now unused so remove them. The preferred way to create a RetainPtr with an
+        adopted reference is to use the adoptNS/adoptCF free functions.
+        
+        Rewrite the move assignment operators to just call CFRelease explicitly.
+
+        * wtf/RetainPtr.h:
+
+2013-05-08  Anders Carlsson  <[email protected]>
+
         Remove ThreadingNone.cpp
 
         Rubber-stamped by Beth Dakin.

Modified: trunk/Source/WTF/wtf/RetainPtr.h (149759 => 149760)


--- trunk/Source/WTF/wtf/RetainPtr.h	2013-05-08 19:39:49 UTC (rev 149759)
+++ trunk/Source/WTF/wtf/RetainPtr.h	2013-05-08 19:47:30 UTC (rev 149760)
@@ -120,9 +120,6 @@
         RetainPtr& operator=(std::nullptr_t) { clear(); return *this; }
 #endif
 
-        void adoptCF(PtrType);
-        void adoptNS(PtrType);
-        
         void swap(RetainPtr&);
 
     private:
@@ -130,7 +127,7 @@
 
         PtrType m_ptr;
     };
-    
+
     template<typename T> template<typename U> inline RetainPtr<T>::RetainPtr(const RetainPtr<U>& o)
         : m_ptr(o.get())
     {
@@ -164,7 +161,7 @@
             CFRelease(ptr);
         return *this;
     }
-    
+
     template<typename T> template<typename U> inline RetainPtr<T>& RetainPtr<T>::operator=(const RetainPtr<U>& o)
     {
         PtrType optr = o.get();
@@ -202,34 +199,23 @@
 #if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES)
     template<typename T> inline RetainPtr<T>& RetainPtr<T>::operator=(RetainPtr<T>&& o)
     {
-        adoptCF(o.leakRef());
-        return *this;
-    }
-    
-    template<typename T> template<typename U> inline RetainPtr<T>& RetainPtr<T>::operator=(RetainPtr<U>&& o)
-    {
-        adoptCF(o.leakRef());
-        return *this;
-    }
-#endif
-
-    template<typename T> inline void RetainPtr<T>::adoptCF(PtrType optr)
-    {
         PtrType ptr = m_ptr;
-        m_ptr = optr;
+        m_ptr = o.leakRef();
         if (ptr)
             CFRelease(ptr);
+
+        return *this;
     }
 
-    template<typename T> inline void RetainPtr<T>::adoptNS(PtrType optr)
+    template<typename T> template<typename U> inline RetainPtr<T>& RetainPtr<T>::operator=(RetainPtr<U>&& o)
     {
-        adoptNSReference(optr);
-        
         PtrType ptr = m_ptr;
-        m_ptr = optr;
+        m_ptr = o.leakRef();
         if (ptr)
             CFRelease(ptr);
+        return *this;
     }
+#endif
 
     template<typename T> inline void RetainPtr<T>::swap(RetainPtr<T>& o)
     {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to