| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights | 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * Copyright (C) 2008 David Levin <levin@chromium.org> | 4 * Copyright (C) 2008 David Levin <levin@chromium.org> |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 | 496 |
| 497 #if ENABLE(SECURITY_ASSERT) | 497 #if ENABLE(SECURITY_ASSERT) |
| 498 ~HashTableAddResult() { | 498 ~HashTableAddResult() { |
| 499 // If rehash happened before accessing storedValue, it's | 499 // If rehash happened before accessing storedValue, it's |
| 500 // use-after-free. Any modification may cause a rehash, so we check for | 500 // use-after-free. Any modification may cause a rehash, so we check for |
| 501 // modifications here. | 501 // modifications here. |
| 502 | 502 |
| 503 // Rehash after accessing storedValue is harmless but will assert if the | 503 // Rehash after accessing storedValue is harmless but will assert if the |
| 504 // AddResult destructor takes place after a modification. You may need | 504 // AddResult destructor takes place after a modification. You may need |
| 505 // to limit the scope of the AddResult. | 505 // to limit the scope of the AddResult. |
| 506 ASSERT_WITH_SECURITY_IMPLICATION(m_containerModifications == | 506 SECURITY_DCHECK(m_containerModifications == m_container->modifications()); |
| 507 m_container->modifications()); | |
| 508 } | 507 } |
| 509 | 508 |
| 510 private: | 509 private: |
| 511 const HashTableType* m_container; | 510 const HashTableType* m_container; |
| 512 const int64_t m_containerModifications; | 511 const int64_t m_containerModifications; |
| 513 #endif | 512 #endif |
| 514 }; | 513 }; |
| 515 | 514 |
| 516 template <typename Value, typename Extractor, typename KeyTraits> | 515 template <typename Value, typename Extractor, typename KeyTraits> |
| 517 struct HashTableHelper { | 516 struct HashTableHelper { |
| (...skipping 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2228 CollectionIterator end(toBeRemoved.end()); | 2227 CollectionIterator end(toBeRemoved.end()); |
| 2229 for (CollectionIterator it(toBeRemoved.begin()); it != end; ++it) | 2228 for (CollectionIterator it(toBeRemoved.begin()); it != end; ++it) |
| 2230 collection.remove(*it); | 2229 collection.remove(*it); |
| 2231 } | 2230 } |
| 2232 | 2231 |
| 2233 } // namespace WTF | 2232 } // namespace WTF |
| 2234 | 2233 |
| 2235 #include "wtf/HashIterators.h" | 2234 #include "wtf/HashIterators.h" |
| 2236 | 2235 |
| 2237 #endif // WTF_HashTable_h | 2236 #endif // WTF_HashTable_h |
| OLD | NEW |