Roll src/third_party/WebKit d10c917:a1123a1 (svn 198729:198730)
[chromium-blink-merge.git] / tools / clang / blink_gc_plugin / tests / destructor_eagerly_finalized.h
blob77a29dea097bdeeac02b11ec22f1d81147ee130b
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.
5 #ifndef DESTRUCTOR_EAGERLY_FINALIZED_H_
6 #define DESTRUCTOR_EAGERLY_FINALIZED_H_
8 #include "heap/stubs.h"
10 namespace blink {
12 class HeapObject : public GarbageCollected<HeapObject> {
13 public:
14 void trace(Visitor*) { }
15 void foo() { }
18 class HeapObjectEagerFinalized
19 : public GarbageCollectedFinalized<HeapObjectEagerFinalized> {
20 public:
21 EAGERLY_FINALIZED();
22 ~HeapObjectEagerFinalized();
23 void trace(Visitor*);
25 void foo() { }
27 private:
28 Member<HeapObject> m_obj;
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*);
39 private:
40 Member<HeapObject> m_heapObject;
41 Member<HeapObjectEagerFinalized> m_heapObjectFinalized;
42 HeapVector<Member<HeapObjectEagerFinalized>> m_heapVector;
45 } // namespace blink
47 #endif // DESTRUCTOR_EAGERLY_FINALIZED_H_