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

Side by Side Diff: tools/clang/blink_gc_plugin/tests/traceimpl_omitted_trace.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 TRACEIMPL_OMITTED_TRACE_H_ 5 #ifndef TRACEIMPL_OMITTED_TRACE_H_
6 #define TRACEIMPL_OMITTED_TRACE_H_ 6 #define TRACEIMPL_OMITTED_TRACE_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 A : public GarbageCollected<A> { 12 class A : public GarbageCollected<A> {
13 public: 13 public:
14 virtual void trace(Visitor* visitor) { traceImpl(visitor); } 14 virtual void Trace(Visitor* visitor) { TraceImpl(visitor); }
15 virtual void trace(InlinedGlobalMarkingVisitor visitor) { 15 virtual void Trace(InlinedGlobalMarkingVisitor visitor) {
16 traceImpl(visitor); 16 TraceImpl(visitor);
17 } 17 }
18 18
19 private: 19 private:
20 template <typename VisitorDispatcher> 20 template <typename VisitorDispatcher>
21 void traceImpl(VisitorDispatcher visitor) {} 21 void TraceImpl(VisitorDispatcher visitor) {}
22 }; 22 };
23 23
24 class B : public A { 24 class B : public A {
25 // trace() isn't necessary because we've got nothing to trace here. 25 // Trace() isn't necessary because we've got nothing to trace here.
26 }; 26 };
27 27
28 class C : public B { 28 class C : public B {
29 public: 29 public:
30 void trace(Visitor* visitor) override { traceImpl(visitor); } 30 void Trace(Visitor* visitor) override { TraceImpl(visitor); }
31 void trace(InlinedGlobalMarkingVisitor visitor) override { 31 void Trace(InlinedGlobalMarkingVisitor visitor) override {
32 traceImpl(visitor); 32 TraceImpl(visitor);
33 } 33 }
34 34
35 private: 35 private:
36 template <typename VisitorDispatcher> 36 template <typename VisitorDispatcher>
37 void traceImpl(VisitorDispatcher visitor) { 37 void TraceImpl(VisitorDispatcher visitor) {
38 // B::trace() is actually A::trace(), and in certain cases we only get 38 // B::Trace() is actually A::Trace(), and in certain cases we only get
39 // limited information like "there is a function call that will be resolved 39 // limited information like "there is a function call that will be resolved
40 // to A::trace()". We still want to mark B as traced. 40 // to A::Trace()". We still want to mark B as Traced.
41 B::trace(visitor); 41 B::Trace(visitor);
42 } 42 }
43 }; 43 };
44 44
45 } 45 }
46 46
47 #endif // TRACEIMPL_OMITTED_TRACE_H_ 47 #endif // TRACEIMPL_OMITTED_TRACE_H_
OLDNEW
« no previous file with comments | « tools/clang/blink_gc_plugin/tests/traceimpl_error.txt ('k') | tools/clang/blink_gc_plugin/tests/traceimpl_overloaded.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698