Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1190)

Unified Diff: Source/heap/Handle.h

Issue 216523002: Oilpan: Replace most of RefPtrs for Event objects with oilpan's transition types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/heap/Handle.h
diff --git a/Source/heap/Handle.h b/Source/heap/Handle.h
index 4025e95e89f2779d2529fd4a925d7d9bb3799fca..bf88b831d075768389ea9e9a5cfb8d1ddcaf7908 100644
--- a/Source/heap/Handle.h
+++ b/Source/heap/Handle.h
@@ -35,6 +35,7 @@
#include "heap/ThreadState.h"
#include "heap/Visitor.h"
+#include "wtf/HashFunctions.h"
#include "wtf/Locker.h"
#include "wtf/RawPtr.h"
#include "wtf/RefCounted.h"
@@ -884,6 +885,15 @@ template<typename T> struct PtrHash<WebCore::Member<T> > : PtrHash<T*> {
template<typename T> struct PtrHash<WebCore::WeakMember<T> > : PtrHash<WebCore::Member<T> > {
};
+template<typename P> struct PtrHash<WebCore::Persistent<P> > : PtrHash<P*> {
+ using PtrHash<P*>::hash;
+ static unsigned hash(const RefPtr<P>& key) { return hash(key.get()); }
+ using PtrHash<P*>::equal;
+ static bool equal(const RefPtr<P>& a, const RefPtr<P>& b) { return a == b; }
+ static bool equal(P* a, const RefPtr<P>& b) { return a == b; }
+ static bool equal(const RefPtr<P>& a, P* b) { return a == b; }
+};
+
// PtrHash is the default hash for hash tables with members.
template<typename T> struct DefaultHash<WebCore::Member<T> > {
typedef PtrHash<WebCore::Member<T> > Hash;
@@ -893,6 +903,10 @@ template<typename T> struct DefaultHash<WebCore::WeakMember<T> > {
typedef PtrHash<WebCore::WeakMember<T> > Hash;
};
+template<typename T> struct DefaultHash<WebCore::Persistent<T> > {
+ typedef PtrHash<WebCore::Persistent<T> > Hash;
+};
+
template<typename T>
struct NeedsTracing<WebCore::Member<T> > {
static const bool value = true;

Powered by Google App Engine
This is Rietveld 408576698