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 5555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5566 | 5566 |
5567 } // namespace WTF | 5567 } // namespace WTF |
5568 | 5568 |
5569 namespace blink { | 5569 namespace blink { |
5570 | 5570 |
5571 TEST(HeapTest, GCInHashMapOperations) { | 5571 TEST(HeapTest, GCInHashMapOperations) { |
5572 typedef HeapHashMap<AllocatesOnAssignment, AllocatesOnAssignment> Map; | 5572 typedef HeapHashMap<AllocatesOnAssignment, AllocatesOnAssignment> Map; |
5573 Map* map = new Map(); | 5573 Map* map = new Map(); |
5574 IntWrapper* key = new IntWrapper(42); | 5574 IntWrapper* key = new IntWrapper(42); |
5575 map->add(key, AllocatesOnAssignment(103)); | 5575 map->add(key, AllocatesOnAssignment(103)); |
5576 map->remove(key); | 5576 map->erase(key); |
5577 for (int i = 0; i < 10; i++) | 5577 for (int i = 0; i < 10; i++) |
5578 map->add(AllocatesOnAssignment(i), AllocatesOnAssignment(i)); | 5578 map->add(AllocatesOnAssignment(i), AllocatesOnAssignment(i)); |
5579 for (Map::iterator it = map->begin(); it != map->end(); ++it) | 5579 for (Map::iterator it = map->begin(); it != map->end(); ++it) |
5580 EXPECT_EQ(it->key.value(), it->value.value()); | 5580 EXPECT_EQ(it->key.value(), it->value.value()); |
5581 } | 5581 } |
5582 | 5582 |
5583 class PartObjectWithVirtualMethod { | 5583 class PartObjectWithVirtualMethod { |
5584 public: | 5584 public: |
5585 DEFINE_INLINE_VIRTUAL_TRACE() {} | 5585 DEFINE_INLINE_VIRTUAL_TRACE() {} |
5586 }; | 5586 }; |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6376 "HeapVector"); | 6376 "HeapVector"); |
6377 static_assert( | 6377 static_assert( |
6378 WTF::IsGarbageCollectedType<HeapDeque<Member<IntWrapper>>>::value, | 6378 WTF::IsGarbageCollectedType<HeapDeque<Member<IntWrapper>>>::value, |
6379 "HeapDeque"); | 6379 "HeapDeque"); |
6380 static_assert(WTF::IsGarbageCollectedType< | 6380 static_assert(WTF::IsGarbageCollectedType< |
6381 HeapTerminatedArray<Member<IntWrapper>>>::value, | 6381 HeapTerminatedArray<Member<IntWrapper>>>::value, |
6382 "HeapTerminatedArray"); | 6382 "HeapTerminatedArray"); |
6383 } | 6383 } |
6384 | 6384 |
6385 } // namespace blink | 6385 } // namespace blink |
OLD | NEW |