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.
5 #ifndef FINALIZE_AFTER_DISPATCH_H_
6 #define FINALIZE_AFTER_DISPATCH_H_
8 #include "heap/stubs.h"
12 class NeedsFinalize
: public GarbageCollectedFinalized
<NeedsFinalize
> {
15 void traceAfterDispatch(Visitor
*);
16 // Needs a finalizeGarbageCollectedObject method.
19 class NeedsDispatch
: public GarbageCollectedFinalized
<NeedsDispatch
> {
22 // Needs a traceAfterDispatch method.
23 void finalizeGarbageCollectedObject() { };
26 class NeedsFinalizedBase
: public GarbageCollected
<NeedsFinalizedBase
> {
28 void trace(Visitor
*) { };
29 void traceAfterDispatch(Visitor
*) { };
30 void finalizeGarbageCollectedObject() { };
33 class A
: GarbageCollectedFinalized
<A
> {
36 void traceAfterDispatch(Visitor
*);
37 void finalizeGarbageCollectedObject();
39 enum Type
{ TB
, TC
, TD
};
40 A(Type type
) : m_type(type
) { }
49 void traceAfterDispatch(Visitor
*);
57 void traceAfterDispatch(Visitor
*);
62 // This class is considered abstract does not need to be dispatched to.
63 class Abstract
: public A
{
65 Abstract(Type type
) : A(type
) { }
68 class D
: public Abstract
{
70 D() : Abstract(TD
) { }
71 void traceAfterDispatch(Visitor
*);