| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reser
ved. | 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reser
ved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 PassRefPtr& operator=(const PassRefPtr&) | 93 PassRefPtr& operator=(const PassRefPtr&) |
| 94 { | 94 { |
| 95 static_assert(!sizeof(T*), "PassRefPtr should never be assigned to"); | 95 static_assert(!sizeof(T*), "PassRefPtr should never be assigned to"); |
| 96 return *this; | 96 return *this; |
| 97 } | 97 } |
| 98 | 98 |
| 99 mutable T* m_ptr; | 99 mutable T* m_ptr; |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 template <typename T> | 102 template <typename T> |
| 103 PassRefPtr<T> wrapPassRefPtr(T* ptr) |
| 104 { |
| 105 return PassRefPtr<T>(ptr); |
| 106 } |
| 107 |
| 108 template <typename T> |
| 103 template <typename U> inline PassRefPtr<T>::PassRefPtr(const RefPtr<U>& o, Ensur
ePtrConvertibleArgDefn(U, T)) | 109 template <typename U> inline PassRefPtr<T>::PassRefPtr(const RefPtr<U>& o, Ensur
ePtrConvertibleArgDefn(U, T)) |
| 104 : m_ptr(o.get()) | 110 : m_ptr(o.get()) |
| 105 { | 111 { |
| 106 T* ptr = m_ptr; | 112 T* ptr = m_ptr; |
| 107 refIfNotNull(ptr); | 113 refIfNotNull(ptr); |
| 108 } | 114 } |
| 109 | 115 |
| 110 template <typename T> | 116 template <typename T> |
| 111 template <typename U> inline PassRefPtr<T>::PassRefPtr(RefPtr<U>&& o, EnsurePtrC
onvertibleArgDefn(U, T)) | 117 template <typename U> inline PassRefPtr<T>::PassRefPtr(RefPtr<U>&& o, EnsurePtrC
onvertibleArgDefn(U, T)) |
| 112 : m_ptr(o.release().leakRef()) | 118 : m_ptr(o.release().leakRef()) |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 return p.get(); | 212 return p.get(); |
| 207 } | 213 } |
| 208 | 214 |
| 209 } // namespace WTF | 215 } // namespace WTF |
| 210 | 216 |
| 211 using WTF::PassRefPtr; | 217 using WTF::PassRefPtr; |
| 212 using WTF::adoptRef; | 218 using WTF::adoptRef; |
| 213 using WTF::static_pointer_cast; | 219 using WTF::static_pointer_cast; |
| 214 | 220 |
| 215 #endif // WTF_PassRefPtr_h | 221 #endif // WTF_PassRefPtr_h |
| OLD | NEW |