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

Unified Diff: Source/wtf/RetainPtr.h

Issue 14698008: Remove RetainPtrObjectHash and RetainPtrObjectHashTraits (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/RetainPtr.h
diff --git a/Source/wtf/RetainPtr.h b/Source/wtf/RetainPtr.h
index 9981a4d988a8a35d4f93dd226b959ec0bbe576c2..09ead690cea597b81ce29dc5c02d6780b7e80163 100644
--- a/Source/wtf/RetainPtr.h
+++ b/Source/wtf/RetainPtr.h
@@ -294,35 +294,8 @@ namespace WTF {
static bool equal(typename RetainPtr<P>::PtrType a, const RetainPtr<P>& b) { return a == b; }
static bool equal(const RetainPtr<P>& a, typename RetainPtr<P>::PtrType b) { return a == b; }
};
-
- template<typename P> struct DefaultHash<RetainPtr<P> > { typedef PtrHash<RetainPtr<P> > Hash; };
-
- template <typename P>
- struct RetainPtrObjectHashTraits : GenericHashTraits<RetainPtr<P> > {
- static const bool emptyValueIsZero = true;
- static const RetainPtr<P>& emptyValue()
- {
- static RetainPtr<P>& null = *(new RetainPtr<P>);
- return null;
- }
- static const bool needsDestruction = true;
- static void constructDeletedValue(RetainPtr<P>& slot) { new (&slot) RetainPtr<P>(HashTableDeletedValue); }
- static bool isDeletedValue(const RetainPtr<P>& value) { return value.isHashTableDeletedValue(); }
- };
- template <typename P>
- struct RetainPtrObjectHash {
- static unsigned hash(const RetainPtr<P>& o)
- {
- ASSERT_WITH_MESSAGE(o.get(), "attempt to use null RetainPtr in HashTable");
- return CFHash(o.get());
- }
- static bool equal(const RetainPtr<P>& a, const RetainPtr<P>& b)
- {
- return CFEqual(a.get(), b.get());
- }
- static const bool safeToCompareToEmptyOrDeleted = false;
- };
+ template<typename P> struct DefaultHash<RetainPtr<P> > { typedef PtrHash<RetainPtr<P> > Hash; };
} // namespace WTF
using WTF::AdoptCF;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698