Changeset 88988 in webkit


Ignore:
Timestamp:
Jun 15, 2011, 6:17:46 PM (14 years ago)
Author:
Darin Adler
Message:

2011-06-15 Darin Adler <Darin Adler>

Reviewed by Adam Barth.

Remove obsolete LOOSE_OWN_PTR code
https://bugs.webkit.org/show_bug.cgi?id=59909

The internal Apple dependency on this is gone now.

  • wtf/OwnArrayPtr.h: Removed constructor that takes a raw pointer, set function that takes a raw pointer.
  • wtf/OwnPtr.h: Removed constructor that takes a raw pointer, set functino that takes a raw pointer.
  • wtf/PassOwnArrayPtr.h: Made constructor that takes a nullptr and assignment operator that takes a nullptr unconditional. Made constructor that takes a raw pointer private and explicit, and removed assignment operator that takes a raw pointer.
  • wtf/PassOwnPtr.h: Made assignment operator that takes a nullptr unconditional. Made constructor that takes a raw pointer private and explicit, and removed assignment operator that takes a raw pointer.

2011-06-15 Darin Adler <Darin Adler>

Reviewed by Adam Barth.

Remove obsolete LOOSE_OWN_PTR code
https://bugs.webkit.org/show_bug.cgi?id=59909

  • src/StorageAreaProxy.cpp: (WebCore::StorageAreaProxy::StorageAreaProxy): Use adoptPtr instead of LOOSE_OWN_PTR.
  • src/StorageNamespaceProxy.cpp: (WebCore::StorageNamespaceProxy::StorageNamespaceProxy): Ditto.
