OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 // transition type be unqualified, would dually not work for template | 770 // transition type be unqualified, would dually not work for template |
771 // aliases. So, slightly unfortunately, fall back/down to the lowest | 771 // aliases. So, slightly unfortunately, fall back/down to the lowest |
772 // commmon denominator of using CPP macros only. | 772 // commmon denominator of using CPP macros only. |
773 #if ENABLE(OILPAN) | 773 #if ENABLE(OILPAN) |
774 #define PassRefPtrWillBeRawPtr WTF::RawPtr | 774 #define PassRefPtrWillBeRawPtr WTF::RawPtr |
775 #define RefCountedWillBeGarbageCollected WebCore::GarbageCollected | 775 #define RefCountedWillBeGarbageCollected WebCore::GarbageCollected |
776 #define RefCountedWillBeGarbageCollectedFinalized WebCore::GarbageCollectedFinal
ized | 776 #define RefCountedWillBeGarbageCollectedFinalized WebCore::GarbageCollectedFinal
ized |
777 #define RefCountedWillBeRefCountedGarbageCollected WebCore::RefCountedGarbageCol
lected | 777 #define RefCountedWillBeRefCountedGarbageCollected WebCore::RefCountedGarbageCol
lected |
778 #define ThreadSafeRefCountedWillBeGarbageCollected WebCore::GarbageCollected | 778 #define ThreadSafeRefCountedWillBeGarbageCollected WebCore::GarbageCollected |
779 #define ThreadSafeRefCountedWillBeGarbageCollectedFinalized WebCore::GarbageColl
ectedFinalized | 779 #define ThreadSafeRefCountedWillBeGarbageCollectedFinalized WebCore::GarbageColl
ectedFinalized |
| 780 #define ThreadSafeRefCountedWillBeThreadSafeRefCountedGarbageCollected WebCore::
ThreadSafeRefCountedGarbageCollected |
780 #define TreeSharedWillBeRefCountedGarbageCollected WebCore::RefCountedGarbageCol
lected | 781 #define TreeSharedWillBeRefCountedGarbageCollected WebCore::RefCountedGarbageCol
lected |
781 #define PersistentWillBeMember WebCore::Member | 782 #define PersistentWillBeMember WebCore::Member |
782 #define RefPtrWillBePersistent WebCore::Persistent | 783 #define RefPtrWillBePersistent WebCore::Persistent |
783 #define RefPtrWillBeRawPtr WTF::RawPtr | 784 #define RefPtrWillBeRawPtr WTF::RawPtr |
784 #define RefPtrWillBeMember WebCore::Member | 785 #define RefPtrWillBeMember WebCore::Member |
785 #define RefPtrWillBeCrossThreadPersistent WebCore::CrossThreadPersistent | 786 #define RefPtrWillBeCrossThreadPersistent WebCore::CrossThreadPersistent |
786 #define RawPtrWillBeMember WebCore::Member | 787 #define RawPtrWillBeMember WebCore::Member |
787 #define RawPtrWillBeWeakMember WebCore::WeakMember | 788 #define RawPtrWillBeWeakMember WebCore::WeakMember |
788 #define OwnPtrWillBeMember WebCore::Member | 789 #define OwnPtrWillBeMember WebCore::Member |
789 #define OwnPtrWillBePersistent WebCore::Persistent | 790 #define OwnPtrWillBePersistent WebCore::Persistent |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 return PassRefPtrWillBeRawPtr<T>(ptr); | 824 return PassRefPtrWillBeRawPtr<T>(ptr); |
824 } | 825 } |
825 | 826 |
826 template<typename T> PassRefPtrWillBeRawPtr<T> adoptRefWillBeRefCountedGarbageCo
llected(T* ptr) | 827 template<typename T> PassRefPtrWillBeRawPtr<T> adoptRefWillBeRefCountedGarbageCo
llected(T* ptr) |
827 { | 828 { |
828 static const bool isRefCountedGarbageCollected = WTF::IsSubclassOfTemplate<T
, RefCountedGarbageCollected>::value; | 829 static const bool isRefCountedGarbageCollected = WTF::IsSubclassOfTemplate<T
, RefCountedGarbageCollected>::value; |
829 COMPILE_ASSERT(isRefCountedGarbageCollected, useAdoptRefWillBeNoop); | 830 COMPILE_ASSERT(isRefCountedGarbageCollected, useAdoptRefWillBeNoop); |
830 return PassRefPtrWillBeRawPtr<T>(adoptRefCountedGarbageCollected(ptr)); | 831 return PassRefPtrWillBeRawPtr<T>(adoptRefCountedGarbageCollected(ptr)); |
831 } | 832 } |
832 | 833 |
| 834 template<typename T> PassRefPtrWillBeRawPtr<T> adoptRefWillBeThreadSafeRefCounte
dGarbageCollected(T* ptr) |
| 835 { |
| 836 static const bool isThreadSafeRefCountedGarbageCollected = WTF::IsSubclassOf
Template<T, ThreadSafeRefCountedGarbageCollected>::value; |
| 837 COMPILE_ASSERT(isThreadSafeRefCountedGarbageCollected, useAdoptRefWillBeNoop
); |
| 838 return PassRefPtrWillBeRawPtr<T>(adoptRefCountedGarbageCollected(ptr)); |
| 839 } |
| 840 |
833 template<typename T> PassOwnPtrWillBeRawPtr<T> adoptPtrWillBeNoop(T* ptr) | 841 template<typename T> PassOwnPtrWillBeRawPtr<T> adoptPtrWillBeNoop(T* ptr) |
834 { | 842 { |
835 static const bool notRefCountedGarbageCollected = !WTF::IsSubclassOfTemplate
<T, RefCountedGarbageCollected>::value; | 843 static const bool notRefCountedGarbageCollected = !WTF::IsSubclassOfTemplate
<T, RefCountedGarbageCollected>::value; |
836 static const bool notRefCounted = !WTF::IsSubclassOfTemplate<T, RefCounted>:
:value; | 844 static const bool notRefCounted = !WTF::IsSubclassOfTemplate<T, RefCounted>:
:value; |
837 COMPILE_ASSERT(notRefCountedGarbageCollected, useAdoptRefCountedWillBeRefCou
ntedGarbageCollected); | 845 COMPILE_ASSERT(notRefCountedGarbageCollected, useAdoptRefCountedWillBeRefCou
ntedGarbageCollected); |
838 COMPILE_ASSERT(notRefCounted, youMustAdopt); | 846 COMPILE_ASSERT(notRefCounted, youMustAdopt); |
839 return PassOwnPtrWillBeRawPtr<T>(ptr); | 847 return PassOwnPtrWillBeRawPtr<T>(ptr); |
840 } | 848 } |
841 | 849 |
842 #define WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED // do nothing when oilpan is ena
bled. | 850 #define WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED // do nothing when oilpan is ena
bled. |
(...skipping 12 matching lines...) Expand all Loading... |
855 DummyBase() { } | 863 DummyBase() { } |
856 ~DummyBase() { } | 864 ~DummyBase() { } |
857 }; | 865 }; |
858 | 866 |
859 #define PassRefPtrWillBeRawPtr WTF::PassRefPtr | 867 #define PassRefPtrWillBeRawPtr WTF::PassRefPtr |
860 #define RefCountedWillBeGarbageCollected WTF::RefCounted | 868 #define RefCountedWillBeGarbageCollected WTF::RefCounted |
861 #define RefCountedWillBeGarbageCollectedFinalized WTF::RefCounted | 869 #define RefCountedWillBeGarbageCollectedFinalized WTF::RefCounted |
862 #define RefCountedWillBeRefCountedGarbageCollected WTF::RefCounted | 870 #define RefCountedWillBeRefCountedGarbageCollected WTF::RefCounted |
863 #define ThreadSafeRefCountedWillBeGarbageCollected WTF::ThreadSafeRefCounted | 871 #define ThreadSafeRefCountedWillBeGarbageCollected WTF::ThreadSafeRefCounted |
864 #define ThreadSafeRefCountedWillBeGarbageCollectedFinalized WTF::ThreadSafeRefCo
unted | 872 #define ThreadSafeRefCountedWillBeGarbageCollectedFinalized WTF::ThreadSafeRefCo
unted |
| 873 #define ThreadSafeRefCountedWillBeThreadSafeRefCountedGarbageCollected WTF::Thre
adSafeRefCounted |
865 #define TreeSharedWillBeRefCountedGarbageCollected WebCore::TreeShared | 874 #define TreeSharedWillBeRefCountedGarbageCollected WebCore::TreeShared |
866 #define PersistentWillBeMember WebCore::Persistent | 875 #define PersistentWillBeMember WebCore::Persistent |
867 #define RefPtrWillBePersistent WTF::RefPtr | 876 #define RefPtrWillBePersistent WTF::RefPtr |
868 #define RefPtrWillBeRawPtr WTF::RefPtr | 877 #define RefPtrWillBeRawPtr WTF::RefPtr |
869 #define RefPtrWillBeMember WTF::RefPtr | 878 #define RefPtrWillBeMember WTF::RefPtr |
870 #define RefPtrWillBeCrossThreadPersistent WTF::RefPtr | 879 #define RefPtrWillBeCrossThreadPersistent WTF::RefPtr |
871 #define RawPtrWillBeMember WTF::RawPtr | 880 #define RawPtrWillBeMember WTF::RawPtr |
872 #define RawPtrWillBeWeakMember WTF::RawPtr | 881 #define RawPtrWillBeWeakMember WTF::RawPtr |
873 #define OwnPtrWillBeMember WTF::OwnPtr | 882 #define OwnPtrWillBeMember WTF::OwnPtr |
874 #define OwnPtrWillBePersistent WTF::OwnPtr | 883 #define OwnPtrWillBePersistent WTF::OwnPtr |
(...skipping 19 matching lines...) Expand all Loading... |
894 #define WillBePersistentHeapHeapCountedSet WTF::HeapCountedSet | 903 #define WillBePersistentHeapHeapCountedSet WTF::HeapCountedSet |
895 #define WillBeGarbageCollectedMixin WebCore::DummyBase<void> | 904 #define WillBeGarbageCollectedMixin WebCore::DummyBase<void> |
896 #define WillBeHeapSupplement WebCore::Supplement | 905 #define WillBeHeapSupplement WebCore::Supplement |
897 #define WillBeHeapSupplementable WebCore::Supplementable | 906 #define WillBeHeapSupplementable WebCore::Supplementable |
898 #define WillBeHeapTerminatedArray WTF::TerminatedArray | 907 #define WillBeHeapTerminatedArray WTF::TerminatedArray |
899 #define WillBeHeapTerminatedArrayBuilder WTF::TerminatedArrayBuilder | 908 #define WillBeHeapTerminatedArrayBuilder WTF::TerminatedArrayBuilder |
900 #define WillBeHeapLinkedStack WTF::LinkedStack | 909 #define WillBeHeapLinkedStack WTF::LinkedStack |
901 | 910 |
902 template<typename T> PassRefPtrWillBeRawPtr<T> adoptRefWillBeNoop(T* ptr) { retu
rn adoptRef(ptr); } | 911 template<typename T> PassRefPtrWillBeRawPtr<T> adoptRefWillBeNoop(T* ptr) { retu
rn adoptRef(ptr); } |
903 template<typename T> PassRefPtrWillBeRawPtr<T> adoptRefWillBeRefCountedGarbageCo
llected(T* ptr) { return adoptRef(ptr); } | 912 template<typename T> PassRefPtrWillBeRawPtr<T> adoptRefWillBeRefCountedGarbageCo
llected(T* ptr) { return adoptRef(ptr); } |
| 913 template<typename T> PassRefPtrWillBeRawPtr<T> adoptRefWillBeThreadSafeRefCounte
dGarbageCollected(T* ptr) { return adoptRef(ptr); } |
904 template<typename T> PassOwnPtrWillBeRawPtr<T> adoptPtrWillBeNoop(T* ptr) { retu
rn adoptPtr(ptr); } | 914 template<typename T> PassOwnPtrWillBeRawPtr<T> adoptPtrWillBeNoop(T* ptr) { retu
rn adoptPtr(ptr); } |
905 | 915 |
906 #define WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED WTF_MAKE_FAST_ALLOCATED | 916 #define WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED WTF_MAKE_FAST_ALLOCATED |
907 #define DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(type) \ | 917 #define DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(type) \ |
908 public: \ | 918 public: \ |
909 ~type(); \ | 919 ~type(); \ |
910 private: | 920 private: |
911 #define DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(type) \ | 921 #define DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(type) \ |
912 public: \ | 922 public: \ |
913 virtual ~type(); \ | 923 virtual ~type(); \ |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1120 struct NeedsTracing<ListHashSetNode<T, WebCore::HeapListHashSetAllocator<T, inli
neCapacity> > *> { | 1130 struct NeedsTracing<ListHashSetNode<T, WebCore::HeapListHashSetAllocator<T, inli
neCapacity> > *> { |
1121 // All heap allocated node pointers need visiting to keep the nodes alive, | 1131 // All heap allocated node pointers need visiting to keep the nodes alive, |
1122 // regardless of whether they contain pointers to other heap allocated | 1132 // regardless of whether they contain pointers to other heap allocated |
1123 // objects. | 1133 // objects. |
1124 static const bool value = true; | 1134 static const bool value = true; |
1125 }; | 1135 }; |
1126 | 1136 |
1127 } // namespace WTF | 1137 } // namespace WTF |
1128 | 1138 |
1129 #endif | 1139 #endif |
OLD | NEW |