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

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

Issue 2553673002: Disallow off-heap containers containing raw on-heap pointers. (Closed)
Patch Set: Created 4 years 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/HashMap.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/HashSet.h
diff --git a/third_party/WebKit/Source/wtf/HashSet.h b/third_party/WebKit/Source/wtf/HashSet.h
index 72b97fcd01be40bcd511827674085712d296436d..268ec6a3c0841d822d3fa5f0fc8b8e4c7cb71851 100644
--- a/third_party/WebKit/Source/wtf/HashSet.h
+++ b/third_party/WebKit/Source/wtf/HashSet.h
@@ -63,7 +63,12 @@ class HashSet {
const_iterator;
typedef typename HashTableType::AddResult AddResult;
- HashSet() = default;
+ HashSet() {
+ static_assert(Allocator::isGarbageCollected ||
+ !IsPointerToGarbageCollectedType<ValueArg>::value,
+ "Cannot put raw pointers to garbage-collected classes into "
+ "an off-heap HashSet. Use HeapHashSet<Member<T>> instead.");
+ }
HashSet(const HashSet&) = default;
HashSet& operator=(const HashSet&) = default;
HashSet(HashSet&&) = default;
« no previous file with comments | « third_party/WebKit/Source/wtf/HashMap.h ('k') | third_party/WebKit/Source/wtf/LinkedHashSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698