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

Side by Side Diff: third_party/WebKit/Source/wtf/HashTable.h

Issue 1406923009: Rename DISALLOW_ALLOCATION and ALLOW_ONLY_INLINE_ALLOCATION (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2008 David Levin <levin@chromium.org> 3 * Copyright (C) 2008 David Levin <levin@chromium.org>
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after
996 // compiler will also check this on some platforms. We would like to check 996 // compiler will also check this on some platforms. We would like to check
997 // this on the whole value (key-value pair), but IsPolymorphic will return 997 // this on the whole value (key-value pair), but IsPolymorphic will return
998 // false for a pair of two types, even if one of the components is 998 // false for a pair of two types, even if one of the components is
999 // polymorphic. 999 // polymorphic.
1000 static_assert(!Traits::emptyValueIsZero || !IsPolymorphic<KeyType>::value, " empty value cannot be zero for things with a vtable"); 1000 static_assert(!Traits::emptyValueIsZero || !IsPolymorphic<KeyType>::value, " empty value cannot be zero for things with a vtable");
1001 1001
1002 #if ENABLE(OILPAN) 1002 #if ENABLE(OILPAN)
1003 static_assert(Allocator::isGarbageCollected 1003 static_assert(Allocator::isGarbageCollected
1004 || ((!IsAllowOnlyInlineAllocation<KeyType>::value || !NeedsTracing<KeyTy pe>::value) 1004 || ((!IsAllowOnlyInlineAllocation<KeyType>::value || !NeedsTracing<KeyTy pe>::value)
1005 && (!IsAllowOnlyInlineAllocation<ValueType>::value || !NeedsTracing<Valu eType>::value)) 1005 && (!IsAllowOnlyInlineAllocation<ValueType>::value || !NeedsTracing<Valu eType>::value))
1006 , "Cannot put ALLOW_ONLY_INLINE_ALLOCATION objects that have trace metho ds into an off-heap HashTable"); 1006 , "Cannot put DISALLOW_NEW_EXCEPT_PLACEMENT_NEW objects that have trace methods into an off-heap HashTable");
1007 #endif 1007 #endif
1008 if (Traits::emptyValueIsZero) { 1008 if (Traits::emptyValueIsZero) {
1009 result = Allocator::template allocateZeroedHashTableBacking<ValueType, H ashTable>(allocSize); 1009 result = Allocator::template allocateZeroedHashTableBacking<ValueType, H ashTable>(allocSize);
1010 } else { 1010 } else {
1011 result = Allocator::template allocateHashTableBacking<ValueType, HashTab le>(allocSize); 1011 result = Allocator::template allocateHashTableBacking<ValueType, HashTab le>(allocSize);
1012 for (unsigned i = 0; i < size; i++) 1012 for (unsigned i = 0; i < size; i++)
1013 initializeBucket(result[i]); 1013 initializeBucket(result[i]);
1014 } 1014 }
1015 return result; 1015 return result;
1016 } 1016 }
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
1487 CollectionIterator end(toBeRemoved.end()); 1487 CollectionIterator end(toBeRemoved.end());
1488 for (CollectionIterator it(toBeRemoved.begin()); it != end; ++it) 1488 for (CollectionIterator it(toBeRemoved.begin()); it != end; ++it)
1489 collection.remove(*it); 1489 collection.remove(*it);
1490 } 1490 }
1491 1491
1492 } // namespace WTF 1492 } // namespace WTF
1493 1493
1494 #include "wtf/HashIterators.h" 1494 #include "wtf/HashIterators.h"
1495 1495
1496 #endif // WTF_HashTable_h 1496 #endif // WTF_HashTable_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/Deque.h ('k') | third_party/WebKit/Source/wtf/TerminatedArrayBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698