Roll src/third_party/WebKit d10c917:a1123a1 (svn 198729:198730)
[chromium-blink-merge.git] / tools / clang / blink_gc_plugin / tests / trace_templated_super.h
blobde8fd7b4c58d1e73b485cfefd23db643d459c835
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 TRACE_TEMPLATED_SUPER_H_
6 #define TRACE_TEMPLATED_SUPER_H_
8 #include "heap/stubs.h"
10 namespace blink {
12 class HeapObject;
14 class Mixin : public GarbageCollectedMixin {
15 public:
16 virtual void trace(Visitor*) override { }
19 template<typename T>
20 class Super : public GarbageCollected<Super<T> >, public Mixin {
21 USING_GARBAGE_COLLECTED_MIXIN(Super);
22 public:
23 virtual void trace(Visitor*) override;
24 void clearWeakMembers(Visitor*);
25 private:
26 Member<HeapObject> m_obj;
27 WeakMember<HeapObject> m_weak;
30 template<typename T>
31 class Sub : public Super<T> {
32 public:
33 virtual void trace(Visitor* visitor) override;
34 private:
35 Member<HeapObject> m_obj;
38 class HeapObject : public Sub<HeapObject> {
39 public:
40 virtual void trace(Visitor*) override;
41 private:
42 Member<HeapObject> m_obj;
47 #endif