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

Unified Diff: Source/wtf/HashTable.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/wtf/Deque.h ('k') | Source/wtf/TypeTraits.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/HashTable.h
diff --git a/Source/wtf/HashTable.h b/Source/wtf/HashTable.h
index 72099fdee50b4164cd409399a79f3e98a18a4ff9..d0e3ead6449c82e1662400532e4aae7bb64d6758 100644
--- a/Source/wtf/HashTable.h
+++ b/Source/wtf/HashTable.h
@@ -479,7 +479,7 @@ namespace WTF {
template<typename HashTranslator, typename T> ValueType* lookup(T);
template<typename HashTranslator, typename T> const ValueType* lookup(T) const;
- void trace(typename Allocator::Visitor*);
+ template<typename VisitorDispatcher> void trace(VisitorDispatcher);
#if ENABLE(ASSERT)
int64_t modifications() const { return m_modifications; }
@@ -1223,7 +1223,8 @@ namespace WTF {
};
template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits, typename Allocator>
- void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits, Allocator>::trace(typename Allocator::Visitor* visitor)
+ template<typename VisitorDispatcher>
+ void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits, Allocator>::trace(VisitorDispatcher visitor)
{
// If someone else already marked the backing and queued up the trace
// and/or weak callback then we are done. This optimization does not
@@ -1274,7 +1275,7 @@ namespace WTF {
}
for (ValueType* element = m_table + m_tableSize - 1; element >= m_table; element--) {
if (!isEmptyOrDeletedBucket(*element))
- Allocator::template trace<ValueType, Traits>(visitor, *element);
+ Allocator::template trace<VisitorDispatcher, ValueType, Traits>(visitor, *element);
}
}
}
« no previous file with comments | « Source/wtf/Deque.h ('k') | Source/wtf/TypeTraits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698