OLD | NEW |
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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 template<typename T> | 209 template<typename T> |
210 void trace(const T&); | 210 void trace(const T&); |
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 virtual void trace(Visitor*) { } |
219 }; | 220 }; |
220 | 221 |
221 template<typename T> | 222 template<typename T> |
222 struct TraceIfNeeded { | 223 struct TraceIfNeeded { |
223 static void trace(Visitor*, T*); | 224 static void trace(Visitor*, T*); |
224 }; | 225 }; |
225 | 226 |
226 // blink::ScriptWrappable receives special treatment | 227 // blink::ScriptWrappable receives special treatment |
227 // so as to allow it to be used together with GarbageCollected<T>, | 228 // so as to allow it to be used together with GarbageCollected<T>, |
228 // even when its user-declared destructor is provided. | 229 // even when its user-declared destructor is provided. |
229 // As it is with Oilpan disabled. | 230 // As it is with Oilpan disabled. |
230 class ScriptWrappable { | 231 class ScriptWrappable { |
231 public: | 232 public: |
232 ~ScriptWrappable() { /* user-declared, thus, non-trivial */ } | 233 ~ScriptWrappable() { /* user-declared, thus, non-trivial */ } |
233 }; | 234 }; |
234 | 235 |
235 } | 236 } |
236 | 237 |
237 namespace WTF { | 238 namespace WTF { |
238 | 239 |
239 template<typename T> | 240 template<typename T> |
240 struct VectorTraits<blink::Member<T> > { | 241 struct VectorTraits<blink::Member<T> > { |
241 static const bool needsDestruction = false; | 242 static const bool needsDestruction = false; |
242 }; | 243 }; |
243 | 244 |
244 } | 245 } |
245 | 246 |
246 #endif | 247 #endif |
OLD | NEW |