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_OMITTED_TRACE_H_ 6 #define TRACEIMPL_OMITTED_TRACE_H_ 7 8 #include "heap/stubs.h" 9 10 namespace blink { 11 12 class A : public GarbageCollected<A> { 13 public: Trace(Visitor * visitor)14 virtual void Trace(Visitor* visitor) {} 15 }; 16 17 class B : public A { 18 // Trace() isn't necessary because we've got nothing to trace here. 19 }; 20 21 class C : public B { 22 public: Trace(Visitor * visitor)23 void Trace(Visitor* visitor) override { 24 // B::Trace() is actually A::Trace(), and in certain cases we only get 25 // limited information like "there is a function call that will be resolved 26 // to A::Trace()". We still want to mark B as Traced. 27 B::Trace(visitor); 28 } 29 }; 30 31 } 32 33 #endif // TRACEIMPL_OMITTED_TRACE_H_ 34