| 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 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 | 585 |
| 586 class PLATFORM_EXPORT GarbageCollectedMixin { | 586 class PLATFORM_EXPORT GarbageCollectedMixin { |
| 587 public: | 587 public: |
| 588 virtual void adjustAndMark(Visitor*) const { }; | 588 virtual void adjustAndMark(Visitor*) const { }; |
| 589 virtual bool isHeapObjectAlive(Visitor*) const { return true; }; | 589 virtual bool isHeapObjectAlive(Visitor*) const { return true; }; |
| 590 virtual void trace(Visitor*) { } | 590 virtual void trace(Visitor*) { } |
| 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(blink::Visitor* visitor) const OVERRIDE \ | 595 virtual void adjustAndMark(blink::Visitor* visitor) const override \ |
| 596 { \ | 596 { \ |
| 597 typedef WTF::IsSubclassOfTemplate<typename WTF::RemoveConst<TYPE>::Type,
blink::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), &blink::TraceTrait<TYPE>::
trace); \ | 599 visitor->mark(static_cast<const TYPE*>(this), &blink::TraceTrait<TYPE>::
trace); \ |
| 600 } \ | 600 } \ |
| 601 virtual bool isHeapObjectAlive(blink::Visitor* visitor) const OVERRIDE \ | 601 virtual bool isHeapObjectAlive(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 |