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

Unified Diff: third_party/WebKit/Source/wtf/HashTraits.h

Issue 1968043002: Get rid of 'PassInType' in hash traits and containers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 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 | « third_party/WebKit/Source/wtf/HashTable.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b5154b38ca1d25fbdd78129a345f1c4e34c81fb1..113ebac0035d05d07b3cd842baa0a77d1c8dcb0c 100644
--- a/third_party/WebKit/Source/wtf/HashTraits.h
+++ b/third_party/WebKit/Source/wtf/HashTraits.h
@@ -102,10 +102,7 @@ template <typename T> struct GenericHashTraits : GenericHashTraitsBase<std::is_i
typedef const T& IteratorConstReferenceType;
static IteratorReferenceType getToReferenceConversion(IteratorGetType x) { return *x; }
static IteratorConstReferenceType getToReferenceConstConversion(IteratorConstGetType x) { return *x; }
- // Type for functions that take ownership, such as add.
- // The store function either not be called or called once to store something
- // passed in. The value passed to the store function will be PassInType.
- typedef const T& PassInType;
+
template <typename IncomingValueType>
static void store(IncomingValueType&& value, T& storage) { storage = std::forward<IncomingValueType>(value); }
@@ -164,7 +161,6 @@ template <typename P> struct HashTraits<OwnPtr<P>> : SimpleClassHashTraits<OwnPt
typedef typename OwnPtr<P>::PtrType PeekInType;
- typedef PassOwnPtr<P> PassInType;
static void store(PassOwnPtr<P> value, OwnPtr<P>& storage) { storage = std::move(value); }
typedef typename OwnPtr<P>::PtrType PeekOutType;
@@ -187,7 +183,6 @@ template <typename P> struct HashTraits<RefPtr<P>> : SimpleClassHashTraits<RefPt
static IteratorReferenceType getToReferenceConversion(IteratorGetType x) { return *x; }
static IteratorConstReferenceType getToReferenceConstConversion(IteratorConstGetType x) { return *x; }
- typedef PassRefPtr<P> PassInType;
static void store(PassRefPtr<P> value, RefPtr<P>& storage) { storage = value; }
typedef P* PeekOutType;
@@ -205,7 +200,6 @@ struct HashTraits<std::unique_ptr<T>> : SimpleClassHashTraits<std::unique_ptr<T>
using PeekInType = T*;
- using PassInType = std::unique_ptr<T>;
static void store(std::unique_ptr<T>&& value, std::unique_ptr<T>& storage) { storage = std::move(value); }
using PeekOutType = T*;
« no previous file with comments | « third_party/WebKit/Source/wtf/HashTable.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698