Index: third_party/WebKit/Source/wtf/HashTraits.h |
diff --git a/third_party/WebKit/Source/wtf/HashTraits.h b/third_party/WebKit/Source/wtf/HashTraits.h |
index 3ddd834e2995c00ef327ecec85f9cbbfb1d55ffe..bd8f8c9d7bc9e8c40d21d46fb4b5017a4737b31c 100644 |
--- a/third_party/WebKit/Source/wtf/HashTraits.h |
+++ b/third_party/WebKit/Source/wtf/HashTraits.h |
@@ -155,6 +155,23 @@ template <typename T> struct SimpleClassHashTraits : GenericHashTraits<T> { |
static bool isDeletedValue(const T& value) { return value.isHashTableDeletedValue(); } |
}; |
+template <typename P> struct HashTraits<OwnPtr<P>> : SimpleClassHashTraits<OwnPtr<P>> { |
+ typedef std::nullptr_t EmptyValueType; |
+ |
+ static EmptyValueType emptyValue() { return nullptr; } |
+ |
+ static const bool hasIsEmptyValueFunction = true; |
+ static bool isEmptyValue(const OwnPtr<P>& value) { return !value; } |
+ |
+ typedef typename OwnPtr<P>::PtrType PeekInType; |
+ |
+ static void store(PassOwnPtr<P> value, OwnPtr<P>& storage) { storage = std::move(value); } |
+ |
+ typedef typename OwnPtr<P>::PtrType PeekOutType; |
+ static PeekOutType peek(const OwnPtr<P>& value) { return value.get(); } |
+ static PeekOutType peek(std::nullptr_t) { return 0; } |
+}; |
+ |
template <typename P> struct HashTraits<RefPtr<P>> : SimpleClassHashTraits<RefPtr<P>> { |
typedef std::nullptr_t EmptyValueType; |
static EmptyValueType emptyValue() { return nullptr; } |