Commit 248c5598 authored by Anton Bikineev's avatar Anton Bikineev Committed by Commit Bot

WTF: Remove useless Allocator param from LinkedHashSetNode

Change-Id: I1729710a62f1cc288ec947c7532ed61721fcd720
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1862681Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705928}
parent 17ccae2c
...@@ -580,19 +580,18 @@ struct TraceInCollectionTrait<kWeakHandling, KeyValuePair<Key, Value>, Traits> { ...@@ -580,19 +580,18 @@ struct TraceInCollectionTrait<kWeakHandling, KeyValuePair<Key, Value>, Traits> {
// Nodes used by LinkedHashSet. Again we need two versions to disambiguate the // Nodes used by LinkedHashSet. Again we need two versions to disambiguate the
// template. // template.
template <typename Value, typename Allocator, typename Traits> template <typename Value, typename Traits>
struct TraceInCollectionTrait<kNoWeakHandling, struct TraceInCollectionTrait<kNoWeakHandling,
LinkedHashSetNode<Value, Allocator>, LinkedHashSetNode<Value>,
Traits> { Traits> {
static bool IsAlive(LinkedHashSetNode<Value, Allocator>& self) { static bool IsAlive(LinkedHashSetNode<Value>& self) {
return TraceInCollectionTrait< return TraceInCollectionTrait<
kNoWeakHandling, Value, kNoWeakHandling, Value,
typename Traits::ValueTraits>::IsAlive(self.value_); typename Traits::ValueTraits>::IsAlive(self.value_);
} }
template <typename VisitorDispatcher> template <typename VisitorDispatcher>
static bool Trace(VisitorDispatcher visitor, static bool Trace(VisitorDispatcher visitor, LinkedHashSetNode<Value>& self) {
LinkedHashSetNode<Value, Allocator>& self) {
static_assert(IsTraceableInCollectionTrait<Traits>::value || static_assert(IsTraceableInCollectionTrait<Traits>::value ||
Traits::kWeakHandlingFlag == WTF::kWeakHandling, Traits::kWeakHandlingFlag == WTF::kWeakHandling,
"T should not be traced"); "T should not be traced");
...@@ -602,19 +601,16 @@ struct TraceInCollectionTrait<kNoWeakHandling, ...@@ -602,19 +601,16 @@ struct TraceInCollectionTrait<kNoWeakHandling,
} }
}; };
template <typename Value, typename Allocator, typename Traits> template <typename Value, typename Traits>
struct TraceInCollectionTrait<kWeakHandling, struct TraceInCollectionTrait<kWeakHandling, LinkedHashSetNode<Value>, Traits> {
LinkedHashSetNode<Value, Allocator>, static bool IsAlive(LinkedHashSetNode<Value>& self) {
Traits> {
static bool IsAlive(LinkedHashSetNode<Value, Allocator>& self) {
return TraceInCollectionTrait< return TraceInCollectionTrait<
kWeakHandling, Value, kWeakHandling, Value,
typename Traits::ValueTraits>::IsAlive(self.value_); typename Traits::ValueTraits>::IsAlive(self.value_);
} }
template <typename VisitorDispatcher> template <typename VisitorDispatcher>
static bool Trace(VisitorDispatcher visitor, static bool Trace(VisitorDispatcher visitor, LinkedHashSetNode<Value>& self) {
LinkedHashSetNode<Value, Allocator>& self) {
return TraceInCollectionTrait< return TraceInCollectionTrait<
kWeakHandling, Value, typename Traits::ValueTraits>::Trace(visitor, kWeakHandling, Value, typename Traits::ValueTraits>::Trace(visitor,
self.value_); self.value_);
......
...@@ -136,7 +136,7 @@ class LinkedHashSetNodeBase { ...@@ -136,7 +136,7 @@ class LinkedHashSetNodeBase {
LinkedHashSetNodeBase& operator=(const LinkedHashSetNodeBase& other) = delete; LinkedHashSetNodeBase& operator=(const LinkedHashSetNodeBase& other) = delete;
}; };
template <typename ValueArg, typename Allocator> template <typename ValueArg>
class LinkedHashSetNode : public LinkedHashSetNodeBase { class LinkedHashSetNode : public LinkedHashSetNodeBase {
DISALLOW_NEW(); DISALLOW_NEW();
...@@ -171,7 +171,7 @@ class LinkedHashSet { ...@@ -171,7 +171,7 @@ class LinkedHashSet {
private: private:
typedef ValueArg Value; typedef ValueArg Value;
typedef TraitsArg Traits; typedef TraitsArg Traits;
typedef LinkedHashSetNode<Value, Allocator> Node; typedef LinkedHashSetNode<Value> Node;
typedef LinkedHashSetNodeBase NodeBase; typedef LinkedHashSetNodeBase NodeBase;
typedef LinkedHashSetTranslator<Value, HashFunctions, Allocator> typedef LinkedHashSetTranslator<Value, HashFunctions, Allocator>
NodeHashFunctions; NodeHashFunctions;
...@@ -361,7 +361,7 @@ class LinkedHashSet { ...@@ -361,7 +361,7 @@ class LinkedHashSet {
template <typename Value, typename HashFunctions, typename Allocator> template <typename Value, typename HashFunctions, typename Allocator>
struct LinkedHashSetTranslator { struct LinkedHashSetTranslator {
STATIC_ONLY(LinkedHashSetTranslator); STATIC_ONLY(LinkedHashSetTranslator);
typedef LinkedHashSetNode<Value, Allocator> Node; typedef LinkedHashSetNode<Value> Node;
typedef LinkedHashSetNodeBase NodeBase; typedef LinkedHashSetNodeBase NodeBase;
typedef typename HashTraits<Value>::PeekInType ValuePeekInType; typedef typename HashTraits<Value>::PeekInType ValuePeekInType;
static unsigned GetHash(const Node& node) { static unsigned GetHash(const Node& node) {
...@@ -394,16 +394,16 @@ struct LinkedHashSetTranslator { ...@@ -394,16 +394,16 @@ struct LinkedHashSetTranslator {
template <typename Value, typename Allocator> template <typename Value, typename Allocator>
struct LinkedHashSetExtractor { struct LinkedHashSetExtractor {
STATIC_ONLY(LinkedHashSetExtractor); STATIC_ONLY(LinkedHashSetExtractor);
static const Value& Extract(const LinkedHashSetNode<Value, Allocator>& node) { static const Value& Extract(const LinkedHashSetNode<Value>& node) {
return node.value_; return node.value_;
} }
}; };
template <typename Value, typename ValueTraitsArg, typename Allocator> template <typename Value, typename ValueTraitsArg, typename Allocator>
struct LinkedHashSetTraits struct LinkedHashSetTraits
: public SimpleClassHashTraits<LinkedHashSetNode<Value, Allocator>> { : public SimpleClassHashTraits<LinkedHashSetNode<Value>> {
STATIC_ONLY(LinkedHashSetTraits); STATIC_ONLY(LinkedHashSetTraits);
using Node = LinkedHashSetNode<Value, Allocator>; using Node = LinkedHashSetNode<Value>;
using NodeBase = LinkedHashSetNodeBase; using NodeBase = LinkedHashSetNodeBase;
typedef ValueTraitsArg ValueTraits; typedef ValueTraitsArg ValueTraits;
...@@ -961,8 +961,7 @@ inline void LinkedHashSet<T, U, V, W>::erase(ValuePeekInType value) { ...@@ -961,8 +961,7 @@ inline void LinkedHashSet<T, U, V, W>::erase(ValuePeekInType value) {
} }
template <typename T, typename Allocator> template <typename T, typename Allocator>
inline void swap(LinkedHashSetNode<T, Allocator>& a, inline void swap(LinkedHashSetNode<T>& a, LinkedHashSetNode<T>& b) {
LinkedHashSetNode<T, Allocator>& b) {
typedef LinkedHashSetNodeBase Base; typedef LinkedHashSetNodeBase Base;
// The key and value cannot be swapped atomically, and it would be // The key and value cannot be swapped atomically, and it would be
// wrong to have a GC when only one was swapped and the other still // wrong to have a GC when only one was swapped and the other still
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment