Roll src/third_party/WebKit d10c917:a1123a1 (svn 198729:198730)
[chromium-blink-merge.git] / tools / clang / blink_gc_plugin / tests / cycle_super.h
blob13b05c12a6b99c44793291a2b2da711eaef086a4
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_SUPER_H_
6 #define CYCLE_SUPER_H_
8 #include "heap/stubs.h"
10 namespace blink {
12 class D;
14 // This contains a leaking cycle:
15 // D -per-> C -sup-> B -sup-> A -ref-> D
17 class A : public GarbageCollectedFinalized<A> {
18 public:
19 virtual void trace(Visitor*);
20 private:
21 RefPtr<D> m_d;
24 class B : public A {
25 public:
26 virtual void trace(Visitor*);
29 class C : public B {
30 public:
31 virtual void trace(Visitor*);
34 class D : public RefCounted<C> {
35 private:
36 Persistent<C> m_c;
41 #endif