Lines Matching defs:PassOwnPtr

34 // Remove this once we make all WebKit code compatible with stricter rules about PassOwnPtr.
39 // Unlike most of our smart pointers, PassOwnPtr can take either the pointer type or the pointed-to type.
42 template<typename T> class PassOwnPtr;
43 template<typename T> PassOwnPtr<T> adoptPtr(T*);
45 template<typename T> class PassOwnPtr {
50 PassOwnPtr() : m_ptr(0) { }
53 // a const PassOwnPtr. However, it makes it much easier to work with PassOwnPtr
55 PassOwnPtr(const PassOwnPtr& o) : m_ptr(o.leakPtr()) { }
56 template<typename U> PassOwnPtr(const PassOwnPtr<U>& o) : m_ptr(o.leakPtr()) { }
58 ~PassOwnPtr() { deleteOwnedPtr(m_ptr); }
71 typedef PtrType PassOwnPtr::*UnspecifiedBoolType;
72 operator UnspecifiedBoolType() const { return m_ptr ? &PassOwnPtr::m_ptr : 0; }
74 PassOwnPtr& operator=(const PassOwnPtr<T>&);
76 PassOwnPtr& operator=(std::nullptr_t) { clear(); return *this; }
78 template<typename U> PassOwnPtr& operator=(const PassOwnPtr<U>&);
80 template<typename U> friend PassOwnPtr<U> adoptPtr(U*);
83 PassOwnPtr(PtrType ptr) : m_ptr(ptr) { }
84 PassOwnPtr& operator=(PtrType);
89 explicit PassOwnPtr(PtrType ptr) : m_ptr(ptr) { }
95 template<typename T> inline void PassOwnPtr<T>::clear()
102 template<typename T> inline typename PassOwnPtr<T>::PtrType PassOwnPtr<T>::leakPtr() const
110 template<typename T> inline PassOwnPtr<T>& PassOwnPtr<T>::operator=(PtrType optr)
121 template<typename T> inline PassOwnPtr<T>& PassOwnPtr<T>::operator=(const PassOwnPtr<T>& optr)
131 template<typename T> template<typename U> inline PassOwnPtr<T>& PassOwnPtr<T>::operator=(const PassOwnPtr<U>& optr)
141 template<typename T, typename U> inline bool operator==(const PassOwnPtr<T>& a, const PassOwnPtr<U>& b)
146 template<typename T, typename U> inline bool operator==(const PassOwnPtr<T>& a, const OwnPtr<U>& b)
151 template<typename T, typename U> inline bool operator==(const OwnPtr<T>& a, const PassOwnPtr<U>& b)
156 template<typename T, typename U> inline bool operator==(const PassOwnPtr<T>& a, U* b)
161 template<typename T, typename U> inline bool operator==(T* a, const PassOwnPtr<U>& b)
166 template<typename T, typename U> inline bool operator!=(const PassOwnPtr<T>& a, const PassOwnPtr<U>& b)
171 template<typename T, typename U> inline bool operator!=(const PassOwnPtr<T>& a, const OwnPtr<U>& b)
176 template<typename T, typename U> inline bool operator!=(const OwnPtr<T>& a, const PassOwnPtr<U>& b)
181 template<typename T, typename U> inline bool operator!=(const PassOwnPtr<T>& a, U* b)
186 template<typename T, typename U> inline bool operator!=(T* a, const PassOwnPtr<U>& b)
191 template<typename T> inline PassOwnPtr<T> adoptPtr(T* ptr)
193 return PassOwnPtr<T>(ptr);
196 template<typename T, typename U> inline PassOwnPtr<T> static_pointer_cast(const PassOwnPtr<U>& p)
201 template<typename T, typename U> inline PassOwnPtr<T> const_pointer_cast(const PassOwnPtr<U>& p)
206 template<typename T> inline T* getPtr(const PassOwnPtr<T>& p)
213 using WTF::PassOwnPtr;