OLD | NEW |
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) 2011, Benjamin Poulain <ikipou@gmail.com> | 3 * Copyright (C) 2011, Benjamin Poulain <ikipou@gmail.com> |
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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 static bool isEmptyValue(const Node& node) { return !node.m_next; } | 343 static bool isEmptyValue(const Node& node) { return !node.m_next; } |
344 | 344 |
345 static const int deletedValue = -1; | 345 static const int deletedValue = -1; |
346 | 346 |
347 static void constructDeletedValue(Node& slot, bool) { slot.m_next = reinterp
ret_cast<Node*>(deletedValue); } | 347 static void constructDeletedValue(Node& slot, bool) { slot.m_next = reinterp
ret_cast<Node*>(deletedValue); } |
348 static bool isDeletedValue(const Node& slot) { return slot.m_next == reinter
pret_cast<Node*>(deletedValue); } | 348 static bool isDeletedValue(const Node& slot) { return slot.m_next == reinter
pret_cast<Node*>(deletedValue); } |
349 | 349 |
350 // Whether we need to trace and do weak processing depends on the traits of | 350 // Whether we need to trace and do weak processing depends on the traits of |
351 // the type inside the node. | 351 // the type inside the node. |
352 template<typename U = void> | 352 template<typename U = void> |
353 struct NeedsTracingLazily { | 353 struct IsTraceableInCollection { |
354 STATIC_ONLY(NeedsTracingLazily); | 354 STATIC_ONLY(IsTraceableInCollection); |
355 static const bool value = ValueTraits::template NeedsTracingLazily<>::va
lue; | 355 static const bool value = ValueTraits::template IsTraceableInCollection<
>::value; |
356 }; | 356 }; |
357 static const WeakHandlingFlag weakHandlingFlag = ValueTraits::weakHandlingFl
ag; | 357 static const WeakHandlingFlag weakHandlingFlag = ValueTraits::weakHandlingFl
ag; |
358 }; | 358 }; |
359 | 359 |
360 template<typename LinkedHashSetType> | 360 template<typename LinkedHashSetType> |
361 class LinkedHashSetIterator { | 361 class LinkedHashSetIterator { |
362 DISALLOW_NEW(); | 362 DISALLOW_NEW(); |
363 private: | 363 private: |
364 typedef typename LinkedHashSetType::Node Node; | 364 typedef typename LinkedHashSetType::Node Node; |
365 typedef typename LinkedHashSetType::Traits Traits; | 365 typedef typename LinkedHashSetType::Traits Traits; |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 swap(static_cast<Base&>(a), static_cast<Base&>(b)); | 773 swap(static_cast<Base&>(a), static_cast<Base&>(b)); |
774 swap(a.m_value, b.m_value); | 774 swap(a.m_value, b.m_value); |
775 Allocator::leaveGCForbiddenScope(); | 775 Allocator::leaveGCForbiddenScope(); |
776 } | 776 } |
777 | 777 |
778 } // namespace WTF | 778 } // namespace WTF |
779 | 779 |
780 using WTF::LinkedHashSet; | 780 using WTF::LinkedHashSet; |
781 | 781 |
782 #endif /* WTF_LinkedHashSet_h */ | 782 #endif /* WTF_LinkedHashSet_h */ |
OLD | NEW |