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

Side by Side Diff: tools/clang/blink_gc_plugin/tests/heap/stubs.h

Issue 430213003: Blink GC plugin: Require that fields are actually traced by the visitor and identify tracing of dep… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: TraceIfNeeded support Created 6 years, 4 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
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 HEAP_STUBS_H_ 5 #ifndef HEAP_STUBS_H_
6 #define HEAP_STUBS_H_ 6 #define HEAP_STUBS_H_
7 7
8 #include "stddef.h" 8 #include "stddef.h"
9 9
10 #define WTF_MAKE_FAST_ALLOCATED \ 10 #define WTF_MAKE_FAST_ALLOCATED \
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 211
212 template<typename T, void (T::*method)(Visitor*)> 212 template<typename T, void (T::*method)(Visitor*)>
213 void registerWeakMembers(const T* obj); 213 void registerWeakMembers(const T* obj);
214 }; 214 };
215 215
216 class GarbageCollectedMixin { 216 class GarbageCollectedMixin {
217 virtual void adjustAndMark(Visitor*) const = 0; 217 virtual void adjustAndMark(Visitor*) const = 0;
218 virtual bool isAlive(Visitor*) const = 0; 218 virtual bool isAlive(Visitor*) const = 0;
219 }; 219 };
220 220
221 template<typename T>
222 struct TraceIfNeeded {
223 static void trace(Visitor*, T*);
224 };
225
221 // blink::ScriptWrappable receives special treatment 226 // blink::ScriptWrappable receives special treatment
222 // so as to allow it to be used together with GarbageCollected<T>, 227 // so as to allow it to be used together with GarbageCollected<T>,
223 // even when its user-declared destructor is provided. 228 // even when its user-declared destructor is provided.
224 // As it is with Oilpan disabled. 229 // As it is with Oilpan disabled.
225 class ScriptWrappable { 230 class ScriptWrappable {
226 public: 231 public:
227 ~ScriptWrappable() { /* user-declared, thus, non-trivial */ } 232 ~ScriptWrappable() { /* user-declared, thus, non-trivial */ }
228 }; 233 };
229 234
230 } 235 }
231 236
232 namespace WTF { 237 namespace WTF {
233 238
234 template<typename T> 239 template<typename T>
235 struct VectorTraits<blink::Member<T> > { 240 struct VectorTraits<blink::Member<T> > {
236 static const bool needsDestruction = false; 241 static const bool needsDestruction = false;
237 }; 242 };
238 243
239 } 244 }
240 245
241 #endif 246 #endif
OLDNEW
« no previous file with comments | « tools/clang/blink_gc_plugin/tests/fields_require_tracing.cpp ('k') | tools/clang/blink_gc_plugin/tests/trace_if_needed.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698