| 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 * | 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 template <typename Key, typename Value> | 412 template <typename Key, typename Value> |
| 413 struct HashTraits<KeyValuePair<Key, Value>> | 413 struct HashTraits<KeyValuePair<Key, Value>> |
| 414 : public KeyValuePairHashTraits<HashTraits<Key>, HashTraits<Value>> {}; | 414 : public KeyValuePairHashTraits<HashTraits<Key>, HashTraits<Value>> {}; |
| 415 | 415 |
| 416 template <typename T> | 416 template <typename T> |
| 417 struct NullableHashTraits : public HashTraits<T> { | 417 struct NullableHashTraits : public HashTraits<T> { |
| 418 static const bool emptyValueIsZero = false; | 418 static const bool emptyValueIsZero = false; |
| 419 static T emptyValue() { return reinterpret_cast<T>(1); } | 419 static T emptyValue() { return reinterpret_cast<T>(1); } |
| 420 }; | 420 }; |
| 421 | 421 |
| 422 // This is for tracing inside collections that have special support for weak | |
| 423 // pointers. The trait has a trace method which returns true if there are weak | |
| 424 // pointers to things that have not (yet) been marked live. Returning true | |
| 425 // indicates that the entry in the collection may yet be removed by weak | |
| 426 // handling. Default implementation for non-weak types is to use the regular | |
| 427 // non-weak TraceTrait. Default implementation for types with weakness is to | |
| 428 // call traceInCollection on the type's trait. | |
| 429 template <WeakHandlingFlag weakHandlingFlag, | |
| 430 ShouldWeakPointersBeMarkedStrongly strongify, | |
| 431 typename T, | |
| 432 typename Traits> | |
| 433 struct TraceInCollectionTrait; | |
| 434 | |
| 435 } // namespace WTF | 422 } // namespace WTF |
| 436 | 423 |
| 437 using WTF::HashTraits; | 424 using WTF::HashTraits; |
| 438 using WTF::PairHashTraits; | 425 using WTF::PairHashTraits; |
| 439 using WTF::NullableHashTraits; | 426 using WTF::NullableHashTraits; |
| 440 using WTF::SimpleClassHashTraits; | 427 using WTF::SimpleClassHashTraits; |
| 441 | 428 |
| 442 #endif // WTF_HashTraits_h | 429 #endif // WTF_HashTraits_h |
| OLD | NEW |