Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: tools/clang/blink_gc_plugin/tests/finalize_after_dispatch.h

Issue 2578103003: Add use-chromium-style-naming option to Blink GC plugin. (Closed)
Patch Set: Rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef FINALIZE_AFTER_DISPATCH_H_ 5 #ifndef FINALIZE_AFTER_DISPATCH_H_
6 #define FINALIZE_AFTER_DISPATCH_H_ 6 #define FINALIZE_AFTER_DISPATCH_H_
7 7
8 #include "heap/stubs.h" 8 #include "heap/stubs.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 class NeedsFinalize : public GarbageCollectedFinalized<NeedsFinalize> { 12 class NeedsFinalize : public GarbageCollectedFinalized<NeedsFinalize> {
13 public: 13 public:
14 void trace(Visitor*); 14 void Trace(Visitor*);
15 void traceAfterDispatch(Visitor*); 15 void TraceAfterDispatch(Visitor*);
16 // Needs a finalizeGarbageCollectedObject method. 16 // Needs a FinalizeGarbageCollectedObject method.
17 }; 17 };
18 18
19 class NeedsDispatch : public GarbageCollectedFinalized<NeedsDispatch> { 19 class NeedsDispatch : public GarbageCollectedFinalized<NeedsDispatch> {
20 public: 20 public:
21 void trace(Visitor*); 21 void Trace(Visitor*);
22 // Needs a traceAfterDispatch method. 22 // Needs a TraceAfterDispatch method.
23 void finalizeGarbageCollectedObject() { }; 23 void FinalizeGarbageCollectedObject() { };
24 }; 24 };
25 25
26 class NeedsFinalizedBase : public GarbageCollected<NeedsFinalizedBase> { 26 class NeedsFinalizedBase : public GarbageCollected<NeedsFinalizedBase> {
27 public: 27 public:
28 void trace(Visitor*) { }; 28 void Trace(Visitor*) { };
29 void traceAfterDispatch(Visitor*) { }; 29 void TraceAfterDispatch(Visitor*) { };
30 void finalizeGarbageCollectedObject() { }; 30 void FinalizeGarbageCollectedObject() { };
31 }; 31 };
32 32
33 class A : GarbageCollectedFinalized<A> { 33 class A : GarbageCollectedFinalized<A> {
34 public: 34 public:
35 void trace(Visitor*); 35 void Trace(Visitor*);
36 void traceAfterDispatch(Visitor*); 36 void TraceAfterDispatch(Visitor*);
37 void finalizeGarbageCollectedObject(); 37 void FinalizeGarbageCollectedObject();
38 protected: 38 protected:
39 enum Type { TB, TC, TD }; 39 enum Type { TB, TC, TD };
40 A(Type type) : m_type(type) { } 40 A(Type type) : m_type(type) { }
41 private: 41 private:
42 Type m_type; 42 Type m_type;
43 }; 43 };
44 44
45 class B : public A { 45 class B : public A {
46 public: 46 public:
47 B() : A(TB) { } 47 B() : A(TB) { }
48 ~B() { } 48 ~B() { }
49 void traceAfterDispatch(Visitor*); 49 void TraceAfterDispatch(Visitor*);
50 private: 50 private:
51 Member<A> m_a; 51 Member<A> m_a;
52 }; 52 };
53 53
54 class C : public A { 54 class C : public A {
55 public: 55 public:
56 C() : A(TC) { } 56 C() : A(TC) { }
57 void traceAfterDispatch(Visitor*); 57 void TraceAfterDispatch(Visitor*);
58 private: 58 private:
59 Member<A> m_a; 59 Member<A> m_a;
60 }; 60 };
61 61
62 // This class is considered abstract does not need to be dispatched to. 62 // This class is considered abstract does not need to be dispatched to.
63 class Abstract : public A { 63 class Abstract : public A {
64 protected: 64 protected:
65 Abstract(Type type) : A(type) { } 65 Abstract(Type type) : A(type) { }
66 }; 66 };
67 67
68 class D : public Abstract { 68 class D : public Abstract {
69 public: 69 public:
70 D() : Abstract(TD) { } 70 D() : Abstract(TD) { }
71 void traceAfterDispatch(Visitor*); 71 void TraceAfterDispatch(Visitor*);
72 private: 72 private:
73 Member<A> m_a; 73 Member<A> m_a;
74 }; 74 };
75 75
76 } 76 }
77 77
78 #endif 78 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698