| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 { | 297 { |
| 298 OffHeapCollectionTraceTrait<Vector<T, inlineCapacity, WTF::DefaultAlloca
tor> >::trace(this, vector); | 298 OffHeapCollectionTraceTrait<Vector<T, inlineCapacity, WTF::DefaultAlloca
tor> >::trace(this, vector); |
| 299 } | 299 } |
| 300 | 300 |
| 301 template<typename T, typename U, typename V> | 301 template<typename T, typename U, typename V> |
| 302 void trace(const HashSet<T, U, V>& hashSet) | 302 void trace(const HashSet<T, U, V>& hashSet) |
| 303 { | 303 { |
| 304 OffHeapCollectionTraceTrait<HashSet<T, U, V> >::trace(this, hashSet); | 304 OffHeapCollectionTraceTrait<HashSet<T, U, V> >::trace(this, hashSet); |
| 305 } | 305 } |
| 306 | 306 |
| 307 template<typename T, size_t inlineCapacity, typename U> | |
| 308 void trace(const ListHashSet<T, inlineCapacity, U>& hashSet) | |
| 309 { | |
| 310 OffHeapCollectionTraceTrait<ListHashSet<T, inlineCapacity, U> >::trace(t
his, hashSet); | |
| 311 } | |
| 312 | |
| 313 template<typename T, size_t N> | 307 template<typename T, size_t N> |
| 314 void trace(const Deque<T, N>& deque) | 308 void trace(const Deque<T, N>& deque) |
| 315 { | 309 { |
| 316 OffHeapCollectionTraceTrait<Deque<T, N> >::trace(this, deque); | 310 OffHeapCollectionTraceTrait<Deque<T, N> >::trace(this, deque); |
| 317 } | 311 } |
| 318 | 312 |
| 319 template<typename T, typename U, typename V, typename W, typename X> | 313 template<typename T, typename U, typename V, typename W, typename X> |
| 320 void trace(const HashMap<T, U, V, W, X, WTF::DefaultAllocator>& map) | 314 void trace(const HashMap<T, U, V, W, X, WTF::DefaultAllocator>& map) |
| 321 { | 315 { |
| 322 OffHeapCollectionTraceTrait<HashMap<T, U, V, W, X, WTF::DefaultAllocator
> >::trace(this, map); | 316 OffHeapCollectionTraceTrait<HashMap<T, U, V, W, X, WTF::DefaultAllocator
> >::trace(this, map); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 HashSet& iterSet = const_cast<HashSet&>(set); | 457 HashSet& iterSet = const_cast<HashSet&>(set); |
| 464 for (typename HashSet::iterator it = iterSet.begin(), end = iterSet.
end(); it != end; ++it) { | 458 for (typename HashSet::iterator it = iterSet.begin(), end = iterSet.
end(); it != end; ++it) { |
| 465 const T& t = *it; | 459 const T& t = *it; |
| 466 CollectionBackingTraceTrait<WTF::ShouldBeTraced<Traits>::value,
Traits::weakHandlingFlag, WTF::WeakPointersActWeak, T, Traits>::trace(visitor, c
onst_cast<T&>(t)); | 460 CollectionBackingTraceTrait<WTF::ShouldBeTraced<Traits>::value,
Traits::weakHandlingFlag, WTF::WeakPointersActWeak, T, Traits>::trace(visitor, c
onst_cast<T&>(t)); |
| 467 } | 461 } |
| 468 } | 462 } |
| 469 COMPILE_ASSERT(Traits::weakHandlingFlag == WTF::NoWeakHandlingInCollecti
ons, WeakOffHeapCollectionsConsideredDangerous0); | 463 COMPILE_ASSERT(Traits::weakHandlingFlag == WTF::NoWeakHandlingInCollecti
ons, WeakOffHeapCollectionsConsideredDangerous0); |
| 470 } | 464 } |
| 471 }; | 465 }; |
| 472 | 466 |
| 473 template<typename T, size_t inlineCapacity, typename HashFunctions> | |
| 474 struct OffHeapCollectionTraceTrait<ListHashSet<T, inlineCapacity, HashFunctions>
> { | |
| 475 typedef WTF::ListHashSet<T, inlineCapacity, HashFunctions> ListHashSet; | |
| 476 | |
| 477 static void trace(Visitor* visitor, const ListHashSet& set) | |
| 478 { | |
| 479 if (set.isEmpty()) | |
| 480 return; | |
| 481 ListHashSet& iterSet = const_cast<ListHashSet&>(set); | |
| 482 for (typename ListHashSet::iterator it = iterSet.begin(), end = iterSet.
end(); it != end; ++it) | |
| 483 visitor->trace(*it); | |
| 484 } | |
| 485 }; | |
| 486 | |
| 487 template<typename Key, typename Value, typename HashFunctions, typename KeyTrait
s, typename ValueTraits> | 467 template<typename Key, typename Value, typename HashFunctions, typename KeyTrait
s, typename ValueTraits> |
| 488 struct OffHeapCollectionTraceTrait<WTF::HashMap<Key, Value, HashFunctions, KeyTr
aits, ValueTraits, WTF::DefaultAllocator> > { | 468 struct OffHeapCollectionTraceTrait<WTF::HashMap<Key, Value, HashFunctions, KeyTr
aits, ValueTraits, WTF::DefaultAllocator> > { |
| 489 typedef WTF::HashMap<Key, Value, HashFunctions, KeyTraits, ValueTraits, WTF:
:DefaultAllocator> HashMap; | 469 typedef WTF::HashMap<Key, Value, HashFunctions, KeyTraits, ValueTraits, WTF:
:DefaultAllocator> HashMap; |
| 490 | 470 |
| 491 static void trace(Visitor* visitor, const HashMap& map) | 471 static void trace(Visitor* visitor, const HashMap& map) |
| 492 { | 472 { |
| 493 if (map.isEmpty()) | 473 if (map.isEmpty()) |
| 494 return; | 474 return; |
| 495 if (WTF::ShouldBeTraced<KeyTraits>::value || WTF::ShouldBeTraced<ValueTr
aits>::value) { | 475 if (WTF::ShouldBeTraced<KeyTraits>::value || WTF::ShouldBeTraced<ValueTr
aits>::value) { |
| 496 HashMap& iterMap = const_cast<HashMap&>(map); | 476 HashMap& iterMap = const_cast<HashMap&>(map); |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 struct GCInfoTrait { | 683 struct GCInfoTrait { |
| 704 static const GCInfo* get() | 684 static const GCInfo* get() |
| 705 { | 685 { |
| 706 return GCInfoAtBase<typename GetGarbageCollectedBase<T>::type>::get(); | 686 return GCInfoAtBase<typename GetGarbageCollectedBase<T>::type>::get(); |
| 707 } | 687 } |
| 708 }; | 688 }; |
| 709 | 689 |
| 710 } | 690 } |
| 711 | 691 |
| 712 #endif | 692 #endif |
| OLD | NEW |