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.
5 #ifndef TRACEIMPL_DEPENDENT_SCOPE_H_
6 #define TRACEIMPL_DEPENDENT_SCOPE_H_
8 #include "heap/stubs.h"
12 class X
: public GarbageCollected
<X
> {
14 virtual void trace(Visitor
*) {}
18 class Base
: public GarbageCollected
<Base
<T
> > {
20 virtual void trace(Visitor
* visitor
) { traceImpl(visitor
); }
21 virtual void trace(InlinedGlobalMarkingVisitor visitor
) {
26 template <typename VisitorDispatcher
>
27 void traceImpl(VisitorDispatcher visitor
) {}
31 class Derived
: public Base
<T
> {
33 void trace(Visitor
* visitor
) override
{ traceImpl(visitor
); }
34 void trace(InlinedGlobalMarkingVisitor visitor
) override
{
39 template <typename VisitorDispatcher
>
40 void traceImpl(VisitorDispatcher visitor
) {
41 Base
<T
>::trace(visitor
);
46 class DerivedMissingTrace
: public Base
<T
> {
48 void trace(Visitor
* visitor
) override
{ traceImpl(visitor
); }
49 void trace(InlinedGlobalMarkingVisitor visitor
) override
{
54 template <typename VisitorDispatcher
>
55 void traceImpl(VisitorDispatcher visitor
) {
56 // Missing Base<T>::trace(visitor).
62 #endif // TRACEIMPL_DEPENDENT_SCOPE_H_