Changeset 156931 in webkit


Ignore:
Timestamp:
Oct 4, 2013 5:26:12 PM (11 years ago)
Author:
mikhail.pozdnyakov@intel.com
Message:

Remove WTF smart pointers 'const_pointer_cast'
https://bugs.webkit.org/show_bug.cgi?id=122325

Reviewed by Darin Adler.

Removed WTF smart pointers 'const_pointer_cast' functions as:

  • they were not used
  • their implementation was wrong as they tried to cast to a different pointer type
  • wtf/PassOwnPtr.h:
  • wtf/PassRefPtr.h:
  • wtf/RefPtr.h:
Location:
trunk/Source/WTF
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r156910 r156931  
     12013-10-04  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
     2
     3        Remove WTF smart pointers 'const_pointer_cast'
     4        https://bugs.webkit.org/show_bug.cgi?id=122325
     5
     6        Reviewed by Darin Adler.
     7
     8        Removed WTF smart pointers 'const_pointer_cast' functions as:
     9        - they were not used
     10        - their implementation was wrong as they tried to cast to a different pointer type
     11
     12        * wtf/PassOwnPtr.h:
     13        * wtf/PassRefPtr.h:
     14        * wtf/RefPtr.h:
     15
    1162013-10-04  Oliver Hunt  <oliver@apple.com>
    217
  • trunk/Source/WTF/wtf/PassOwnPtr.h

    r155604 r156931  
    157157    }
    158158
    159     template<typename T, typename U> inline PassOwnPtr<T> const_pointer_cast(const PassOwnPtr<U>& p)
    160     {
    161         return adoptPtr(const_cast<T*>(p.leakPtr()));
    162     }
    163 
    164159    template<typename T> inline T* getPtr(const PassOwnPtr<T>& p)
    165160    {
     
    171166using WTF::PassOwnPtr;
    172167using WTF::adoptPtr;
    173 using WTF::const_pointer_cast;
    174168using WTF::static_pointer_cast;
    175169
  • trunk/Source/WTF/wtf/PassRefPtr.h

    r155604 r156931  
    158158    }
    159159
    160     template<typename T, typename U> inline PassRefPtr<T> const_pointer_cast(const PassRefPtr<U>& p)
    161     {
    162         return adoptRef(const_cast<T*>(p.leakRef()));
    163     }
    164 
    165160    template<typename T> inline T* getPtr(const PassRefPtr<T>& p)
    166161    {
     
    173168using WTF::adoptRef;
    174169using WTF::static_pointer_cast;
    175 using WTF::const_pointer_cast;
    176170
    177171#endif // WTF_PassRefPtr_h
  • trunk/Source/WTF/wtf/RefPtr.h

    r155251 r156931  
    201201    }
    202202
    203     template<typename T, typename U> inline RefPtr<T> const_pointer_cast(const RefPtr<U>& p)
    204     {
    205         return RefPtr<T>(const_cast<T*>(p.get()));
    206     }
    207 
    208203    template<typename T> inline T* getPtr(const RefPtr<T>& p)
    209204    {
     
    215210using WTF::RefPtr;
    216211using WTF::static_pointer_cast;
    217 using WTF::const_pointer_cast;
    218212
    219213#endif // WTF_RefPtr_h
Note: See TracChangeset for help on using the changeset viewer.