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

Unified Diff: Source/platform/heap/Visitor.h

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/HeapTest.cpp ('k') | Source/wtf/Deque.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Visitor.h
diff --git a/Source/platform/heap/Visitor.h b/Source/platform/heap/Visitor.h
index 7102e9725b5875ba8a09fe85ac18569b79b8a01d..3e9d21891861c322483c6dd58d7a454152b75d2e 100644
--- a/Source/platform/heap/Visitor.h
+++ b/Source/platform/heap/Visitor.h
@@ -199,13 +199,14 @@ class TraceTrait {
public:
// Default implementation of TraceTrait<T>::trace just statically
// dispatches to the trace method of the class T.
- template<typename TraceDispatcher>
- static void trace(TraceDispatcher visitor, void* self)
+ template<typename VisitorDispatcher>
+ static void trace(VisitorDispatcher visitor, void* self)
{
TraceCompatibilityAdaptor<T>::trace(visitor, static_cast<T*>(self));
}
- static void mark(Visitor* visitor, const T* t)
+ template<typename VisitorDispatcher>
+ static void mark(VisitorDispatcher visitor, const T* t)
{
DefaultTraceTrait<T>::mark(visitor, t);
}
@@ -669,7 +670,8 @@ template<typename T, size_t N>
struct OffHeapCollectionTraceTrait<WTF::Vector<T, N, WTF::DefaultAllocator> > {
typedef WTF::Vector<T, N, WTF::DefaultAllocator> Vector;
- static void trace(Visitor* visitor, const Vector& vector)
+ template<typename VisitorDispatcher>
+ static void trace(VisitorDispatcher visitor, const Vector& vector)
{
if (vector.isEmpty())
return;
@@ -682,7 +684,8 @@ template<typename T, size_t N>
struct OffHeapCollectionTraceTrait<WTF::Deque<T, N> > {
typedef WTF::Deque<T, N> Deque;
- static void trace(Visitor* visitor, const Deque& deque)
+ template<typename VisitorDispatcher>
+ static void trace(VisitorDispatcher visitor, const Deque& deque)
{
if (deque.isEmpty())
return;
@@ -703,7 +706,8 @@ public:
template<typename T>
class DefaultTraceTrait<T, false> {
public:
- static void mark(Visitor* visitor, const T* t)
+ template<typename VisitorDispatcher>
+ static void mark(VisitorDispatcher visitor, const T* t)
{
// Default mark method of the trait just calls the two-argument mark
// method on the visitor. The second argument is the static trace method
@@ -743,7 +747,8 @@ public:
template<typename T>
class DefaultTraceTrait<T, true> {
public:
- static void mark(Visitor* visitor, const T* self)
+ template<typename VisitorDispatcher>
+ static void mark(VisitorDispatcher visitor, const T* self)
{
if (!self)
return;
« no previous file with comments | « Source/platform/heap/HeapTest.cpp ('k') | Source/wtf/Deque.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698