| 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 bd1ee380cfbf2ddb9eb92febda883694a687fd84..48538cd788a66d22bbbe934ef426f31801288f61 100644
|
| --- a/third_party/WebKit/Source/wtf/PassRefPtr.h
|
| +++ b/third_party/WebKit/Source/wtf/PassRefPtr.h
|
| @@ -83,10 +83,9 @@ public:
|
|
|
| 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; }
|
| + // TODO(jbroman): Simplifying this in the obvious way causes a massive
|
| + // regression in a perf test on ARM. http://crbug.com/607208
|
| + explicit operator bool() const { return m_ptr ? &PassRefPtr::m_ptr : 0; }
|
|
|
| friend PassRefPtr adoptRef<T>(T*);
|
|
|
| @@ -149,6 +148,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();
|
| @@ -174,6 +183,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);
|
|
|