| Index: third_party/WebKit/Source/wtf/RefPtr.h
|
| diff --git a/third_party/WebKit/Source/wtf/RefPtr.h b/third_party/WebKit/Source/wtf/RefPtr.h
|
| index c6b28fa72555e1e21bf744db89a969596127da1d..6dca0985aac0db86f39a9e777cc190ba2989d457 100644
|
| --- a/third_party/WebKit/Source/wtf/RefPtr.h
|
| +++ b/third_party/WebKit/Source/wtf/RefPtr.h
|
| @@ -70,7 +70,7 @@ class RefPtr {
|
| ALWAYS_INLINE ~RefPtr() { derefIfNotNull(m_ptr); }
|
|
|
| ALWAYS_INLINE T* get() const { return m_ptr; }
|
| -
|
| + T* leakRef() WARN_UNUSED_RESULT;
|
| void clear();
|
| PassRefPtr<T> release() {
|
| PassRefPtr<T> tmp = adoptRef(m_ptr);
|
| @@ -111,6 +111,13 @@ inline RefPtr<T>::RefPtr(const PassRefPtr<U>& o,
|
| : m_ptr(o.leakRef()) {}
|
|
|
| template <typename T>
|
| +inline T* RefPtr<T>::leakRef() {
|
| + T* ptr = m_ptr;
|
| + m_ptr = nullptr;
|
| + return ptr;
|
| +}
|
| +
|
| +template <typename T>
|
| inline void RefPtr<T>::clear() {
|
| T* ptr = m_ptr;
|
| m_ptr = nullptr;
|
|
|