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

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

Issue 827723002: Reland: Templatize visitor arguments for TraceTrait mark and trace methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 5 years, 11 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/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 7ca67f89b5b3cf5499440d9c488c10044faab9ce..36b8123bfb9d408f8e4618a16cbef28e96844083 100644
--- a/Source/platform/heap/Visitor.h
+++ b/Source/platform/heap/Visitor.h
@@ -194,13 +194,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);
}
@@ -653,7 +654,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;
@@ -666,7 +668,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;
@@ -687,7 +690,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
@@ -727,7 +731,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