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 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 { | 846 { |
847 } | 847 } |
848 }; | 848 }; |
849 | 849 |
850 int RefCountedAndGarbageCollected::s_destructorCalls = 0; | 850 int RefCountedAndGarbageCollected::s_destructorCalls = 0; |
851 | 851 |
852 class RefCountedAndGarbageCollected2 : public HeapTestOtherSuperClass, public Re
fCountedGarbageCollected<RefCountedAndGarbageCollected2> { | 852 class RefCountedAndGarbageCollected2 : public HeapTestOtherSuperClass, public Re
fCountedGarbageCollected<RefCountedAndGarbageCollected2> { |
853 public: | 853 public: |
854 static RefCountedAndGarbageCollected2* create() | 854 static RefCountedAndGarbageCollected2* create() |
855 { | 855 { |
856 return adoptRefCountedGarbageCollected(new RefCountedAndGarbageCollected
2()); | 856 return new RefCountedAndGarbageCollected2(); |
857 } | 857 } |
858 | 858 |
859 ~RefCountedAndGarbageCollected2() | 859 ~RefCountedAndGarbageCollected2() |
860 { | 860 { |
861 ++s_destructorCalls; | 861 ++s_destructorCalls; |
862 } | 862 } |
863 | 863 |
864 void trace(Visitor*) { } | 864 void trace(Visitor*) { } |
865 | 865 |
866 static int s_destructorCalls; | 866 static int s_destructorCalls; |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1229 private: | 1229 private: |
1230 OwnPtrWillBeMember<SubData> m_data; | 1230 OwnPtrWillBeMember<SubData> m_data; |
1231 }; | 1231 }; |
1232 | 1232 |
1233 int SubClass::s_aliveCount = 0; | 1233 int SubClass::s_aliveCount = 0; |
1234 | 1234 |
1235 class TransitionRefCounted : public RefCountedWillBeRefCountedGarbageCollected<T
ransitionRefCounted> { | 1235 class TransitionRefCounted : public RefCountedWillBeRefCountedGarbageCollected<T
ransitionRefCounted> { |
1236 public: | 1236 public: |
1237 static PassRefPtrWillBeRawPtr<TransitionRefCounted> create() | 1237 static PassRefPtrWillBeRawPtr<TransitionRefCounted> create() |
1238 { | 1238 { |
1239 return adoptRefWillBeRefCountedGarbageCollected(new TransitionRefCounted
()); | 1239 return adoptRefWillBeNoop(new TransitionRefCounted()); |
1240 } | 1240 } |
1241 | 1241 |
1242 ~TransitionRefCounted() | 1242 ~TransitionRefCounted() |
1243 { | 1243 { |
1244 --s_aliveCount; | 1244 --s_aliveCount; |
1245 } | 1245 } |
1246 | 1246 |
1247 void trace(Visitor* visitor) { } | 1247 void trace(Visitor* visitor) { } |
1248 | 1248 |
1249 static int s_aliveCount; | 1249 static int s_aliveCount; |
(...skipping 4082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5332 TEST(HeapTest, NonNodeAllocatingNodeInDestructor) | 5332 TEST(HeapTest, NonNodeAllocatingNodeInDestructor) |
5333 { | 5333 { |
5334 new NonNodeAllocatingNodeInDestructor(); | 5334 new NonNodeAllocatingNodeInDestructor(); |
5335 Heap::collectGarbage(ThreadState::NoHeapPointersOnStack); | 5335 Heap::collectGarbage(ThreadState::NoHeapPointersOnStack); |
5336 EXPECT_EQ(10, (*NonNodeAllocatingNodeInDestructor::s_node)->value()); | 5336 EXPECT_EQ(10, (*NonNodeAllocatingNodeInDestructor::s_node)->value()); |
5337 delete NonNodeAllocatingNodeInDestructor::s_node; | 5337 delete NonNodeAllocatingNodeInDestructor::s_node; |
5338 NonNodeAllocatingNodeInDestructor::s_node = 0; | 5338 NonNodeAllocatingNodeInDestructor::s_node = 0; |
5339 } | 5339 } |
5340 | 5340 |
5341 } // namespace blink | 5341 } // namespace blink |
OLD | NEW |