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 #ifndef TRACEIMPL_DEPENDENT_SCOPE_H_ 6 #define TRACEIMPL_DEPENDENT_SCOPE_H_ 7 8 #include "heap/stubs.h" 9 10 namespace blink { 11 12 class X : public GarbageCollected<X> { 13 public: Trace(Visitor *)14 virtual void Trace(Visitor*) {} 15 }; 16 17 template <typename T> 18 class Base : public GarbageCollected<Base<T> > { 19 public: Trace(Visitor * visitor)20 virtual void Trace(Visitor* visitor) {} 21 }; 22 23 template <typename T> 24 class Derived : public Base<T> { 25 public: Trace(Visitor * visitor)26 void Trace(Visitor* visitor) override { Base<T>::Trace(visitor); } 27 }; 28 29 template <typename T> 30 class DerivedMissingTrace : public Base<T> { 31 public: Trace(Visitor * visitor)32 void Trace(Visitor* visitor) override { 33 // Missing Base<T>::Trace(visitor). 34 } 35 }; 36 37 } 38 39 #endif // TRACEIMPL_DEPENDENT_SCOPE_H_ 40