Changeset 65130 in webkit for trunk/JavaScriptCore/wtf/PassRefPtr.h
- Timestamp:
- Aug 11, 2010, 12:08:23 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/PassRefPtr.h
r63562 r65130 68 68 // a const PassRefPtr. However, it makes it much easier to work with PassRefPtr 69 69 // 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()) { } 72 72 73 73 ALWAYS_INLINE ~PassRefPtr() { derefIfNotNull(m_ptr); } … … 107 107 108 108 // 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() 110 110 // or clear(). 111 111 … … 131 131 132 132 NonNullPassRefPtr(const NonNullPassRefPtr& o) 133 : m_ptr(o. releaseRef())133 : m_ptr(o.leakRef()) 134 134 { 135 135 ASSERT(m_ptr); … … 137 137 138 138 template<typename U> NonNullPassRefPtr(const NonNullPassRefPtr<U>& o) 139 : m_ptr(o. releaseRef())139 : m_ptr(o.leakRef()) 140 140 { 141 141 ASSERT(m_ptr); … … 143 143 144 144 template<typename U> NonNullPassRefPtr(const PassRefPtr<U>& o) 145 : m_ptr(o. releaseRef())145 : m_ptr(o.leakRef()) 146 146 { 147 147 ASSERT(m_ptr); … … 208 208 { 209 209 T* ptr = m_ptr; 210 m_ptr = ref. releaseRef();210 m_ptr = ref.leakRef(); 211 211 derefIfNotNull(ptr); 212 212 return *this; … … 216 216 { 217 217 T* ptr = m_ptr; 218 m_ptr = ref. releaseRef();218 m_ptr = ref.leakRef(); 219 219 derefIfNotNull(ptr); 220 220 return *this; … … 279 279 template<typename T, typename U> inline PassRefPtr<T> static_pointer_cast(const PassRefPtr<U>& p) 280 280 { 281 return adoptRef(static_cast<T*>(p. releaseRef()));281 return adoptRef(static_cast<T*>(p.leakRef())); 282 282 } 283 283 284 284 template<typename T, typename U> inline PassRefPtr<T> const_pointer_cast(const PassRefPtr<U>& p) 285 285 { 286 return adoptRef(const_cast<T*>(p. releaseRef()));286 return adoptRef(const_cast<T*>(p.leakRef())); 287 287 } 288 288
Note:
See TracChangeset
for help on using the changeset viewer.