Ignore:
Timestamp:
Aug 11, 2010, 12:08:23 AM (15 years ago)
Author:
[email protected]
Message:

2010-08-10 Darin Adler <Darin Adler>

Reviewed by Sam Weinig.

Add leakRef and clear to all RefPtr variants
https://bugs.webkit.org/show_bug.cgi?id=42389

  • API/JSRetainPtr.h: Changed all uses of "template <...>" to instead do "template<...>". We should probably put this in the style guide and do it consitently. Fixed other minor style issues. Defined many of the inlined functions outside the class definition, to avoid style checker warnings about multiple statements on a single line and for slightly better clarity of the class definition itself. Renamed releaseRef to leakRef. Added a releaseRef that calls leakRef so we don't have to rename all callers oat once. Added a clear function.
  • wtf/PassRefPtr.h: Changed all uses of releaseRef to leakRef.
  • wtf/RefPtr.h: Changed all uses of "template <...>" to instead do "template<...>". Tidied up declarations and comments a bit. Changed all uses of releaseRef to leakRef.
  • wtf/RetainPtr.h: Changed all uses of "template <...>" to instead do "template<...>". Defined many of the inlined functions outside the class definition, to avoid style checker warnings about multiple statements on a single line and for slightly better clarity of the class definition itself. Renamed releaseRef to leakRef. Added a releaseRef that calls leakRef so we don't have to rename all callers at once. Added a clear function.

2010-08-10 Darin Adler <Darin Adler>

Reviewed by Sam Weinig.

Add leakRef and clear to all RefPtr variants
https://bugs.webkit.org/show_bug.cgi?id=42389

  • platform/win/COMPtr.h: Changed all uses of "template <...>" to instead do "template<...>". Defined many of the inlined functions outside the class definition, to avoid style checker warnings about multiple statements on a single line and for slightly better clarity of the class definition itself. Renamed releaseRef to leakRef. Added a releaseRef that calls leakRef so we don't have to rename all callers at once. Added a clear function. Changed the hash table code so it doesn't need to call releaseRef, and so it uses the hash table deleted value hooks already present within the class.

2010-08-10 Darin Adler <Darin Adler>

Reviewed by Sam Weinig.

Add leakRef and clear to all RefPtr variants
https://bugs.webkit.org/show_bug.cgi?id=42389

  • UIProcess/API/cpp/WKRetainPtr.h: Changed all uses of "template <...>" to "template<...>". Defined many of the inlined functions outside the class definition, to avoid style checker warnings about multiple statements on a single line and for slightly better clarity of the class definition itself. Renamed releaseRef to leakRef. Added a releaseRef that calls leakRef so we don't have to rename all callers at once. Added a clear function.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/PassRefPtr.h

    r63562 r65130  
    6868        // a const PassRefPtr. However, it makes it much easier to work with PassRefPtr
    6969        // temporaries, and we don't have a need to use real const PassRefPtrs anyway.
    70         PassRefPtr(const PassRefPtr& o) : m_ptr(o.releaseRef()) { }
    71         template<typename U> PassRefPtr(const PassRefPtr<U>& o) : m_ptr(o.releaseRef()) { }
     70        PassRefPtr(const PassRefPtr& o) : m_ptr(o.leakRef()) { }
     71        template<typename U> PassRefPtr(const PassRefPtr<U>& o) : m_ptr(o.leakRef()) { }
    7272
    7373        ALWAYS_INLINE ~PassRefPtr() { derefIfNotNull(m_ptr); }
     
    107107   
    108108    // NonNullPassRefPtr: Optimized for passing non-null pointers. A NonNullPassRefPtr
    109     // begins life non-null, and can only become null through a call to releaseRef()
     109    // begins life non-null, and can only become null through a call to leakRef()
    110110    // or clear().
    111111
     
    131131
    132132        NonNullPassRefPtr(const NonNullPassRefPtr& o)
    133             : m_ptr(o.releaseRef())
     133            : m_ptr(o.leakRef())
    134134        {
    135135            ASSERT(m_ptr);
     
    137137
    138138        template<typename U> NonNullPassRefPtr(const NonNullPassRefPtr<U>& o)
    139             : m_ptr(o.releaseRef())
     139            : m_ptr(o.leakRef())
    140140        {
    141141            ASSERT(m_ptr);
     
    143143
    144144        template<typename U> NonNullPassRefPtr(const PassRefPtr<U>& o)
    145             : m_ptr(o.releaseRef())
     145            : m_ptr(o.leakRef())
    146146        {
    147147            ASSERT(m_ptr);
     
    208208    {
    209209        T* ptr = m_ptr;
    210         m_ptr = ref.releaseRef();
     210        m_ptr = ref.leakRef();
    211211        derefIfNotNull(ptr);
    212212        return *this;
     
    216216    {
    217217        T* ptr = m_ptr;
    218         m_ptr = ref.releaseRef();
     218        m_ptr = ref.leakRef();
    219219        derefIfNotNull(ptr);
    220220        return *this;
     
    279279    template<typename T, typename U> inline PassRefPtr<T> static_pointer_cast(const PassRefPtr<U>& p)
    280280    {
    281         return adoptRef(static_cast<T*>(p.releaseRef()));
     281        return adoptRef(static_cast<T*>(p.leakRef()));
    282282    }
    283283
    284284    template<typename T, typename U> inline PassRefPtr<T> const_pointer_cast(const PassRefPtr<U>& p)
    285285    {
    286         return adoptRef(const_cast<T*>(p.releaseRef()));
     286        return adoptRef(const_cast<T*>(p.leakRef()));
    287287    }
    288288
Note: See TracChangeset for help on using the changeset viewer.