| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 template<typename T, typename U> inline bool operator==(const PassRefPtr<T>&
a, U* b) | 131 template<typename T, typename U> inline bool operator==(const PassRefPtr<T>&
a, U* b) |
| 132 { | 132 { |
| 133 return a.get() == b; | 133 return a.get() == b; |
| 134 } | 134 } |
| 135 | 135 |
| 136 template<typename T, typename U> inline bool operator==(T* a, const PassRefP
tr<U>& b) | 136 template<typename T, typename U> inline bool operator==(T* a, const PassRefP
tr<U>& b) |
| 137 { | 137 { |
| 138 return a == b.get(); | 138 return a == b.get(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 template<typename T, typename U> inline bool operator==(const PassRefPtr<T>&
a, const RawPtr<U>& b) |
| 142 { |
| 143 return a.get() == b.get(); |
| 144 } |
| 145 |
| 146 template<typename T, typename U> inline bool operator==(const RawPtr<T>& a,
const PassRefPtr<U>& b) |
| 147 { |
| 148 return a.get() == b.get(); |
| 149 } |
| 150 |
| 141 template<typename T, typename U> inline bool operator!=(const PassRefPtr<T>&
a, const PassRefPtr<U>& b) | 151 template<typename T, typename U> inline bool operator!=(const PassRefPtr<T>&
a, const PassRefPtr<U>& b) |
| 142 { | 152 { |
| 143 return a.get() != b.get(); | 153 return a.get() != b.get(); |
| 144 } | 154 } |
| 145 | 155 |
| 146 template<typename T, typename U> inline bool operator!=(const PassRefPtr<T>&
a, const RefPtr<U>& b) | 156 template<typename T, typename U> inline bool operator!=(const PassRefPtr<T>&
a, const RefPtr<U>& b) |
| 147 { | 157 { |
| 148 return a.get() != b.get(); | 158 return a.get() != b.get(); |
| 149 } | 159 } |
| 150 | 160 |
| 151 template<typename T, typename U> inline bool operator!=(const RefPtr<T>& a,
const PassRefPtr<U>& b) | 161 template<typename T, typename U> inline bool operator!=(const RefPtr<T>& a,
const PassRefPtr<U>& b) |
| 152 { | 162 { |
| 153 return a.get() != b.get(); | 163 return a.get() != b.get(); |
| 154 } | 164 } |
| 155 | 165 |
| 156 template<typename T, typename U> inline bool operator!=(const PassRefPtr<T>&
a, U* b) | 166 template<typename T, typename U> inline bool operator!=(const PassRefPtr<T>&
a, U* b) |
| 157 { | 167 { |
| 158 return a.get() != b; | 168 return a.get() != b; |
| 159 } | 169 } |
| 160 | 170 |
| 161 template<typename T, typename U> inline bool operator!=(T* a, const PassRefP
tr<U>& b) | 171 template<typename T, typename U> inline bool operator!=(T* a, const PassRefP
tr<U>& b) |
| 162 { | 172 { |
| 163 return a != b.get(); | 173 return a != b.get(); |
| 164 } | 174 } |
| 165 | 175 |
| 176 template<typename T, typename U> inline bool operator!=(const PassRefPtr<T>&
a, const RawPtr<U>& b) |
| 177 { |
| 178 return a.get() != b.get(); |
| 179 } |
| 180 |
| 181 template<typename T, typename U> inline bool operator!=(const RawPtr<T>& a,
const PassRefPtr<U>& b) |
| 182 { |
| 183 return a.get() != b.get(); |
| 184 } |
| 185 |
| 166 template<typename T> inline PassRefPtr<T> adoptRef(T* p) | 186 template<typename T> inline PassRefPtr<T> adoptRef(T* p) |
| 167 { | 187 { |
| 168 adopted(p); | 188 adopted(p); |
| 169 return PassRefPtr<T>(p, PassRefPtr<T>::AdoptRef); | 189 return PassRefPtr<T>(p, PassRefPtr<T>::AdoptRef); |
| 170 } | 190 } |
| 171 | 191 |
| 172 template<typename T, typename U> inline PassRefPtr<T> static_pointer_cast(co
nst PassRefPtr<U>& p) | 192 template<typename T, typename U> inline PassRefPtr<T> static_pointer_cast(co
nst PassRefPtr<U>& p) |
| 173 { | 193 { |
| 174 return adoptRef(static_cast<T*>(p.leakRef())); | 194 return adoptRef(static_cast<T*>(p.leakRef())); |
| 175 } | 195 } |
| 176 | 196 |
| 177 template<typename T> inline T* getPtr(const PassRefPtr<T>& p) | 197 template<typename T> inline T* getPtr(const PassRefPtr<T>& p) |
| 178 { | 198 { |
| 179 return p.get(); | 199 return p.get(); |
| 180 } | 200 } |
| 181 | 201 |
| 182 } // namespace WTF | 202 } // namespace WTF |
| 183 | 203 |
| 184 using WTF::PassRefPtr; | 204 using WTF::PassRefPtr; |
| 185 using WTF::adoptRef; | 205 using WTF::adoptRef; |
| 186 using WTF::static_pointer_cast; | 206 using WTF::static_pointer_cast; |
| 187 | 207 |
| 188 #endif // WTF_PassRefPtr_h | 208 #endif // WTF_PassRefPtr_h |
| OLD | NEW |