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 CLASS_REQUIRES_FINALIZATION_MIXIN_H_
6 #define CLASS_REQUIRES_FINALIZATION_MIXIN_H_
8 #include "heap/stubs.h"
12 class OffHeap
: public RefCounted
<OffHeap
> { };
13 class OnHeap
: public GarbageCollected
<OnHeap
> { };
15 class MixinFinalizable
: public GarbageCollectedMixin
{
17 virtual void trace(Visitor
*) override
;
19 RefPtr
<OffHeap
> m_offHeap
; // Requires finalization
20 Member
<OnHeap
> m_onHeap
;
23 class MixinNotFinalizable
: public GarbageCollectedMixin
{
25 virtual void trace(Visitor
*) override
;
27 Member
<OnHeap
> m_onHeap
;
31 : public GarbageCollected
<NeedsFinalizer
>
32 , public MixinFinalizable
{
33 USING_GARBAGE_COLLECTED_MIXIN(NeedsFinalizer
);
35 virtual void trace(Visitor
*) override
;
40 class HasFinalizer
: public GarbageCollectedFinalized
<HasFinalizer
>,
41 public MixinFinalizable
{
42 USING_GARBAGE_COLLECTED_MIXIN(HasFinalizer
);
44 virtual void trace(Visitor
*) override
;
49 class NeedsNoFinalization
50 : public GarbageCollected
<NeedsNoFinalization
>
51 , public MixinNotFinalizable
52 , public ScriptWrappable
{
53 USING_GARBAGE_COLLECTED_MIXIN(NeedsNoFinalization
);
55 virtual void trace(Visitor
*) override
;