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 0097b914fe56229596f906da298c79dc80788251..412ec96b97ef01c30c2d63b4206d72e9c5ec935b 100644 |
--- a/third_party/WebKit/Source/wtf/RefPtr.h |
+++ b/third_party/WebKit/Source/wtf/RefPtr.h |
@@ -24,11 +24,16 @@ |
#define WTF_RefPtr_h |
#include "wtf/Allocator.h" |
+#include "wtf/CrossThreadCopier.h" |
#include "wtf/HashTableDeletedValueType.h" |
#include "wtf/PassRefPtr.h" |
+#include "wtf/ThreadSafeRefCounted.h" |
+#include "wtf/TypeTraits.h" |
#include <algorithm> |
#include <utility> |
+class SkRefCnt; |
+ |
namespace WTF { |
template <typename T> class PassRefPtr; |
@@ -86,6 +91,12 @@ private: |
}; |
template <typename T> |
+struct CrossThreadCopier<RefPtr<T>> : public CrossThreadCopierPassThrough<RefPtr<T>> { |
+ STATIC_ONLY(CrossThreadCopier); |
+ static_assert(IsSubclassOfTemplate<T, ThreadSafeRefCounted>::value || std::is_base_of<SkRefCnt, T>::value, "RefPtr<T> can be passed across threads only if T is ThreadSafeRefCounted or SkRefCnt."); |
+}; |
+ |
+template <typename T> |
template <typename U> inline RefPtr<T>::RefPtr(const PassRefPtr<U>& o, EnsurePtrConvertibleArgDefn(U, T)) |
: m_ptr(o.leakRef()) |
{ |