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

Unified Diff: Source/wtf/HashTraits.h

Issue 23042005: [oilpan] Fix iterators over member collections to return Result<T> (Closed) Base URL: svn://svn.chromium.org/blink/branches/oilpan
Patch Set: Rebase Created 7 years, 4 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 | « 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: Source/wtf/HashTraits.h
diff --git a/Source/wtf/HashTraits.h b/Source/wtf/HashTraits.h
index 433b358cd62dc7e4ea571b4c15905907107c1ceb..2395ff8cf5e34480029a4d35a5f958bb2d41be4c 100644
--- a/Source/wtf/HashTraits.h
+++ b/Source/wtf/HashTraits.h
@@ -75,6 +75,12 @@ namespace WTF {
// Type for functions that do not take ownership, such as contains.
typedef const T& PeekInType;
+ typedef T* IteratorGetType;
+ typedef const T* IteratorConstGetType;
+ typedef T& IteratorReferenceType;
+ 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.
@@ -132,6 +138,12 @@ namespace WTF {
static EmptyValueType emptyValue() { return nullptr; }
typedef const OwnPtr<P>& PeekInType;
+ typedef P* IteratorGetType;
+ typedef const P* IteratorConstGetType;
+ typedef P& IteratorReferenceType;
+ typedef const P& IteratorConstReferenceType;
+ static IteratorReferenceType getToReferenceConversion(IteratorGetType x) { return *x; }
+ static IteratorConstReferenceType getToReferenceConstConversion(IteratorConstGetType x) { return *x; }
typedef PassOwnPtr<P> PassInType;
static void store(PassOwnPtr<P> value, OwnPtr<P>& storage) { storage = value; }
@@ -146,6 +158,12 @@ namespace WTF {
template<typename P> struct HashTraits<RefPtr<P> > : SimpleClassHashTraits<RefPtr<P> > {
typedef const RefPtr<P>& PeekInType;
+ typedef RefPtr<P>* IteratorGetType;
+ typedef const RefPtr<P>* IteratorConstGetType;
+ typedef RefPtr<P>& IteratorReferenceType;
+ typedef const RefPtr<P>& IteratorConstReferenceType;
+ 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; }
« no previous file with comments | « Source/wtf/HashTable.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698