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

Side by Side Diff: tools/clang/blink_gc_plugin/tests/trace_after_dispatch_impl.cpp

Issue 960873002: Update from https://crrev.com/318214 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "trace_after_dispatch_impl.h"
6
7 namespace blink {
8
9 void TraceAfterDispatchInlinedBase::trace(Visitor* visitor) {
10 // Implement a simple form of manual dispatching, because BlinkGCPlugin gets
11 // angry if dispatching statements are missing.
12 //
13 // This function has to be implemented out-of-line, since we need to know the
14 // definition of derived classes here.
15 if (tag_ == DERIVED) {
16 static_cast<TraceAfterDispatchInlinedDerived*>(this)->traceAfterDispatch(
17 visitor);
18 } else {
19 traceAfterDispatch(visitor);
20 }
21 }
22
23 void TraceAfterDispatchExternBase::trace(Visitor* visitor) {
24 if (tag_ == DERIVED) {
25 static_cast<TraceAfterDispatchExternDerived*>(this)->traceAfterDispatch(
26 visitor);
27 } else {
28 traceAfterDispatch(visitor);
29 }
30 }
31
32 void TraceAfterDispatchExternBase::traceAfterDispatch(Visitor* visitor) {
33 traceAfterDispatchImpl(visitor);
34 }
35
36 template <typename VisitorDispatcher>
37 inline void TraceAfterDispatchExternBase::traceAfterDispatchImpl(
38 VisitorDispatcher visitor) {
39 visitor->trace(x_base_);
40 }
41
42 void TraceAfterDispatchExternDerived::traceAfterDispatch(Visitor* visitor) {
43 traceAfterDispatchImpl(visitor);
44 }
45
46 template <typename VisitorDispatcher>
47 inline void TraceAfterDispatchExternDerived::traceAfterDispatchImpl(
48 VisitorDispatcher visitor) {
49 visitor->trace(x_derived_);
50 TraceAfterDispatchExternBase::traceAfterDispatch(visitor);
51 }
52
53 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698