| 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 38dd9c9622bed23b92e1f44af1c45f80736a3c99..7285b6cc00c971b63e86dfe2b0a078d30d633222 100644
|
| --- a/third_party/WebKit/Source/wtf/PassRefPtr.h
|
| +++ b/third_party/WebKit/Source/wtf/PassRefPtr.h
|
| @@ -81,11 +81,7 @@ public:
|
| T* operator->() const { return m_ptr; }
|
|
|
| bool operator!() 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; }
|
| + explicit operator bool() const { return m_ptr; }
|
|
|
| friend PassRefPtr adoptRef<T>(T*);
|
|
|
| @@ -142,6 +138,16 @@ template <typename T, typename U> inline bool operator==(T* a, const PassRefPtr<
|
| 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();
|
| @@ -167,6 +173,16 @@ template <typename T, typename U> inline bool operator!=(T* a, const PassRefPtr<
|
| 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);
|
|
|