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 2476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2487 EXPECT_EQ(afterGC4.totalObjectSpace(), initialHeapSize.totalObjectSpace()); | 2487 EXPECT_EQ(afterGC4.totalObjectSpace(), initialHeapSize.totalObjectSpace()); |
2488 } | 2488 } |
2489 | 2489 |
2490 class CollectionsEmbeddedClass { | 2490 class CollectionsEmbeddedClass { |
2491 typedef HashSet<Member<IntWrapper>, HeapAllocator> IntSet; | 2491 typedef HashSet<Member<IntWrapper>, HeapAllocator> IntSet; |
2492 typedef HashMap<Member<IntWrapper>, Member<IntWrapper>, HeapAllocator> IntMa
p; | 2492 typedef HashMap<Member<IntWrapper>, Member<IntWrapper>, HeapAllocator> IntMa
p; |
2493 typedef Vector<Member<IntWrapper>, 0, HeapAllocator> IntVector; | 2493 typedef Vector<Member<IntWrapper>, 0, HeapAllocator> IntVector; |
2494 | 2494 |
2495 template<typename T> friend struct FinalizerTrait; | 2495 template<typename T> friend struct FinalizerTrait; |
2496 | 2496 |
2497 class ObjectReferringToCollections : GarbageCollected<ObjectReferringToColle
ctions> { | 2497 class ObjectReferringToCollections : public GarbageCollected<ObjectReferring
ToCollections> { |
2498 DECLARE_GC_INFO | 2498 DECLARE_GC_INFO |
2499 public: | 2499 public: |
2500 void trace(Visitor* visitor) | 2500 void trace(Visitor* visitor) |
2501 { | 2501 { |
2502 visitor->trace(m_set); | 2502 visitor->trace(m_set); |
2503 visitor->trace(m_map); | 2503 visitor->trace(m_map); |
2504 visitor->trace(m_vector); | 2504 visitor->trace(m_vector); |
2505 } | 2505 } |
2506 static ObjectReferringToCollections* create() { return new ObjectReferri
ngToCollections; } | 2506 static ObjectReferringToCollections* create() { return new ObjectReferri
ngToCollections; } |
2507 IntSet* set() { return m_set; } | 2507 IntSet* set() { return m_set; } |
2508 IntMap* map() { return m_map; } | 2508 IntMap* map() { return m_map; } |
2509 IntVector* vector() { return m_vector; } | 2509 IntVector* vector() { return m_vector; } |
2510 private: | 2510 private: |
2511 Member<IntSet> m_set; | 2511 Member<IntSet> m_set; |
2512 Member<IntMap> m_map; | 2512 Member<IntMap> m_map; |
2513 Member<IntVector> m_vector; | 2513 Member<IntVector> m_vector; |
2514 ObjectReferringToCollections() | 2514 ObjectReferringToCollections() |
2515 { | 2515 { |
2516 m_set = new IntSet(); | 2516 m_set = new IntSet(); |
2517 m_map = new IntMap(); | 2517 m_map = new IntMap(); |
2518 m_vector = new IntVector(); | 2518 m_vector = new IntVector(); |
2519 } | 2519 } |
2520 }; | 2520 }; |
2521 | 2521 |
2522 class ObjectContainingCollections : GarbageCollected<ObjectContainingCollect
ions> { | 2522 class ObjectContainingCollections : public GarbageCollected<ObjectContaining
Collections> { |
2523 DECLARE_GC_INFO | 2523 DECLARE_GC_INFO |
2524 public: | 2524 public: |
2525 IntSet m_set; | 2525 IntSet m_set; |
2526 IntMap m_map; | 2526 IntMap m_map; |
2527 IntVector m_vector; | 2527 IntVector m_vector; |
2528 void trace(Visitor* visitor) | 2528 void trace(Visitor* visitor) |
2529 { | 2529 { |
2530 visitor->trace(m_set); | 2530 visitor->trace(m_set); |
2531 visitor->trace(m_map); | 2531 visitor->trace(m_map); |
2532 visitor->trace(m_vector); | 2532 visitor->trace(m_vector); |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2806 { | 2806 { |
2807 HeapTester::checkAndMarkPointer(); | 2807 HeapTester::checkAndMarkPointer(); |
2808 } | 2808 } |
2809 | 2809 |
2810 TEST(heap, HeapCollectionWithFinalizers) | 2810 TEST(heap, HeapCollectionWithFinalizers) |
2811 { | 2811 { |
2812 HeapTester::heapCollectionWithFinalizers(); | 2812 HeapTester::heapCollectionWithFinalizers(); |
2813 } | 2813 } |
2814 | 2814 |
2815 } // namespace WebCore | 2815 } // namespace WebCore |
OLD | NEW |