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

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

Issue 374593002: Support ignorance of base class finalizers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use early returns instead of fallthrough Created 6 years, 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CLASS_REQUIRES_FINALIZATION_H_ 5 #ifndef CLASS_REQUIRES_FINALIZATION_H_
6 #define CLASS_REQUIRES_FINALIZATION_H_ 6 #define CLASS_REQUIRES_FINALIZATION_H_
7 7
8 #include "heap/stubs.h" 8 #include "heap/stubs.h"
9 9
10 namespace WebCore { 10 namespace WebCore {
(...skipping 23 matching lines...) Expand all
34 template<> 34 template<>
35 struct VectorTraits<WebCore::C> { 35 struct VectorTraits<WebCore::C> {
36 static const bool needsDestruction = false; 36 static const bool needsDestruction = false;
37 }; 37 };
38 38
39 } // WTF namespace 39 } // WTF namespace
40 40
41 namespace WebCore { 41 namespace WebCore {
42 42
43 // Off-heap vectors always need to be finalized. 43 // Off-heap vectors always need to be finalized.
44 class NeedsFinalizer : public A { 44 class NeedsFinalizer : public A, public ScriptWrappable {
45 public: 45 public:
46 void trace(Visitor*); 46 void trace(Visitor*);
47 private: 47 private:
48 Vector<Member<A> > m_as; 48 Vector<Member<A> > m_as;
49 }; 49 };
50 50
51 // On-heap vectors with inlined objects that need destruction 51 // On-heap vectors with inlined objects that need destruction
52 // need to be finalized. 52 // need to be finalized.
53 class AlsoNeedsFinalizer : public A { 53 class AlsoNeedsFinalizer : public A {
54 public: 54 public:
55 void trace(Visitor*); 55 void trace(Visitor*);
56 private: 56 private:
57 HeapVector<B, 10> m_bs; 57 HeapVector<B, 10> m_bs;
58 }; 58 };
59 59
60 // On-heap vectors with no inlined objects never need to be finalized. 60 // On-heap vectors with no inlined objects never need to be finalized.
61 class DoesNotNeedFinalizer : public A { 61 class DoesNotNeedFinalizer : public A, public ScriptWrappable {
62 public: 62 public:
63 void trace(Visitor*); 63 void trace(Visitor*);
64 private: 64 private:
65 HeapVector<B> m_bs; 65 HeapVector<B> m_bs;
66 }; 66 };
67 67
68 // On-heap vectors with inlined objects that don't need destruction 68 // On-heap vectors with inlined objects that don't need destruction
69 // don't need to be finalized. 69 // don't need to be finalized.
70 class AlsoDoesNotNeedFinalizer : public A { 70 class AlsoDoesNotNeedFinalizer : public A, public ScriptWrappable {
71 public: 71 public:
72 void trace(Visitor*); 72 void trace(Visitor*);
73 private: 73 private:
74 HeapVector<Member<A>, 10> m_as; 74 HeapVector<Member<A>, 10> m_as;
75 HeapVector<C, 10> m_cs; 75 HeapVector<C, 10> m_cs;
76 }; 76 };
77 77
78 } 78 }
79 79
80 #endif 80 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698