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

Unified Diff: Source/wtf/Deque.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/Visitor.h ('k') | Source/wtf/HashTable.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/Deque.h
diff --git a/Source/wtf/Deque.h b/Source/wtf/Deque.h
index 0031c549cc04e3f478240663d046b00313fa9ab5..e853478df4a42148558e1cad51d6b2fd22939746 100644
--- a/Source/wtf/Deque.h
+++ b/Source/wtf/Deque.h
@@ -112,7 +112,7 @@ namespace WTF {
template<typename Predicate>
iterator findIf(Predicate&);
- void trace(typename Allocator::Visitor*);
+ template<typename VisitorDispatcher> void trace(VisitorDispatcher);
private:
friend class DequeIteratorBase<T, inlineCapacity, Allocator>;
@@ -528,7 +528,8 @@ namespace WTF {
// This is only called if the allocator is a HeapAllocator. It is used when
// visiting during a tracing GC.
template<typename T, size_t inlineCapacity, typename Allocator>
- void Deque<T, inlineCapacity, Allocator>::trace(typename Allocator::Visitor* visitor)
+ template<typename VisitorDispatcher>
+ void Deque<T, inlineCapacity, Allocator>::trace(VisitorDispatcher visitor)
{
ASSERT(Allocator::isGarbageCollected); // Garbage collector must be enabled.
const T* bufferBegin = m_buffer.buffer();
@@ -536,13 +537,13 @@ namespace WTF {
if (ShouldBeTraced<VectorTraits<T> >::value) {
if (m_start <= m_end) {
for (const T* bufferEntry = bufferBegin + m_start; bufferEntry != end; bufferEntry++)
- Allocator::template trace<T, VectorTraits<T> >(visitor, *const_cast<T*>(bufferEntry));
+ Allocator::template trace<VisitorDispatcher, T, VectorTraits<T> >(visitor, *const_cast<T*>(bufferEntry));
} else {
for (const T* bufferEntry = bufferBegin; bufferEntry != end; bufferEntry++)
- Allocator::template trace<T, VectorTraits<T> >(visitor, *const_cast<T*>(bufferEntry));
+ Allocator::template trace<VisitorDispatcher, T, VectorTraits<T> >(visitor, *const_cast<T*>(bufferEntry));
const T* bufferEnd = m_buffer.buffer() + m_buffer.capacity();
for (const T* bufferEntry = bufferBegin + m_start; bufferEntry != bufferEnd; bufferEntry++)
- Allocator::template trace<T, VectorTraits<T> >(visitor, *const_cast<T*>(bufferEntry));
+ Allocator::template trace<VisitorDispatcher, T, VectorTraits<T> >(visitor, *const_cast<T*>(bufferEntry));
}
}
if (m_buffer.hasOutOfLineBuffer())
« no previous file with comments | « Source/platform/heap/Visitor.h ('k') | Source/wtf/HashTable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698