Material throbber: use in tabstrip
[chromium-blink-merge.git] / tools / clang / blink_gc_plugin / tests / cycle_ptrs.h
blob8c07a063b82324aa36a495055bb0c0769606fc25
1 // Copyright 2014 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 CYCLE_PTRS_H_
6 #define CYCLE_PTRS_H_
8 #include "heap/stubs.h"
10 namespace blink {
12 class B;
13 class C;
14 class D;
15 class E;
17 // This contains a leaking cycle:
18 // E -per-> A -mem-> B -ref-> C -own-> D -own-vec-> E
20 // The traced cycle from A -> B -> A does not leak.
22 class A : public GarbageCollected<A> {
23 public:
24 virtual void trace(Visitor*);
25 private:
26 Member<B> m_b;
29 class B : public GarbageCollectedFinalized<B> {
30 public:
31 virtual void trace(Visitor*);
32 private:
33 Member<A> m_a;
34 RefPtr<C> m_c;
37 class C : public RefCounted<C> {
38 private:
39 OwnPtr<D> m_d;
42 class D {
43 private:
44 Vector<OwnPtr<E> > m_es;
47 class E {
48 private:
49 Persistent<A> m_a;
54 #endif