| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #if ENABLE(GC_TRACING) | 46 #if ENABLE(GC_TRACING) |
| 47 #include "wtf/text/WTFString.h" | 47 #include "wtf/text/WTFString.h" |
| 48 #endif | 48 #endif |
| 49 | 49 |
| 50 #if ENABLE(ASSERT) | 50 #if ENABLE(ASSERT) |
| 51 #define DEBUG_ONLY(x) x | 51 #define DEBUG_ONLY(x) x |
| 52 #else | 52 #else |
| 53 #define DEBUG_ONLY(x) | 53 #define DEBUG_ONLY(x) |
| 54 #endif | 54 #endif |
| 55 | 55 |
| 56 namespace WebCore { | 56 namespace blink { |
| 57 | 57 |
| 58 class FinalizedHeapObjectHeader; | 58 class FinalizedHeapObjectHeader; |
| 59 template<typename T> class GarbageCollectedFinalized; | 59 template<typename T> class GarbageCollectedFinalized; |
| 60 class HeapObjectHeader; | 60 class HeapObjectHeader; |
| 61 template<typename T> class Member; | 61 template<typename T> class Member; |
| 62 template<typename T> class WeakMember; | 62 template<typename T> class WeakMember; |
| 63 class Visitor; | 63 class Visitor; |
| 64 | 64 |
| 65 template<bool needsTracing, WTF::WeakHandlingFlag weakHandlingFlag, WTF::ShouldW
eakPointersBeMarkedStrongly strongify, typename T, typename Traits> struct Colle
ctionBackingTraceTrait; | 65 template<bool needsTracing, WTF::WeakHandlingFlag weakHandlingFlag, WTF::ShouldW
eakPointersBeMarkedStrongly strongify, typename T, typename Traits> struct Colle
ctionBackingTraceTrait; |
| 66 | 66 |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 // compute the object header addr statically, this dynamic dispatch is not used. | 585 // compute the object header addr statically, this dynamic dispatch is not used. |
| 586 | 586 |
| 587 class GarbageCollectedMixin { | 587 class GarbageCollectedMixin { |
| 588 public: | 588 public: |
| 589 virtual void adjustAndMark(Visitor*) const = 0; | 589 virtual void adjustAndMark(Visitor*) const = 0; |
| 590 virtual bool isAlive(Visitor*) const = 0; | 590 virtual bool isAlive(Visitor*) const = 0; |
| 591 }; | 591 }; |
| 592 | 592 |
| 593 #define USING_GARBAGE_COLLECTED_MIXIN(TYPE) \ | 593 #define USING_GARBAGE_COLLECTED_MIXIN(TYPE) \ |
| 594 public: \ | 594 public: \ |
| 595 virtual void adjustAndMark(WebCore::Visitor* visitor) const OVERRIDE \ | 595 virtual void adjustAndMark(blink::Visitor* visitor) const OVERRIDE \ |
| 596 { \ | 596 { \ |
| 597 typedef WTF::IsSubclassOfTemplate<typename WTF::RemoveConst<TYPE>::Type,
WebCore::GarbageCollected> IsSubclassOfGarbageCollected; \ | 597 typedef WTF::IsSubclassOfTemplate<typename WTF::RemoveConst<TYPE>::Type,
blink::GarbageCollected> IsSubclassOfGarbageCollected; \ |
| 598 COMPILE_ASSERT(IsSubclassOfGarbageCollected::value, OnlyGarbageCollected
ObjectsCanHaveGarbageCollectedMixins); \ | 598 COMPILE_ASSERT(IsSubclassOfGarbageCollected::value, OnlyGarbageCollected
ObjectsCanHaveGarbageCollectedMixins); \ |
| 599 visitor->mark(static_cast<const TYPE*>(this), &WebCore::TraceTrait<TYPE>
::trace); \ | 599 visitor->mark(static_cast<const TYPE*>(this), &blink::TraceTrait<TYPE>::
trace); \ |
| 600 } \ | 600 } \ |
| 601 virtual bool isAlive(WebCore::Visitor* visitor) const OVERRIDE \ | 601 virtual bool isAlive(blink::Visitor* visitor) const OVERRIDE \ |
| 602 { \ | 602 { \ |
| 603 return visitor->isAlive(this); \ | 603 return visitor->isAlive(this); \ |
| 604 } \ | 604 } \ |
| 605 private: | 605 private: |
| 606 | 606 |
| 607 #if ENABLE(OILPAN) | 607 #if ENABLE(OILPAN) |
| 608 #define WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(TYPE) USING_GARBAGE_COLLECTED_MIXI
N(TYPE) | 608 #define WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(TYPE) USING_GARBAGE_COLLECTED_MIXI
N(TYPE) |
| 609 #else | 609 #else |
| 610 #define WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(TYPE) | 610 #define WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(TYPE) |
| 611 #endif | 611 #endif |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 struct GCInfoTrait { | 655 struct GCInfoTrait { |
| 656 static const GCInfo* get() | 656 static const GCInfo* get() |
| 657 { | 657 { |
| 658 return GCInfoAtBase<typename GetGarbageCollectedBase<T>::type>::get(); | 658 return GCInfoAtBase<typename GetGarbageCollectedBase<T>::type>::get(); |
| 659 } | 659 } |
| 660 }; | 660 }; |
| 661 | 661 |
| 662 } | 662 } |
| 663 | 663 |
| 664 #endif | 664 #endif |
| OLD | NEW |