Roll src/third_party/WebKit f36d5e0:68b67cd (svn 193299:193303)
[chromium-blink-merge.git] / tools / clang / blink_gc_plugin / tests / cycle_sub.h
bloba007061e1ce3572becdd85fe6fa03064fc4126da
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_SUB_H_
6 #define CYCLE_SUB_H_
8 #include "heap/stubs.h"
10 namespace blink {
12 class C;
14 // This contains a leaking cycle:
15 // C -per-> A -sub-> B -ref-> C
17 class A : public GarbageCollectedFinalized<A> {
18 public:
19 virtual void trace(Visitor*) {}
22 class B : public A {
23 public:
24 virtual void trace(Visitor*);
25 private:
26 RefPtr<C> m_c;
29 class C : public RefCounted<C> {
30 private:
31 Persistent<A> m_a;
36 #endif