| 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 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 #define WillBePersistentHeapHashCountedSet WebCore::PersistentHeapHashCountedSet | 813 #define WillBePersistentHeapHashCountedSet WebCore::PersistentHeapHashCountedSet |
| 814 #define WillBeGarbageCollectedMixin WebCore::GarbageCollectedMixin | 814 #define WillBeGarbageCollectedMixin WebCore::GarbageCollectedMixin |
| 815 #define WillBeHeapSupplement WebCore::HeapSupplement | 815 #define WillBeHeapSupplement WebCore::HeapSupplement |
| 816 #define WillBeHeapSupplementable WebCore::HeapSupplementable | 816 #define WillBeHeapSupplementable WebCore::HeapSupplementable |
| 817 #define WillBeHeapTerminatedArray WebCore::HeapTerminatedArray | 817 #define WillBeHeapTerminatedArray WebCore::HeapTerminatedArray |
| 818 #define WillBeHeapTerminatedArrayBuilder WebCore::HeapTerminatedArrayBuilder | 818 #define WillBeHeapTerminatedArrayBuilder WebCore::HeapTerminatedArrayBuilder |
| 819 #define WillBeHeapLinkedStack WebCore::HeapLinkedStack | 819 #define WillBeHeapLinkedStack WebCore::HeapLinkedStack |
| 820 | 820 |
| 821 template<typename T> PassRefPtrWillBeRawPtr<T> adoptRefWillBeNoop(T* ptr) | 821 template<typename T> PassRefPtrWillBeRawPtr<T> adoptRefWillBeNoop(T* ptr) |
| 822 { | 822 { |
| 823 static const bool notRefCountedGarbageCollected = !WTF::IsSubclassOfTemplate
<T, RefCountedGarbageCollected>::value; | 823 static const bool notRefCountedGarbageCollected = !WTF::IsSubclassOfTemplate
<typename WTF::RemoveConst<T>::Type, RefCountedGarbageCollected>::value; |
| 824 static const bool notRefCounted = !WTF::IsSubclassOfTemplate<T, RefCounted>:
:value; | 824 static const bool notRefCounted = !WTF::IsSubclassOfTemplate<typename WTF::R
emoveConst<T>::Type, RefCounted>::value; |
| 825 COMPILE_ASSERT(notRefCountedGarbageCollected, useAdoptRefCountedWillBeRefCou
ntedGarbageCollected); | 825 COMPILE_ASSERT(notRefCountedGarbageCollected, useAdoptRefCountedWillBeRefCou
ntedGarbageCollected); |
| 826 COMPILE_ASSERT(notRefCounted, youMustAdopt); | 826 COMPILE_ASSERT(notRefCounted, youMustAdopt); |
| 827 return PassRefPtrWillBeRawPtr<T>(ptr); | 827 return PassRefPtrWillBeRawPtr<T>(ptr); |
| 828 } | 828 } |
| 829 | 829 |
| 830 template<typename T> PassRefPtrWillBeRawPtr<T> adoptRefWillBeRefCountedGarbageCo
llected(T* ptr) | 830 template<typename T> PassRefPtrWillBeRawPtr<T> adoptRefWillBeRefCountedGarbageCo
llected(T* ptr) |
| 831 { | 831 { |
| 832 static const bool isRefCountedGarbageCollected = WTF::IsSubclassOfTemplate<T
, RefCountedGarbageCollected>::value; | 832 static const bool isRefCountedGarbageCollected = WTF::IsSubclassOfTemplate<t
ypename WTF::RemoveConst<T>::Type, RefCountedGarbageCollected>::value; |
| 833 COMPILE_ASSERT(isRefCountedGarbageCollected, useAdoptRefWillBeNoop); | 833 COMPILE_ASSERT(isRefCountedGarbageCollected, useAdoptRefWillBeNoop); |
| 834 return PassRefPtrWillBeRawPtr<T>(adoptRefCountedGarbageCollected(ptr)); | 834 return PassRefPtrWillBeRawPtr<T>(adoptRefCountedGarbageCollected(ptr)); |
| 835 } | 835 } |
| 836 | 836 |
| 837 template<typename T> PassRefPtrWillBeRawPtr<T> adoptRefWillBeThreadSafeRefCounte
dGarbageCollected(T* ptr) | 837 template<typename T> PassRefPtrWillBeRawPtr<T> adoptRefWillBeThreadSafeRefCounte
dGarbageCollected(T* ptr) |
| 838 { | 838 { |
| 839 static const bool isThreadSafeRefCountedGarbageCollected = WTF::IsSubclassOf
Template<T, ThreadSafeRefCountedGarbageCollected>::value; | 839 static const bool isThreadSafeRefCountedGarbageCollected = WTF::IsSubclassOf
Template<typename WTF::RemoveConst<T>::Type, ThreadSafeRefCountedGarbageCollecte
d>::value; |
| 840 COMPILE_ASSERT(isThreadSafeRefCountedGarbageCollected, useAdoptRefWillBeNoop
); | 840 COMPILE_ASSERT(isThreadSafeRefCountedGarbageCollected, useAdoptRefWillBeNoop
); |
| 841 return PassRefPtrWillBeRawPtr<T>(adoptRefCountedGarbageCollected(ptr)); | 841 return PassRefPtrWillBeRawPtr<T>(adoptRefCountedGarbageCollected(ptr)); |
| 842 } | 842 } |
| 843 | 843 |
| 844 template<typename T> PassOwnPtrWillBeRawPtr<T> adoptPtrWillBeNoop(T* ptr) | 844 template<typename T> PassOwnPtrWillBeRawPtr<T> adoptPtrWillBeNoop(T* ptr) |
| 845 { | 845 { |
| 846 static const bool notRefCountedGarbageCollected = !WTF::IsSubclassOfTemplate
<T, RefCountedGarbageCollected>::value; | 846 static const bool notRefCountedGarbageCollected = !WTF::IsSubclassOfTemplate
<typename WTF::RemoveConst<T>::Type, RefCountedGarbageCollected>::value; |
| 847 static const bool notRefCounted = !WTF::IsSubclassOfTemplate<T, RefCounted>:
:value; | 847 static const bool notRefCounted = !WTF::IsSubclassOfTemplate<typename WTF::R
emoveConst<T>::Type, RefCounted>::value; |
| 848 COMPILE_ASSERT(notRefCountedGarbageCollected, useAdoptRefCountedWillBeRefCou
ntedGarbageCollected); | 848 COMPILE_ASSERT(notRefCountedGarbageCollected, useAdoptRefCountedWillBeRefCou
ntedGarbageCollected); |
| 849 COMPILE_ASSERT(notRefCounted, youMustAdopt); | 849 COMPILE_ASSERT(notRefCounted, youMustAdopt); |
| 850 return PassOwnPtrWillBeRawPtr<T>(ptr); | 850 return PassOwnPtrWillBeRawPtr<T>(ptr); |
| 851 } | 851 } |
| 852 | 852 |
| 853 #define WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED // do nothing when oilpan is ena
bled. | 853 #define WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED // do nothing when oilpan is ena
bled. |
| 854 #define DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(type) // do nothing | 854 #define DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(type) // do nothing |
| 855 #define DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(type) // do nothing | 855 #define DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(type) // do nothing |
| 856 #define DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(type) // do nothing | 856 #define DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(type) // do nothing |
| 857 | 857 |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 struct NeedsTracing<ListHashSetNode<T, WebCore::HeapListHashSetAllocator<T, inli
neCapacity> > *> { | 1133 struct NeedsTracing<ListHashSetNode<T, WebCore::HeapListHashSetAllocator<T, inli
neCapacity> > *> { |
| 1134 // All heap allocated node pointers need visiting to keep the nodes alive, | 1134 // All heap allocated node pointers need visiting to keep the nodes alive, |
| 1135 // regardless of whether they contain pointers to other heap allocated | 1135 // regardless of whether they contain pointers to other heap allocated |
| 1136 // objects. | 1136 // objects. |
| 1137 static const bool value = true; | 1137 static const bool value = true; |
| 1138 }; | 1138 }; |
| 1139 | 1139 |
| 1140 } // namespace WTF | 1140 } // namespace WTF |
| 1141 | 1141 |
| 1142 #endif | 1142 #endif |
| OLD | NEW |