| Index: third_party/WebKit/Source/wtf/RefPtr.h
|
| diff --git a/third_party/WebKit/Source/wtf/RefPtr.h b/third_party/WebKit/Source/wtf/RefPtr.h
|
| index 4ed3ea5de07c16ca00103e0044387d07421dbaef..eab641a66509aeca93b469c0f35c46e30c7ac44b 100644
|
| --- a/third_party/WebKit/Source/wtf/RefPtr.h
|
| +++ b/third_party/WebKit/Source/wtf/RefPtr.h
|
| @@ -71,10 +71,9 @@ public:
|
|
|
| bool operator!() const { return !m_ptr; }
|
|
|
| - // This conversion operator allows implicit conversion to bool but not to
|
| - // other integer types.
|
| - typedef T* (RefPtr::*UnspecifiedBoolType);
|
| - operator UnspecifiedBoolType() const { return m_ptr ? &RefPtr::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 ? &RefPtr::m_ptr : 0; }
|
|
|
| RefPtr& operator=(RefPtr o) { swap(o); return *this; }
|
| RefPtr& operator=(std::nullptr_t) { clear(); return *this; }
|
| @@ -135,6 +134,16 @@ template <typename T, typename U> inline bool operator==(T* a, const RefPtr<U>&
|
| return a == b.get();
|
| }
|
|
|
| +template <typename T> inline bool operator==(const RefPtr<T>& a, std::nullptr_t)
|
| +{
|
| + return !a.get();
|
| +}
|
| +
|
| +template <typename T> inline bool operator==(std::nullptr_t, const RefPtr<T>& b)
|
| +{
|
| + return !b.get();
|
| +}
|
| +
|
| template <typename T, typename U> inline bool operator!=(const RefPtr<T>& a, const RefPtr<U>& b)
|
| {
|
| return a.get() != b.get();
|
| @@ -150,6 +159,16 @@ template <typename T, typename U> inline bool operator!=(T* a, const RefPtr<U>&
|
| return a != b.get();
|
| }
|
|
|
| +template <typename T> inline bool operator!=(const RefPtr<T>& a, std::nullptr_t)
|
| +{
|
| + return a.get();
|
| +}
|
| +
|
| +template <typename T> inline bool operator!=(std::nullptr_t, const RefPtr<T>& b)
|
| +{
|
| + return b.get();
|
| +}
|
| +
|
| template <typename T, typename U> inline RefPtr<T> static_pointer_cast(const RefPtr<U>& p)
|
| {
|
| return RefPtr<T>(static_cast<T*>(p.get()));
|
|
|