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

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

Issue 2578103003: Add use-chromium-style-naming option to Blink GC plugin. (Closed)
Patch Set: Rebase Created 4 years 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 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 public: \ 183 public: \
184 void* operator new(size_t, void*); \ 184 void* operator new(size_t, void*); \
185 private: \ 185 private: \
186 void* operator new(size_t) = delete; 186 void* operator new(size_t) = delete;
187 187
188 #define GC_PLUGIN_IGNORE(bug) \ 188 #define GC_PLUGIN_IGNORE(bug) \
189 __attribute__((annotate("blink_gc_plugin_ignore"))) 189 __attribute__((annotate("blink_gc_plugin_ignore")))
190 190
191 #define USING_GARBAGE_COLLECTED_MIXIN(type) \ 191 #define USING_GARBAGE_COLLECTED_MIXIN(type) \
192 public: \ 192 public: \
193 virtual void adjustAndMark(Visitor*) const override { } \ 193 virtual void AdjustAndMark(Visitor*) const override { } \
194 virtual bool isHeapObjectAlive(Visitor*) const override { return 0; } 194 virtual bool IsHeapObjectAlive(Visitor*) const override { return 0; }
195 195
196 #define EAGERLY_FINALIZED() typedef int IsEagerlyFinalizedMarker 196 #define EAGERLY_FINALIZED() typedef int IsEagerlyFinalizedMarker
197 197
198 template<typename T> class GarbageCollected { }; 198 template<typename T> class GarbageCollected { };
199 199
200 template<typename T> 200 template<typename T>
201 class GarbageCollectedFinalized : public GarbageCollected<T> { }; 201 class GarbageCollectedFinalized : public GarbageCollected<T> { };
202 202
203 template<typename T> 203 template<typename T>
204 class RefCountedGarbageCollected : public GarbageCollectedFinalized<T> { }; 204 class RefCountedGarbageCollected : public GarbageCollectedFinalized<T> { };
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 template<typename K, typename V> 273 template<typename K, typename V>
274 class HeapHashMap : public HashMap<K, V, void, void, void, HeapAllocator> { }; 274 class HeapHashMap : public HashMap<K, V, void, void, void, HeapAllocator> { };
275 275
276 template<typename T> 276 template<typename T>
277 class PersistentHeapVector : public Vector<T, 0, HeapAllocator> { }; 277 class PersistentHeapVector : public Vector<T, 0, HeapAllocator> { };
278 278
279 template <typename Derived> 279 template <typename Derived>
280 class VisitorHelper { 280 class VisitorHelper {
281 public: 281 public:
282 template<typename T> 282 template<typename T>
283 void trace(const T&); 283 void Trace(const T&);
284 }; 284 };
285 285
286 class Visitor : public VisitorHelper<Visitor> { 286 class Visitor : public VisitorHelper<Visitor> {
287 public: 287 public:
288 template<typename T, void (T::*method)(Visitor*)> 288 template<typename T, void (T::*method)(Visitor*)>
289 void registerWeakMembers(const T* obj); 289 void RegisterWeakMembers(const T* obj);
290 }; 290 };
291 291
292 class InlinedGlobalMarkingVisitor 292 class InlinedGlobalMarkingVisitor
293 : public VisitorHelper<InlinedGlobalMarkingVisitor> { 293 : public VisitorHelper<InlinedGlobalMarkingVisitor> {
294 public: 294 public:
295 InlinedGlobalMarkingVisitor* operator->() { return this; } 295 InlinedGlobalMarkingVisitor* operator->() { return this; }
296 296
297 template<typename T, void (T::*method)(Visitor*)> 297 template<typename T, void (T::*method)(Visitor*)>
298 void registerWeakMembers(const T* obj); 298 void RegisterWeakMembers(const T* obj);
299 }; 299 };
300 300
301 class GarbageCollectedMixin { 301 class GarbageCollectedMixin {
302 public: 302 public:
303 virtual void adjustAndMark(Visitor*) const = 0; 303 virtual void AdjustAndMark(Visitor*) const = 0;
304 virtual bool isHeapObjectAlive(Visitor*) const = 0; 304 virtual bool IsHeapObjectAlive(Visitor*) const = 0;
305 virtual void trace(Visitor*) { } 305 virtual void Trace(Visitor*) { }
306 }; 306 };
307 307
308 template<typename T> 308 template<typename T>
309 struct TraceIfNeeded { 309 struct TraceIfNeeded {
310 static void trace(Visitor*, T*); 310 static void Trace(Visitor*, T*);
311 }; 311 };
312 312
313 } 313 }
314 314
315 namespace WTF { 315 namespace WTF {
316 316
317 template<typename T> 317 template<typename T>
318 struct VectorTraits<blink::Member<T> > { 318 struct VectorTraits<blink::Member<T> > {
319 static const bool needsDestruction = false; 319 static const bool needsDestruction = false;
320 }; 320 };
321 321
322 } 322 }
323 323
324 #endif 324 #endif
OLDNEW
« no previous file with comments | « tools/clang/blink_gc_plugin/tests/garbage_collected_mixin.txt ('k') | tools/clang/blink_gc_plugin/tests/ignore_class.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698