Changeset 88988 in webkit
- Timestamp:
- Jun 15, 2011, 6:17:46 PM (14 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r88975 r88988 1 2011-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 1 25 2011-06-15 Sam Weinig <sam@webkit.org> 2 26 -
trunk/Source/JavaScriptCore/wtf/OwnArrayPtr.h
r79955 r88988 77 77 void swap(OwnArrayPtr& o) { std::swap(m_ptr, o.m_ptr); } 78 78 79 #ifdef LOOSE_OWN_ARRAY_PTR80 explicit OwnArrayPtr(PtrType ptr) : m_ptr(ptr) { }81 void set(PtrType);82 #endif83 84 79 private: 85 80 PtrType m_ptr; … … 111 106 return ptr; 112 107 } 113 114 #ifdef LOOSE_OWN_ARRAY_PTR115 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 #endif123 108 124 109 template<typename T> inline OwnArrayPtr<T>& OwnArrayPtr<T>::operator=(const PassOwnArrayPtr<T>& o) -
trunk/Source/JavaScriptCore/wtf/OwnPtr.h
r85749 r88988 75 75 void swap(OwnPtr& o) { std::swap(m_ptr, o.m_ptr); } 76 76 77 #ifdef LOOSE_OWN_PTR78 explicit OwnPtr(PtrType ptr) : m_ptr(ptr) { }79 void set(PtrType);80 #endif81 82 77 private: 83 78 OwnPtr& operator=(const OwnPtr<T>&); … … 118 113 return ptr; 119 114 } 120 121 #ifdef LOOSE_OWN_PTR122 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 #endif130 115 131 116 template<typename T> inline OwnPtr<T>& OwnPtr<T>::operator=(const PassOwnPtr<T>& o) -
trunk/Source/JavaScriptCore/wtf/PassOwnArrayPtr.h
r80328 r88988 43 43 44 44 PassOwnArrayPtr() : m_ptr(0) { } 45 46 #if !defined(LOOSE_PASS_OWN_PTR) || !HAVE(NULLPTR)47 45 PassOwnArrayPtr(std::nullptr_t) : m_ptr(0) { } 48 #endif49 46 50 47 // It somewhat breaks the type system to allow transfer of ownership out of … … 75 72 76 73 PassOwnArrayPtr& operator=(const PassOwnArrayPtr<T>&); 77 #if !defined(LOOSE_PASS_OWN_ARRAY_PTR) || !HAVE(NULLPTR)78 74 PassOwnArrayPtr& operator=(std::nullptr_t) { clear(); return *this; } 79 #endif80 75 template<typename U> PassOwnArrayPtr& operator=(const PassOwnArrayPtr<U>&); 81 76 82 77 template<typename U> friend PassOwnArrayPtr<U> adoptArrayPtr(U*); 83 78 84 #ifdef LOOSE_PASS_OWN_ARRAY_PTR85 PassOwnArrayPtr(PtrType ptr) : m_ptr(ptr) { }86 PassOwnArrayPtr& operator=(PtrType);87 #endif88 89 79 private: 90 #ifndef LOOSE_PASS_OWN_ARRAY_PTR91 80 explicit PassOwnArrayPtr(PtrType ptr) : m_ptr(ptr) { } 92 #endif93 81 94 82 mutable PtrType m_ptr; … … 108 96 return ptr; 109 97 } 110 111 #ifdef LOOSE_PASS_OWN_ARRAY_PTR112 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 #endif122 98 123 99 template<typename T> inline PassOwnArrayPtr<T>& PassOwnArrayPtr<T>::operator=(const PassOwnArrayPtr<T>& optr) -
trunk/Source/JavaScriptCore/wtf/PassOwnPtr.h
r87048 r88988 71 71 72 72 PassOwnPtr& operator=(const PassOwnPtr<T>&); 73 #if !defined(LOOSE_PASS_OWN_PTR) || !HAVE(NULLPTR)74 73 PassOwnPtr& operator=(std::nullptr_t) { clear(); return *this; } 75 #endif76 74 template<typename U> PassOwnPtr& operator=(const PassOwnPtr<U>&); 77 75 78 76 template<typename U> friend PassOwnPtr<U> adoptPtr(U*); 79 77 80 #ifdef LOOSE_PASS_OWN_PTR81 PassOwnPtr(PtrType ptr) : m_ptr(ptr) { }82 PassOwnPtr& operator=(PtrType);83 #endif84 85 78 private: 86 #ifndef LOOSE_PASS_OWN_PTR87 79 explicit PassOwnPtr(PtrType ptr) : m_ptr(ptr) { } 88 #endif89 80 90 81 // We should never have two OwnPtrs for the same underlying object (otherwise we'll get … … 112 103 } 113 104 114 #ifdef LOOSE_PASS_OWN_PTR115 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 #endif125 126 105 template<typename T> inline PassOwnPtr<T>& PassOwnPtr<T>::operator=(const PassOwnPtr<T>& optr) 127 106 { -
trunk/Source/WebKit/chromium/ChangeLog
r88943 r88988 1 2011-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 1 14 2011-06-15 Andrey Kosyakov <caseq@chromium.org> 2 15 -
trunk/Source/WebKit/chromium/src/StorageAreaProxy.cpp
r87597 r88988 26 26 27 27 #include "config.h" 28 29 // FIXME: Remove this define!30 #define LOOSE_OWN_PTR31 32 28 #include "StorageAreaProxy.h" 33 29 … … 54 50 namespace WebCore { 55 51 52 // FIXME: storageArea argument should be a PassOwnPtr. 56 53 StorageAreaProxy::StorageAreaProxy(WebKit::WebStorageArea* storageArea, StorageType storageType) 57 : m_storageArea( storageArea)54 : m_storageArea(adoptPtr(storageArea)) 58 55 , m_storageType(storageType) 59 56 { -
trunk/Source/WebKit/chromium/src/StorageNamespaceProxy.cpp
r85823 r88988 25 25 26 26 #include "config.h" 27 28 // FIXME: Remove this define!29 #define LOOSE_OWN_PTR30 31 27 #include "StorageNamespaceProxy.h" 32 28 … … 58 54 } 59 55 56 // FIXME: storageNamespace argument should be a PassOwnPtr. 60 57 StorageNamespaceProxy::StorageNamespaceProxy(WebKit::WebStorageNamespace* storageNamespace, StorageType storageType) 61 : m_storageNamespace( storageNamespace)58 : m_storageNamespace(adoptPtr(storageNamespace)) 62 59 , m_storageType(storageType) 63 60 {
Note:
See TracChangeset
for help on using the changeset viewer.