Index: third_party/WebKit/Source/wtf/WeakPtr.h |
diff --git a/third_party/WebKit/Source/wtf/WeakPtr.h b/third_party/WebKit/Source/wtf/WeakPtr.h |
index 5b790e4055a5880e374d02f88fb56bc048eab843..69a800a761e2dff26f2038c37303466a8b08e303 100644 |
--- a/third_party/WebKit/Source/wtf/WeakPtr.h |
+++ b/third_party/WebKit/Source/wtf/WeakPtr.h |
@@ -31,30 +31,34 @@ |
namespace WTF { |
-template<typename T> |
-using WeakPtr = base::WeakPtr<T>; |
+template <typename T, typename Traits = base::DefaultWeakPtrTraits> |
+using WeakPtr = base::WeakPtr<T, Traits>; |
+ |
+template <typename T, typename Traits = base::DefaultWeakPtrTraits> |
+class WeakPtrFactory : public base::WeakPtrFactory<T, Traits> { |
+ WTF_MAKE_NONCOPYABLE(WeakPtrFactory); |
+ DISALLOW_NEW(); |
+ |
+private: |
+ using Base = base::WeakPtrFactory<T, Traits>; |
-template<typename T> |
-class WeakPtrFactory { |
- WTF_MAKE_NONCOPYABLE(WeakPtrFactory<T>); |
- USING_FAST_MALLOC(WeakPtrFactory); |
public: |
- explicit WeakPtrFactory(T* ptr) : m_factory(ptr) { } |
+ explicit WeakPtrFactory(T* ptr) |
+ : Base(ptr) |
+ { |
+ } |
- WeakPtr<T> createWeakPtr() { return m_factory.GetWeakPtr(); } |
+ WeakPtr<T, Traits> createWeakPtr() { return this->GetWeakPtr(); } |
void revokeAll() |
{ |
- m_factory.InvalidateWeakPtrs(); |
+ this->InvalidateWeakPtrs(); |
} |
bool hasWeakPtrs() const |
{ |
- return m_factory.HasWeakPtrs(); |
+ return this->HasWeakPtrs(); |
} |
- |
-private: |
- base::WeakPtrFactory<T> m_factory; |
}; |
} // namespace WTF |