| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 GarbageCollected_h | 5 #ifndef GarbageCollected_h |
| 6 #define GarbageCollected_h | 6 #define GarbageCollected_h |
| 7 | 7 |
| 8 #include "platform/heap/ThreadState.h" | 8 #include "platform/heap/ThreadState.h" |
| 9 #include "wtf/Allocator.h" | 9 #include "wtf/Allocator.h" |
| 10 #include "wtf/Assertions.h" | 10 #include "wtf/Assertions.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 // when the constructor of the recorded GarbageCollectedMixinConstructorMarker | 197 // when the constructor of the recorded GarbageCollectedMixinConstructorMarker |
| 198 // runs. | 198 // runs. |
| 199 #define USING_GARBAGE_COLLECTED_MIXIN(TYPE) \ | 199 #define USING_GARBAGE_COLLECTED_MIXIN(TYPE) \ |
| 200 IS_GARBAGE_COLLECTED_TYPE(); \ | 200 IS_GARBAGE_COLLECTED_TYPE(); \ |
| 201 DEFINE_GARBAGE_COLLECTED_MIXIN_METHODS(blink::Visitor*, TYPE) \ | 201 DEFINE_GARBAGE_COLLECTED_MIXIN_METHODS(blink::Visitor*, TYPE) \ |
| 202 DEFINE_GARBAGE_COLLECTED_MIXIN_METHODS(blink::InlinedGlobalMarkingVisitor, T
YPE) \ | 202 DEFINE_GARBAGE_COLLECTED_MIXIN_METHODS(blink::InlinedGlobalMarkingVisitor, T
YPE) \ |
| 203 DEFINE_GARBAGE_COLLECTED_MIXIN_CONSTRUCTOR_MARKER(TYPE) \ | 203 DEFINE_GARBAGE_COLLECTED_MIXIN_CONSTRUCTOR_MARKER(TYPE) \ |
| 204 public: \ | 204 public: \ |
| 205 bool isHeapObjectAlive() const override \ | 205 bool isHeapObjectAlive() const override \ |
| 206 { \ | 206 { \ |
| 207 return ThreadHeap::isHeapObjectAlive(this); \ | 207 return Heap::isHeapObjectAlive(this); \ |
| 208 } \ | 208 } \ |
| 209 private: | 209 private: |
| 210 | 210 |
| 211 // An empty class with a constructor that's arranged invoked when all derived co
nstructors | 211 // An empty class with a constructor that's arranged invoked when all derived co
nstructors |
| 212 // of a mixin instance have completed and it is safe to allow GCs again. See | 212 // of a mixin instance have completed and it is safe to allow GCs again. See |
| 213 // AllocateObjectTrait<> comment for more. | 213 // AllocateObjectTrait<> comment for more. |
| 214 // | 214 // |
| 215 // USING_GARBAGE_COLLECTED_MIXIN() declares a GarbageCollectedMixinConstructorMa
rker<> private | 215 // USING_GARBAGE_COLLECTED_MIXIN() declares a GarbageCollectedMixinConstructorMa
rker<> private |
| 216 // field. By following Blink convention of using the macro at the top of a class
declaration, | 216 // field. By following Blink convention of using the macro at the top of a class
declaration, |
| 217 // its constructor will run first. | 217 // its constructor will run first. |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 | 390 |
| 391 namespace WTF { | 391 namespace WTF { |
| 392 | 392 |
| 393 // Adoption is not needed nor wanted for RefCountedGarbageCollected<>-derived ty
pes. | 393 // Adoption is not needed nor wanted for RefCountedGarbageCollected<>-derived ty
pes. |
| 394 template<typename T> | 394 template<typename T> |
| 395 PassRefPtr<T> adoptRef(blink::RefCountedGarbageCollected<T>*) = delete; | 395 PassRefPtr<T> adoptRef(blink::RefCountedGarbageCollected<T>*) = delete; |
| 396 | 396 |
| 397 } // namespace WTF | 397 } // namespace WTF |
| 398 | 398 |
| 399 #endif | 399 #endif |
| OLD | NEW |