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

Unified Diff: third_party/WebKit/Source/wtf/HashTraits.h

Issue 2065443002: Rename and improve "traceable" templates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment rewording Created 4 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
« no previous file with comments | « third_party/WebKit/Source/wtf/HashTable.h ('k') | third_party/WebKit/Source/wtf/LinkedHashSet.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/HashTraits.h
diff --git a/third_party/WebKit/Source/wtf/HashTraits.h b/third_party/WebKit/Source/wtf/HashTraits.h
index 77d4ff6bc35987f584449ad72aed5c9bfcd1347a..bd8f8c9d7bc9e8c40d21d46fb4b5017a4737b31c 100644
--- a/third_party/WebKit/Source/wtf/HashTraits.h
+++ b/third_party/WebKit/Source/wtf/HashTraits.h
@@ -61,9 +61,13 @@ template <typename T> struct GenericHashTraitsBase<false, T> {
static const unsigned minimumTableSize = 8;
#endif
+ // When a hash table backing store is traced, its elements will be
+ // traced if their class type has a trace method. However, weak-referenced
+ // elements should not be traced then, but handled by the weak processing
+ // phase that follows.
template <typename U = void>
- struct NeedsTracingLazily {
haraken 2016/06/12 07:11:31 Nit: I'm okay with keeping the word "lazily" to ma
sof 2016/06/12 07:29:44 None other than it would fail to compile, i think.
- static const bool value = NeedsTracing<T>::value;
+ struct IsTraceableInCollection {
+ static const bool value = IsTraceable<T>::value && !IsWeak<T>::value;
};
// The NeedsToForbidGCOnMove flag is used to make the hash table move
@@ -302,8 +306,8 @@ struct KeyValuePairHashTraits : GenericHashTraits<KeyValuePair<typename KeyTrait
static EmptyValueType emptyValue() { return KeyValuePair<typename KeyTraits::EmptyValueType, typename ValueTraits::EmptyValueType>(KeyTraits::emptyValue(), ValueTraits::emptyValue()); }
template <typename U = void>
- struct NeedsTracingLazily {
- static const bool value = NeedsTracingTrait<KeyTraits>::value || NeedsTracingTrait<ValueTraits>::value;
+ struct IsTraceableInCollection {
+ static const bool value = IsTraceableInCollectionTrait<KeyTraits>::value || IsTraceableInCollectionTrait<ValueTraits>::value;
};
template <typename U = void>
« no previous file with comments | « third_party/WebKit/Source/wtf/HashTable.h ('k') | third_party/WebKit/Source/wtf/LinkedHashSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698