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

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

Issue 939303005: BlinkGCPlugin: Support overloaded trace() call from template. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a subtle typo. Created 5 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
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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 class PersistentHeapVector : public Vector<T, 0, HeapAllocator> { }; 205 class PersistentHeapVector : public Vector<T, 0, HeapAllocator> { };
206 206
207 template <typename Derived> 207 template <typename Derived>
208 class VisitorHelper { 208 class VisitorHelper {
209 public: 209 public:
210 template<typename T> 210 template<typename T>
211 void trace(const T&); 211 void trace(const T&);
212 }; 212 };
213 213
214 class Visitor : public VisitorHelper<Visitor> { 214 class Visitor : public VisitorHelper<Visitor> {
215 public: 215 public:
216 template<typename T, void (T::*method)(Visitor*)> 216 template<typename T, void (T::*method)(Visitor*)>
217 void registerWeakMembers(const T* obj); 217 void registerWeakMembers(const T* obj);
218 }; 218 };
219 219
220 class InlinedGlobalMarkingVisitor
221 : public VisitorHelper<InlinedGlobalMarkingVisitor> {
222 public:
223 InlinedGlobalMarkingVisitor* operator->() { return this; }
224 };
225
220 class GarbageCollectedMixin { 226 class GarbageCollectedMixin {
221 public: 227 public:
222 virtual void adjustAndMark(Visitor*) const = 0; 228 virtual void adjustAndMark(Visitor*) const = 0;
223 virtual bool isHeapObjectAlive(Visitor*) const = 0; 229 virtual bool isHeapObjectAlive(Visitor*) const = 0;
224 virtual void trace(Visitor*) { } 230 virtual void trace(Visitor*) { }
225 }; 231 };
226 232
227 template<typename T> 233 template<typename T>
228 struct TraceIfNeeded { 234 struct TraceIfNeeded {
229 static void trace(Visitor*, T*); 235 static void trace(Visitor*, T*);
(...skipping 13 matching lines...) Expand all
243 namespace WTF { 249 namespace WTF {
244 250
245 template<typename T> 251 template<typename T>
246 struct VectorTraits<blink::Member<T> > { 252 struct VectorTraits<blink::Member<T> > {
247 static const bool needsDestruction = false; 253 static const bool needsDestruction = false;
248 }; 254 };
249 255
250 } 256 }
251 257
252 #endif 258 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698