Chromium Code Reviews| Index: third_party/WebKit/Source/platform/wtf/HashTable.h |
| diff --git a/third_party/WebKit/Source/platform/wtf/HashTable.h b/third_party/WebKit/Source/platform/wtf/HashTable.h |
| index 0907c7420f897798365749fadea97240eb6041d2..17eb2512571fcba5401b2514c24e4129539fac6d 100644 |
| --- a/third_party/WebKit/Source/platform/wtf/HashTable.h |
| +++ b/third_party/WebKit/Source/platform/wtf/HashTable.h |
| @@ -836,6 +836,7 @@ class HashTable final |
| // expensive. |
| return key_count_ * kMinLoad < table_size_ && |
| table_size_ > KeyTraits::kMinimumTableSize && |
| + Allocator::IsBackingReallocationAllowed() && |
| Allocator::IsAllocationAllowed(); |
|
haraken
2017/04/12 06:44:34
Do you know what the IsAllocationAllowed check is
keishi
2017/04/12 09:43:53
Used IsAllocationAllowed instead of adding a new f
|
| } |
| ValueType* Expand(ValueType* entry = 0); |
| @@ -1230,6 +1231,7 @@ typename HashTable<Key, |
| Allocator>::AddResult |
| HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits, Allocator>:: |
| insert(T&& key, Extra&& extra) { |
| + DCHECK(Allocator::IsBackingReallocationAllowed()); |
| DCHECK(!AccessForbidden()); |
| DCHECK(Allocator::IsAllocationAllowed()); |
| if (!table_) |
| @@ -1616,6 +1618,7 @@ template <typename Key, |
| Value* |
| HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits, Allocator>:: |
| Expand(Value* entry) { |
| + DCHECK(Allocator::IsBackingReallocationAllowed()); |
| unsigned new_size; |
| if (!table_size_) { |
| new_size = KeyTraits::kMinimumTableSize; |