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

Unified Diff: Source/heap/Handle.h

Issue 223373002: Create HeapLinkedHashSet and LinkedHashSet, ordered heap-friendly hash sets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove inadvertent changes 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
« no previous file with comments | « no previous file | Source/heap/Heap.h » ('j') | Source/heap/Heap.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/heap/Handle.h
diff --git a/Source/heap/Handle.h b/Source/heap/Handle.h
index bf88b831d075768389ea9e9a5cfb8d1ddcaf7908..c1a128658eb93f0c2164a4ce467fa530033bdf6f 100644
--- a/Source/heap/Handle.h
+++ b/Source/heap/Handle.h
@@ -50,12 +50,14 @@ template<typename T> class HeapTerminatedArray;
typedef WTF::IsSubclassOfTemplate<NonConstType, GarbageCollected> GarbageCollectedSubclass; \
typedef WTF::IsSubclass<NonConstType, GarbageCollectedMixin> GarbageCollectedMixinSubclass; \
typedef WTF::IsSubclassOfTemplate3<NonConstType, HeapHashSet> HeapHashSetSubclass; \
+ typedef WTF::IsSubclassOfTemplate3<NonConstType, HeapLinkedHashSet> HeapLinkedHashSetSubclass; \
typedef WTF::IsSubclassOfTemplate5<NonConstType, HeapHashMap> HeapHashMapSubclass; \
typedef WTF::IsSubclassOfTemplateTypenameSize<NonConstType, HeapVector> HeapVectorSubclass; \
typedef WTF::IsSubclassOfTemplate<NonConstType, HeapTerminatedArray> HeapTerminatedArraySubclass; \
COMPILE_ASSERT(GarbageCollectedSubclass::value || \
GarbageCollectedMixinSubclass::value || \
HeapHashSetSubclass::value || \
+ HeapLinkedHashSetSubclass::value || \
HeapHashMapSubclass::value || \
HeapVectorSubclass::value || \
HeapTerminatedArraySubclass::value, \
@@ -396,6 +398,12 @@ template<
typename TraitsArg = HashTraits<ValueArg> >
class PersistentHeapHashSet : public PersistentHeapCollectionBase<HeapHashSet<ValueArg, HashArg, TraitsArg> > { };
+template<
+ typename ValueArg,
+ typename HashArg = typename DefaultHash<ValueArg>::Hash,
+ typename TraitsArg = HashTraits<ValueArg> >
+class PersistentHeapLinkedHashSet : public PersistentHeapCollectionBase<HeapLinkedHashSet<ValueArg, HashArg, TraitsArg> > { };
+
template<typename T, size_t inlineCapacity = 0>
class PersistentHeapVector : public PersistentHeapCollectionBase<HeapVector<T, inlineCapacity> > {
public:
@@ -448,6 +456,9 @@ public:
template<typename U>
Member(const Member<U>& other) : m_raw(other) { }
+ template<typename U>
+ Member(const RawPtr<U>& other) : m_raw(other) { }
+
T* release()
{
T* result = m_raw;
@@ -604,6 +615,9 @@ public:
WeakMember(const Member<U>& other) : Member<T>(other) { }
template<typename U>
+ WeakMember(const RawPtr<U>& other) : Member<T>(other) { }
+
+ template<typename U>
WeakMember& operator=(const Persistent<U>& other)
{
this->m_raw = other;
@@ -693,6 +707,8 @@ template<typename T, typename U> inline bool operator!=(const Persistent<T>& a,
#define WillBePersistentHeapHashMap WebCore::PersistentHeapHashMap
#define WillBeHeapHashSet WebCore::HeapHashSet
#define WillBePersistentHeapHashSet WebCore::PersistentHeapHashSet
+#define WillBeHeapLinkedHashSet WebCore::HeapLinkedHashSet
+#define WillBePersistentHeapLinkedHashSet WebCore::PersistentHeapLinkedHashSet
#define WillBeHeapVector WebCore::HeapVector
#define WillBePersistentHeapVector WebCore::PersistentHeapVector
#define WillBeGarbageCollectedMixin WebCore::GarbageCollectedMixin
@@ -763,6 +779,8 @@ public:
#define WillBePersistentHeapHashMap WTF::HashMap
#define WillBeHeapHashSet WTF::HashSet
#define WillBePersistentHeapHashSet WTF::HashSet
+#define WillBeHeapLinkedHashSet WTF::LinkedHashSet
+#define WillBePersistentLinkedHeapHashSet WTF::LinkedHashSet
#define WillBeHeapVector WTF::Vector
#define WillBePersistentHeapVector WTF::Vector
#define WillBeGarbageCollectedMixin WebCore::DummyBase<void>
@@ -944,18 +962,23 @@ struct NeedsTracing<Deque<T, N> > {
static const bool value = false;
};
-template<typename T>
-struct NeedsTracing<HashSet<T> > {
+template<typename T, typename U, typename V>
+struct NeedsTracing<HashSet<T, U, V> > {
static const bool value = false;
};
-template<typename T>
-struct NeedsTracing<ListHashSet<T> > {
+template<typename T, size_t U, typename V>
+struct NeedsTracing<ListHashSet<T, U, V> > {
static const bool value = false;
};
-template<typename T, typename U>
-struct NeedsTracing<HashMap<T, U> > {
+template<typename T, typename U, typename V>
+struct NeedsTracing<LinkedHashSet<T, U, V> > {
+ static const bool value = false;
+};
+
+template<typename T, typename U, typename V, typename W, typename X>
+struct NeedsTracing<HashMap<T, U, V, W, X> > {
static const bool value = false;
};
« no previous file with comments | « no previous file | Source/heap/Heap.h » ('j') | Source/heap/Heap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698