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

Side by Side Diff: tools/clang/blink_gc_plugin/tests/legacy_naming/traceimpl.h

Issue 2655933002: blink_gc_plugin: retire overloaded traceImpl detection and handling. (Closed)
Patch Set: Created 3 years, 11 months 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 TRACEIMPL_H_ 5 #ifndef TRACEIMPL_H_
6 #define TRACEIMPL_H_ 6 #define TRACEIMPL_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 X : public GarbageCollected<X> { 12 class X : public GarbageCollected<X> {
13 public: 13 public:
14 virtual void trace(Visitor*) {} 14 virtual void trace(Visitor*) {}
15 }; 15 };
16 16
17 class TraceImplInlined : public GarbageCollected<TraceImplInlined> { 17 class TraceImplInlined : public GarbageCollected<TraceImplInlined> {
18 public: 18 public:
19 void trace(Visitor* visitor) { traceImpl(visitor); } 19 void trace(Visitor* visitor) { visitor->trace(x_); }
20
21 template <typename VisitorDispatcher>
22 void traceImpl(VisitorDispatcher visitor) {
23 visitor->trace(x_);
24 }
25 20
26 private: 21 private:
27 Member<X> x_; 22 Member<X> x_;
28 }; 23 };
29 24
30 class TraceImplExtern : public GarbageCollected<TraceImplExtern> { 25 class TraceImplExtern : public GarbageCollected<TraceImplExtern> {
31 public: 26 public:
32 void trace(Visitor* visitor); 27 void trace(Visitor* visitor);
33 template <typename VisitorDispatcher>
34 inline void traceImpl(VisitorDispatcher);
35 28
36 private: 29 private:
37 Member<X> x_; 30 Member<X> x_;
38 }; 31 };
39 32
40 class Base : public GarbageCollected<Base> { 33 class Base : public GarbageCollected<Base> {
41 public: 34 public:
42 virtual void trace(Visitor* visitor) {} 35 virtual void trace(Visitor* visitor) {}
43 }; 36 };
44 37
45 class TraceImplBaseInlined : public Base { 38 class TraceImplBaseInlined : public Base {
46 public: 39 public:
47 void trace(Visitor* visitor) override { traceImpl(visitor); } 40 void trace(Visitor* visitor) override { Base::trace(visitor); }
48
49 template <typename VisitorDispatcher>
50 void traceImpl(VisitorDispatcher visitor) {
51 Base::trace(visitor);
52 }
53 }; 41 };
54 42
55 class TraceImplBaseExtern : public Base { 43 class TraceImplBaseExtern : public Base {
56 public: 44 public:
57 void trace(Visitor* visitor) override; 45 void trace(Visitor* visitor) override;
58 46
59 template <typename VisitorDispatcher>
60 void traceImpl(VisitorDispatcher);
61
62 private: 47 private:
63 Member<X> x_; 48 Member<X> x_;
64 }; 49 };
65 50
66 } 51 }
67 52
68 #endif 53 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698