| Index: third_party/WebKit/Source/wtf/PassRefPtr.h
|
| diff --git a/third_party/WebKit/Source/wtf/PassRefPtr.h b/third_party/WebKit/Source/wtf/PassRefPtr.h
|
| index 7285b6cc00c971b63e86dfe2b0a078d30d633222..38dd9c9622bed23b92e1f44af1c45f80736a3c99 100644
|
| --- a/third_party/WebKit/Source/wtf/PassRefPtr.h
|
| +++ b/third_party/WebKit/Source/wtf/PassRefPtr.h
|
| @@ -81,7 +81,11 @@
|
| T* operator->() const { return m_ptr; }
|
|
|
| bool operator!() const { return !m_ptr; }
|
| - explicit operator bool() const { return m_ptr; }
|
| +
|
| + // This conversion operator allows implicit conversion to bool but not to
|
| + // other integer types.
|
| + typedef T* (PassRefPtr::*UnspecifiedBoolType);
|
| + operator UnspecifiedBoolType() const { return m_ptr ? &PassRefPtr::m_ptr : 0; }
|
|
|
| friend PassRefPtr adoptRef<T>(T*);
|
|
|
| @@ -138,16 +142,6 @@
|
| return a == b.get();
|
| }
|
|
|
| -template <typename T> inline bool operator==(const PassRefPtr<T>& a, std::nullptr_t)
|
| -{
|
| - return !a.get();
|
| -}
|
| -
|
| -template <typename T> inline bool operator==(std::nullptr_t, const PassRefPtr<T>& b)
|
| -{
|
| - return !b.get();
|
| -}
|
| -
|
| template <typename T, typename U> inline bool operator!=(const PassRefPtr<T>& a, const PassRefPtr<U>& b)
|
| {
|
| return a.get() != b.get();
|
| @@ -173,16 +167,6 @@
|
| return a != b.get();
|
| }
|
|
|
| -template <typename T> inline bool operator!=(const PassRefPtr<T>& a, std::nullptr_t)
|
| -{
|
| - return a.get();
|
| -}
|
| -
|
| -template <typename T> inline bool operator!=(std::nullptr_t, const PassRefPtr<T>& b)
|
| -{
|
| - return b.get();
|
| -}
|
| -
|
| template <typename T> PassRefPtr<T> adoptRef(T* p)
|
| {
|
| adopted(p);
|
|
|