1 // Copyright 2017 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 OPTIONAL_GC_OBJECT_H_ 6 #define OPTIONAL_GC_OBJECT_H_ 7 8 #include "heap/stubs.h" 9 10 namespace blink { 11 12 class Base : public GarbageCollected<Base> { 13 public: Trace(Visitor *)14 virtual void Trace(Visitor*) {} 15 }; 16 17 class Derived : public Base { 18 public: Trace(Visitor * visitor)19 void Trace(Visitor* visitor) override { Base::Trace(visitor); } 20 }; 21 22 class Mixin : public GarbageCollectedMixin { 23 public: Trace(Visitor *)24 void Trace(Visitor*) {} 25 }; 26 27 } // namespace blink 28 29 #endif // OPTIONAL_GC_OBJECT_H_ 30