Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: tools/clang/blink_gc_plugin/tests/class_requires_finalization_mixin.h

Issue 192933002: Check that classes with non-trivial destructors have finalization support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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 CLASS_REQUIRES_FINALIZATION_MIXIN_H_
6 #define CLASS_REQUIRES_FINALIZATION_MIXIN_H_
7
8 #include "heap/stubs.h"
9
10 namespace WebCore {
11
12 class OffHeap : public RefCounted<OffHeap> { };
13 class OnHeap : public GarbageCollected<OnHeap> { };
14
15 class Mixin : public GarbageCollectedMixin {
16 public:
17 void trace(Visitor*);
18 private:
19 RefPtr<OffHeap> m_offHeap; // Requires finalization
20 Member<OnHeap> m_onHeap;
21 };
22
23 class NeedsFinalizer : public GarbageCollected<NeedsFinalizer>, public Mixin {
24 USING_GARBAGE_COLLECTED_MIXIN(NeedsFinalizer);
25 public:
26 void trace(Visitor*);
27 private:
28 Member<OnHeap> m_obj;
29 };
30
31 class HasFinalizer : public GarbageCollectedFinalized<HasFinalizer>,
32 public Mixin {
33 USING_GARBAGE_COLLECTED_MIXIN(HasFinalizer);
34 public:
35 void trace(Visitor*);
36 private:
37 Member<OnHeap> m_obj;
38 };
39
40 }
41
42 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698