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

Unified Diff: Source/heap/Visitor.h

Issue 78053006: [oilpan] Move IDBDatabase, IDBDatabaseCallbacks, IDBDatabaseBackendInterface and other related clas… (Closed) Base URL: svn://svn.chromium.org/blink/branches/oilpan
Patch Set: Created 7 years 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/heap/ThreadState.h ('k') | Source/modules/indexeddb/IDBAny.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/heap/Visitor.h
diff --git a/Source/heap/Visitor.h b/Source/heap/Visitor.h
index 3eb5537930c93681ad28e7f02bb44e561c9a637c..7a85f45d66fce4ce52370ba89f5c4b867ae9370b 100644
--- a/Source/heap/Visitor.h
+++ b/Source/heap/Visitor.h
@@ -37,6 +37,7 @@
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/HashTraits.h>
+#include <wtf/ListHashSet.h>
#define TRACE_GC_MARKING 0
#define TRACE_GC_FINALIZATION 0
@@ -273,10 +274,10 @@ public:
}
// The following visit methods are for off-heap collections.
- template<typename T, size_t N>
- void trace(const Vector<T, N, WTF::FastAllocator>& vector)
+ template<typename T, size_t inlineCapacity>
+ void trace(const Vector<T, inlineCapacity, WTF::FastAllocator>& vector)
{
- CollectionVisitingTrait<Vector<T, N, WTF::FastAllocator> >::visit(this, vector);
+ CollectionVisitingTrait<Vector<T, inlineCapacity, WTF::FastAllocator> >::visit(this, vector);
}
template<typename T, typename U, typename V>
@@ -285,6 +286,12 @@ public:
CollectionVisitingTrait<HashSet<T, WTF::FastAllocator, U, V> >::visit(this, hashSet);
}
+ template<typename T, size_t inlineCapacity, typename U>
+ void trace(const ListHashSet<T, inlineCapacity, U>& hashSet)
+ {
+ CollectionVisitingTrait<ListHashSet<T, inlineCapacity, U> >::visit(this, hashSet);
+ }
+
template<typename T, size_t N>
void trace(const Deque<T, N>& deque)
{
@@ -410,6 +417,19 @@ struct CollectionVisitingTrait<WTF::HashSet<T, WTF::FastAllocator, HashFunctions
}
};
+template<typename T, size_t inlineCapacity, typename HashFunctions>
+struct CollectionVisitingTrait<WTF::ListHashSet<T, inlineCapacity, HashFunctions> > {
+ typedef WTF::ListHashSet<T, inlineCapacity, HashFunctions> ListHashSet;
+
+ static void visit(Visitor* visitor, const ListHashSet& set)
+ {
+ if (set.isEmpty())
+ return;
+ for (typename ListHashSet::const_iterator it = set.begin(), end = set.end(); it != end; ++it)
+ visitor->trace(*it);
+ }
+};
+
template<typename Key, typename Value, typename HashFunctions, typename KeyTraits, typename ValueTraits>
struct CollectionVisitingTrait<WTF::HashMap<Key, Value, WTF::FastAllocator, HashFunctions, KeyTraits, ValueTraits> > {
typedef WTF::HashMap<Key, Value, WTF::FastAllocator, HashFunctions, KeyTraits, ValueTraits> HashMap;
« no previous file with comments | « Source/heap/ThreadState.h ('k') | Source/modules/indexeddb/IDBAny.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698