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

Unified Diff: Source/platform/heap/HeapTest.cpp

Issue 807003004: Templatize visitor arguments for TraceTrait mark and trace methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 6 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/platform/heap/Heap.h ('k') | Source/platform/heap/Visitor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/HeapTest.cpp
diff --git a/Source/platform/heap/HeapTest.cpp b/Source/platform/heap/HeapTest.cpp
index 6c7f071a9fb7bab7a3fbc34f9f1ed2b223d3277d..8f4191f9143684b4ab1a6d498c52ff062854c55d 100644
--- a/Source/platform/heap/HeapTest.cpp
+++ b/Source/platform/heap/HeapTest.cpp
@@ -58,7 +58,7 @@ public:
}
static int s_destructorCalls;
- static void trace(Visitor*) { }
+ void trace(Visitor*) { }
int value() const { return m_x; }
@@ -72,6 +72,7 @@ private:
IntWrapper();
int m_x;
};
+static_assert(WTF::NeedsTracing<IntWrapper>::value, "NeedsTracing macro failed to recognize trace method.");
class ThreadMarker {
public:
@@ -3549,6 +3550,8 @@ TEST(HeapTest, CollectionNesting)
typedef HeapDeque<Member<IntWrapper> > IntDeque;
HeapHashMap<void*, IntVector>* map = new HeapHashMap<void*, IntVector>();
HeapHashMap<void*, IntDeque>* map2 = new HeapHashMap<void*, IntDeque>();
+ static_assert(WTF::NeedsTracing<IntVector>::value, "Failed to recognize HeapVector as NeedsTracing");
+ static_assert(WTF::NeedsTracing<IntDeque>::value, "Failed to recognize HeapDeque as NeedsTracing");
map->add(key, IntVector());
map2->add(key, IntDeque());
« no previous file with comments | « Source/platform/heap/Heap.h ('k') | Source/platform/heap/Visitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698