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

Unified Diff: Source/wtf/HashTraits.h

Issue 319593004: Oilpan:Allow custom handling of classes that contain weak pointers that are embedded in collections. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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
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>

Powered by Google App Engine
This is Rietveld 408576698