OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef DESTRUCTOR_EAGERLY_FINALIZED_H_ |
| 6 #define DESTRUCTOR_EAGERLY_FINALIZED_H_ |
| 7 |
| 8 #include "heap/stubs.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 class HeapObject : public GarbageCollected<HeapObject> { |
| 13 public: |
| 14 void trace(Visitor*) { } |
| 15 void foo() { } |
| 16 }; |
| 17 |
| 18 class HeapObjectEagerFinalized |
| 19 : public GarbageCollectedFinalized<HeapObjectEagerFinalized> { |
| 20 public: |
| 21 EAGERLY_FINALIZED(); |
| 22 ~HeapObjectEagerFinalized(); |
| 23 void trace(Visitor*); |
| 24 |
| 25 void foo() { } |
| 26 |
| 27 private: |
| 28 Member<HeapObject> m_obj; |
| 29 }; |
| 30 |
| 31 // Accessing other eagerly finalized objects during finalization is not allowed. |
| 32 class HeapObjectEagerFinalizedAlso |
| 33 : public GarbageCollectedFinalized<HeapObjectEagerFinalizedAlso> { |
| 34 public: |
| 35 EAGERLY_FINALIZED(); |
| 36 ~HeapObjectEagerFinalizedAlso(); |
| 37 void trace(Visitor*); |
| 38 |
| 39 private: |
| 40 Member<HeapObject> m_heapObject; |
| 41 Member<HeapObjectEagerFinalized> m_heapObjectFinalized; |
| 42 HeapVector<Member<HeapObjectEagerFinalized>> m_heapVector; |
| 43 }; |
| 44 |
| 45 } // namespace blink |
| 46 |
| 47 #endif // DESTRUCTOR_EAGERLY_FINALIZED_H_ |
OLD | NEW |