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

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

Issue 1652953002: Make copyToVector() robust against conservative GCs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unnecessary 'template' use Created 4 years, 11 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/core/css/CSSFontSelector.cpp ('k') | third_party/WebKit/Source/wtf/HashSet.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 58b55f02552960cea56d08d2417aa0e15f033819..b6a5048f67b7b306c2cee958d28a884a3e75ef00 100644
--- a/third_party/WebKit/Source/wtf/HashCountedSet.h
+++ b/third_party/WebKit/Source/wtf/HashCountedSet.h
@@ -130,7 +130,11 @@ inline void copyToVector(const HashCountedSet<T, U, V, W>& collection, VectorTyp
{
typedef typename HashCountedSet<T, U, V, W>::const_iterator iterator;
- vector.resize(collection.size());
+ {
+ // Disallow GC across resize allocation, see crbug.com/568173
+ typename VectorType::GCForbiddenScope scope;
+ vector.resize(collection.size());
+ }
iterator it = collection.begin();
iterator end = collection.end();
@@ -143,7 +147,11 @@ inline void copyToVector(const HashCountedSet<Value, HashFunctions, Traits, Allo
{
typedef typename HashCountedSet<Value, HashFunctions, Traits, Allocator>::const_iterator iterator;
- vector.resize(collection.size());
+ {
+ // Disallow GC across resize allocation, see crbug.com/568173
+ typename Vector<Value, inlineCapacity, VectorAllocator>::GCForbiddenScope scope;
+ vector.resize(collection.size());
+ }
iterator it = collection.begin();
iterator end = collection.end();
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSFontSelector.cpp ('k') | third_party/WebKit/Source/wtf/HashSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698