Home | History | Annotate | Download | only in tests
      1 // Copyright 2014 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_H_
      6 #define TRACEIMPL_H_
      7 
      8 #include "heap/stubs.h"
      9 
     10 namespace blink {
     11 
     12 class X : public GarbageCollected<X> {
     13  public:
     14   virtual void Trace(Visitor*) {}
     15 };
     16 
     17 class TraceImplInlined : public GarbageCollected<TraceImplInlined> {
     18  public:
     19   void Trace(Visitor* visitor) { visitor->Trace(x_); }
     20 
     21  private:
     22   Member<X> x_;
     23 };
     24 
     25 class TraceImplExtern : public GarbageCollected<TraceImplExtern> {
     26  public:
     27   void Trace(Visitor* visitor);
     28 
     29  private:
     30   Member<X> x_;
     31 };
     32 
     33 class Base : public GarbageCollected<Base> {
     34  public:
     35   virtual void Trace(Visitor* visitor) {}
     36 };
     37 
     38 class TraceImplBaseInlined : public Base {
     39  public:
     40   void Trace(Visitor* visitor) override { Base::Trace(visitor); }
     41 };
     42 
     43 class TraceImplBaseExtern : public Base {
     44  public:
     45   void Trace(Visitor* visitor) override;
     46 
     47  private:
     48   Member<X> x_;
     49 };
     50 
     51 }
     52 
     53 #endif
     54