OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef Visitor_h | 31 #ifndef Visitor_h |
32 #define Visitor_h | 32 #define Visitor_h |
33 | 33 |
| 34 #include <memory> |
34 #include "platform/PlatformExport.h" | 35 #include "platform/PlatformExport.h" |
35 #include "platform/heap/GarbageCollected.h" | 36 #include "platform/heap/GarbageCollected.h" |
36 #include "wtf/Allocator.h" | 37 #include "wtf/Allocator.h" |
37 #include "wtf/Assertions.h" | 38 #include "wtf/Assertions.h" |
38 #include "wtf/Forward.h" | 39 #include "wtf/Forward.h" |
39 #include "wtf/HashTraits.h" | 40 #include "wtf/HashTraits.h" |
40 #include "wtf/TypeTraits.h" | 41 #include "wtf/TypeTraits.h" |
41 #include <memory> | |
42 | 42 |
43 namespace blink { | 43 namespace blink { |
44 | 44 |
45 template <typename T> | 45 template <typename T> |
46 class GarbageCollected; | 46 class GarbageCollected; |
47 class HeapObjectHeader; | 47 class HeapObjectHeader; |
48 template <typename T> | 48 template <typename T> |
49 class TraceTrait; | 49 class TraceTrait; |
50 class ThreadState; | 50 class ThreadState; |
51 class Visitor; | 51 class Visitor; |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 const_cast<typename std::remove_const<T>::type**>(cell)), | 225 const_cast<typename std::remove_const<T>::type**>(cell)), |
226 &handleWeakCell<T>); | 226 &handleWeakCell<T>); |
227 } | 227 } |
228 | 228 |
229 template <typename T, void (T::*method)(Visitor*)> | 229 template <typename T, void (T::*method)(Visitor*)> |
230 void registerWeakMembers(const T* obj) { | 230 void registerWeakMembers(const T* obj) { |
231 registerWeakCallback(const_cast<T*>(obj), | 231 registerWeakCallback(const_cast<T*>(obj), |
232 &TraceMethodDelegate<T, method>::trampoline); | 232 &TraceMethodDelegate<T, method>::trampoline); |
233 } | 233 } |
234 | 234 |
235 | |
236 inline void registerBackingStoreReference(void* slot); | 235 inline void registerBackingStoreReference(void* slot); |
237 | 236 |
238 inline void registerBackingStoreCallback(void* backingStore, | 237 inline void registerBackingStoreCallback(void* backingStore, |
239 MovingObjectCallback, | 238 MovingObjectCallback, |
240 void* callbackData); | 239 void* callbackData); |
241 | 240 |
242 // This method marks an object and adds it to the set of objects | 241 // This method marks an object and adds it to the set of objects |
243 // that should have their trace method called. Since not all | 242 // that should have their trace method called. Since not all |
244 // objects have vtables we have to have the callback as an | 243 // objects have vtables we have to have the callback as an |
245 // explicit argument, but we can use the templated one-argument | 244 // explicit argument, but we can use the templated one-argument |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 | 303 |
305 static void markNoTracingCallback(Visitor*, void*); | 304 static void markNoTracingCallback(Visitor*, void*); |
306 | 305 |
307 ThreadState* const m_state; | 306 ThreadState* const m_state; |
308 const MarkingMode m_markingMode; | 307 const MarkingMode m_markingMode; |
309 }; | 308 }; |
310 | 309 |
311 } // namespace blink | 310 } // namespace blink |
312 | 311 |
313 #endif // Visitor_h | 312 #endif // Visitor_h |
OLD | NEW |