Location:
trunk/Source
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r88975 r88988  
     12011-06-15  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Adam Barth.
     4
     5        Remove obsolete LOOSE_OWN_PTR code
     6        https://bugs.webkit.org/show_bug.cgi?id=59909
     7
     8        The internal Apple dependency on this is gone now.
     9
     10        * wtf/OwnArrayPtr.h: Removed constructor that takes a raw pointer,
     11        set function that takes a raw pointer.
     12
     13        * wtf/OwnPtr.h: Removed constructor that takes a raw pointer,
     14        set functino that takes a raw pointer.
     15
     16        * wtf/PassOwnArrayPtr.h: Made constructor that takes a nullptr
     17        and assignment operator that takes a nullptr unconditional.
     18        Made constructor that takes a raw pointer private and explicit,
     19        and removed assignment operator that takes a raw pointer.
     20
     21        * wtf/PassOwnPtr.h: Made assignment operator that takes a nullptr
     22        unconditional. Made constructor that takes a raw pointer private
     23        and explicit, and removed assignment operator that takes a raw pointer.
     24
    1252011-06-15  Sam Weinig  <sam@webkit.org>
    226
  • trunk/Source/JavaScriptCore/wtf/OwnArrayPtr.h

    r79955 r88988  
    7777    void swap(OwnArrayPtr& o) { std::swap(m_ptr, o.m_ptr); }
    7878
    79 #ifdef LOOSE_OWN_ARRAY_PTR
    80     explicit OwnArrayPtr(PtrType ptr) : m_ptr(ptr) { }
    81     void set(PtrType);
    82 #endif
    83 
    8479private:
    8580    PtrType m_ptr;
     
    111106    return ptr;
    112107}
    113 
    114 #ifdef LOOSE_OWN_ARRAY_PTR
    115 template<typename T> inline void OwnArrayPtr<T>::set(PtrType ptr)
    116 {
    117     ASSERT(!ptr || m_ptr != ptr);
    118     PtrType oldPtr = m_ptr;
    119     m_ptr = ptr;
    120     deleteOwnedArrayPtr(oldPtr);
    121 }
    122 #endif
    123108
    124109template<typename T> inline OwnArrayPtr<T>& OwnArrayPtr<T>::operator=(const PassOwnArrayPtr<T>& o)
  • trunk/Source/JavaScriptCore/wtf/OwnPtr.h

    r85749 r88988  
    7575        void swap(OwnPtr& o) { std::swap(m_ptr, o.m_ptr); }
    7676
    77 #ifdef LOOSE_OWN_PTR
    78         explicit OwnPtr(PtrType ptr) : m_ptr(ptr) { }
    79         void set(PtrType);
    80 #endif
    81 
    8277    private:
    8378        OwnPtr& operator=(const OwnPtr<T>&);
     
    118113        return ptr;
    119114    }
    120 
    121 #ifdef LOOSE_OWN_PTR
    122     template<typename T> inline void OwnPtr<T>::set(PtrType ptr)
    123     {
    124         ASSERT(!ptr || m_ptr != ptr);
    125         PtrType oldPtr = m_ptr;
    126         m_ptr = ptr;
    127         deleteOwnedPtr(oldPtr);
    128     }
    129 #endif
    130115
    131116    template<typename T> inline OwnPtr<T>& OwnPtr<T>::operator=(const PassOwnPtr<T>& o)
  • trunk/Source/JavaScriptCore/wtf/PassOwnArrayPtr.h

    r80328 r88988  
    4343
    4444    PassOwnArrayPtr() : m_ptr(0) { }
    45 
    46 #if !defined(LOOSE_PASS_OWN_PTR) || !HAVE(NULLPTR)
    4745    PassOwnArrayPtr(std::nullptr_t) : m_ptr(0) { }
    48 #endif
    4946
    5047    // It somewhat breaks the type system to allow transfer of ownership out of
     
    7572
    7673    PassOwnArrayPtr& operator=(const PassOwnArrayPtr<T>&);
    77 #if !defined(LOOSE_PASS_OWN_ARRAY_PTR) || !HAVE(NULLPTR)
    7874    PassOwnArrayPtr& operator=(std::nullptr_t) { clear(); return *this; }
    79 #endif
    8075    template<typename U> PassOwnArrayPtr& operator=(const PassOwnArrayPtr<U>&);
    8176
    8277    template<typename U> friend PassOwnArrayPtr<U> adoptArrayPtr(U*);
    8378
    84 #ifdef LOOSE_PASS_OWN_ARRAY_PTR
    85     PassOwnArrayPtr(PtrType ptr) : m_ptr(ptr) { }
    86     PassOwnArrayPtr& operator=(PtrType);
    87 #endif
    88 
    8979private:
    90 #ifndef LOOSE_PASS_OWN_ARRAY_PTR
    9180    explicit PassOwnArrayPtr(PtrType ptr) : m_ptr(ptr) { }
    92 #endif
    9381
    9482    mutable PtrType m_ptr;
     
    10896    return ptr;
    10997}
    110 
    111 #ifdef LOOSE_PASS_OWN_ARRAY_PTR
    112 template<typename T> inline PassOwnArrayPtr<T>& PassOwnArrayPtr<T>::operator=(PtrType optr)
    113 {
    114     PtrType ptr = m_ptr;
    115     m_ptr = optr;
    116     ASSERT(!ptr || m_ptr != ptr);
    117     if (ptr)
    118         deleteOwnedArrayPtr(ptr);
    119     return *this;
    120 }
    121 #endif
    12298
    12399template<typename T> inline PassOwnArrayPtr<T>& PassOwnArrayPtr<T>::operator=(const PassOwnArrayPtr<T>& optr)
  • trunk/Source/JavaScriptCore/wtf/PassOwnPtr.h

    r87048 r88988  
    7171
    7272        PassOwnPtr& operator=(const PassOwnPtr<T>&);
    73 #if !defined(LOOSE_PASS_OWN_PTR) || !HAVE(NULLPTR)
    7473        PassOwnPtr& operator=(std::nullptr_t) { clear(); return *this; }
    75 #endif
    7674        template<typename U> PassOwnPtr& operator=(const PassOwnPtr<U>&);
    7775
    7876        template<typename U> friend PassOwnPtr<U> adoptPtr(U*);
    7977
    80 #ifdef LOOSE_PASS_OWN_PTR
    81         PassOwnPtr(PtrType ptr) : m_ptr(ptr) { }
    82         PassOwnPtr& operator=(PtrType);
    83 #endif
    84 
    8578    private:
    86 #ifndef LOOSE_PASS_OWN_PTR
    8779        explicit PassOwnPtr(PtrType ptr) : m_ptr(ptr) { }
    88 #endif
    8980
    9081        // We should never have two OwnPtrs for the same underlying object (otherwise we'll get
     
    112103    }
    113104
    114 #ifdef LOOSE_PASS_OWN_PTR
    115     template<typename T> inline PassOwnPtr<T>& PassOwnPtr<T>::operator=(PtrType optr)
    116     {
    117         PtrType ptr = m_ptr;
    118         m_ptr = optr;
    119         ASSERT(!ptr || m_ptr != ptr);
    120         if (ptr)
    121             deleteOwnedPtr(ptr);
    122         return *this;
    123     }
    124 #endif
    125 
    126105    template<typename T> inline PassOwnPtr<T>& PassOwnPtr<T>::operator=(const PassOwnPtr<T>& optr)
    127106    {
  • trunk/Source/WebKit/chromium/ChangeLog

    r88943 r88988  
     12011-06-15  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Adam Barth.
     4
     5        Remove obsolete LOOSE_OWN_PTR code
     6        https://bugs.webkit.org/show_bug.cgi?id=59909
     7
     8        * src/StorageAreaProxy.cpp:
     9        (WebCore::StorageAreaProxy::StorageAreaProxy): Use adoptPtr
     10        instead of LOOSE_OWN_PTR.
     11        * src/StorageNamespaceProxy.cpp:
     12        (WebCore::StorageNamespaceProxy::StorageNamespaceProxy): Ditto.
     13
    1142011-06-15  Andrey Kosyakov  <caseq@chromium.org>
    215
  • trunk/Source/WebKit/chromium/src/StorageAreaProxy.cpp

    r87597 r88988  
    2626
    2727#include "config.h"
    28 
    29 // FIXME: Remove this define!
    30 #define LOOSE_OWN_PTR
    31 
    3228#include "StorageAreaProxy.h"
    3329
     
    5450namespace WebCore {
    5551
     52// FIXME: storageArea argument should be a PassOwnPtr.
    5653StorageAreaProxy::StorageAreaProxy(WebKit::WebStorageArea* storageArea, StorageType storageType)
    57     : m_storageArea(storageArea)
     54    : m_storageArea(adoptPtr(storageArea))
    5855    , m_storageType(storageType)
    5956{
  • trunk/Source/WebKit/chromium/src/StorageNamespaceProxy.cpp

    r85823 r88988  
    2525
    2626#include "config.h"
    27 
    28 // FIXME: Remove this define!
    29 #define LOOSE_OWN_PTR
    30 
    3127#include "StorageNamespaceProxy.h"
    3228
     
    5854}
    5955
     56// FIXME: storageNamespace argument should be a PassOwnPtr.
    6057StorageNamespaceProxy::StorageNamespaceProxy(WebKit::WebStorageNamespace* storageNamespace, StorageType storageType)
    61     : m_storageNamespace(storageNamespace)
     58    : m_storageNamespace(adoptPtr(storageNamespace))
    6259    , m_storageType(storageType)
    6360{
Note: See TracChangeset for help on using the changeset viewer.