OLD | NEW |
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 #include "trace_after_dispatch_impl_error.h" | 5 #include "trace_after_dispatch_impl_error.h" |
6 | 6 |
7 namespace blink { | 7 namespace blink { |
8 | 8 |
9 template <typename VisitorDispatcher> | 9 inline void TraceAfterDispatchInlinedBase::trace(Visitor* visitor) { |
10 inline void TraceAfterDispatchInlinedBase::traceImpl( | |
11 VisitorDispatcher visitor) { | |
12 // Implement a simple form of manual dispatching, because BlinkGCPlugin | 10 // Implement a simple form of manual dispatching, because BlinkGCPlugin |
13 // checks if the tracing is dispatched to all derived classes. | 11 // checks if the tracing is dispatched to all derived classes. |
14 // | 12 // |
15 // This function has to be implemented out-of-line, since we need to know the | 13 // This function has to be implemented out-of-line, since we need to know the |
16 // definition of derived classes here. | 14 // definition of derived classes here. |
17 if (tag_ == DERIVED) { | 15 if (tag_ == DERIVED) { |
18 // Missing dispatch call: | 16 // Missing dispatch call: |
19 // static_cast<TraceAfterDispatchInlinedDerived*>(this)->traceAfterDispatch( | 17 // static_cast<TraceAfterDispatchInlinedDerived*>(this)->traceAfterDispatch( |
20 // visitor); | 18 // visitor); |
21 } else { | 19 } else { |
22 traceAfterDispatch(visitor); | 20 traceAfterDispatch(visitor); |
23 } | 21 } |
24 } | 22 } |
25 | 23 |
26 void TraceAfterDispatchExternBase::trace(Visitor* visitor) { | 24 void TraceAfterDispatchExternBase::trace(Visitor* visitor) { |
27 traceImpl(visitor); | |
28 } | |
29 | |
30 void TraceAfterDispatchExternBase::trace(InlinedGlobalMarkingVisitor visitor) { | |
31 traceImpl(visitor); | |
32 } | |
33 | |
34 template <typename VisitorDispatcher> | |
35 inline void TraceAfterDispatchExternBase::traceImpl(VisitorDispatcher visitor) { | |
36 if (tag_ == DERIVED) { | 25 if (tag_ == DERIVED) { |
37 // Missing dispatch call: | 26 // Missing dispatch call: |
38 // static_cast<TraceAfterDispatchExternDerived*>(this)->traceAfterDispatch( | 27 // static_cast<TraceAfterDispatchExternDerived*>(this)->traceAfterDispatch( |
39 // visitor); | 28 // visitor); |
40 } else { | 29 } else { |
41 traceAfterDispatch(visitor); | 30 traceAfterDispatch(visitor); |
42 } | 31 } |
43 } | 32 } |
44 | 33 |
45 void TraceAfterDispatchExternBase::traceAfterDispatch(Visitor* visitor) { | 34 void TraceAfterDispatchExternBase::traceAfterDispatch(Visitor* visitor) { |
46 traceAfterDispatchImpl(visitor); | |
47 } | |
48 | |
49 void TraceAfterDispatchExternBase::traceAfterDispatch( | |
50 InlinedGlobalMarkingVisitor visitor) { | |
51 traceAfterDispatchImpl(visitor); | |
52 } | |
53 | |
54 template <typename VisitorDispatcher> | |
55 inline void TraceAfterDispatchExternBase::traceAfterDispatchImpl( | |
56 VisitorDispatcher visitor) { | |
57 // No trace call. | 35 // No trace call. |
58 } | 36 } |
59 | 37 |
60 void TraceAfterDispatchExternDerived::traceAfterDispatch(Visitor* visitor) { | 38 void TraceAfterDispatchExternDerived::traceAfterDispatch(Visitor* visitor) { |
61 traceAfterDispatchImpl(visitor); | |
62 } | |
63 | |
64 void TraceAfterDispatchExternDerived::traceAfterDispatch( | |
65 InlinedGlobalMarkingVisitor visitor) { | |
66 traceAfterDispatchImpl(visitor); | |
67 } | |
68 | |
69 template <typename VisitorDispatcher> | |
70 inline void TraceAfterDispatchExternDerived::traceAfterDispatchImpl( | |
71 VisitorDispatcher visitor) { | |
72 // Ditto. | 39 // Ditto. |
73 } | 40 } |
74 | 41 |
75 } | 42 } |
OLD | NEW |