Index: Source/wtf/HashTraits.h |
diff --git a/Source/wtf/HashTraits.h b/Source/wtf/HashTraits.h |
index adca0f85335db622fe6dce98a7a7c3239620bb9b..09ae26480a43a19e4abde338b0522f0c8dcd8aa7 100644 |
--- a/Source/wtf/HashTraits.h |
+++ b/Source/wtf/HashTraits.h |
@@ -64,6 +64,8 @@ namespace WTF { |
static const bool value = NeedsTracing<T>::value; |
}; |
static const bool isWeak = IsWeak<T>::value; |
+ template<typename Visitor> |
+ static bool shouldRemoveFromCollection(Visitor*, T&) { return false; } |
}; |
// Default integer traits disallow both 0 and -1 as keys (max value instead of -1 for unsigned). |
@@ -276,6 +278,12 @@ namespace WTF { |
static void constructDeletedValue(TraitType& slot) { KeyTraits::constructDeletedValue(slot.key); } |
static bool isDeletedValue(const TraitType& value) { return KeyTraits::isDeletedValue(value.key); } |
+ template<typename Visitor> |
+ static bool shouldRemoveFromCollection(Visitor* visitor, TraitType& pair) |
+ { |
+ return KeyTraits::shouldRemoveFromCollection(visitor, pair.key) |
+ || ValueTraits::shouldRemoveFromCollection(visitor, pair.value); |
+ } |
}; |
template<typename Key, typename Value> |