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

Unified Diff: third_party/WebKit/Source/wtf/HashCountedSet.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
Index: third_party/WebKit/Source/wtf/HashCountedSet.h
diff --git a/third_party/WebKit/Source/wtf/HashCountedSet.h b/third_party/WebKit/Source/wtf/HashCountedSet.h
index fc60257d7e8ec265aed82e8e203bc9a9cff0ec14..6e0db4ed11ccb3b1d315935da70aaa882dd81941 100644
--- a/third_party/WebKit/Source/wtf/HashCountedSet.h
+++ b/third_party/WebKit/Source/wtf/HashCountedSet.h
@@ -53,7 +53,13 @@ class HashCountedSet {
typedef typename ImplType::const_iterator const_iterator;
typedef typename ImplType::AddResult AddResult;
- HashCountedSet() {}
+ HashCountedSet() {
+ static_assert(Allocator::isGarbageCollected ||
+ !IsPointerToGarbageCollectedType<Value>::value,
+ "Cannot put raw pointers to garbage-collected classes into "
+ "an off-heap HashCountedSet. Use "
+ "HeapHashCountedSet<Member<T>> instead.");
+ }
void swap(HashCountedSet& other) { m_impl.swap(other.m_impl); }
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp ('k') | third_party/WebKit/Source/wtf/HashMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698