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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 } | 351 } |
352 | 352 |
353 template<typename U> | 353 template<typename U> |
354 U* as() const | 354 U* as() const |
355 { | 355 { |
356 return static_cast<U*>(m_raw); | 356 return static_cast<U*>(m_raw); |
357 } | 357 } |
358 | 358 |
359 void trace(Visitor* visitor) | 359 void trace(Visitor* visitor) |
360 { | 360 { |
361 COMPILE_ASSERT_IS_GARBAGE_COLLECTED(T, NonGarbageCollectedObjectInPersis
tent); | 361 STATIC_ASSERT_IS_GARBAGE_COLLECTED(T, "non-garbage collected object shou
ld not be in Persistent"); |
362 #if ENABLE(GC_PROFILE_MARKING) | 362 #if ENABLE(GC_PROFILE_MARKING) |
363 visitor->setHostInfo(this, m_tracingName.isEmpty() ? "Persistent" : m_tr
acingName); | 363 visitor->setHostInfo(this, m_tracingName.isEmpty() ? "Persistent" : m_tr
acingName); |
364 #endif | 364 #endif |
365 visitor->mark(m_raw); | 365 visitor->mark(m_raw); |
366 } | 366 } |
367 | 367 |
368 RawPtr<T> release() | 368 RawPtr<T> release() |
369 { | 369 { |
370 RawPtr<T> result = m_raw; | 370 RawPtr<T> result = m_raw; |
371 m_raw = nullptr; | 371 m_raw = nullptr; |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 #define WillBeHeapTerminatedArrayBuilder blink::HeapTerminatedArrayBuilder | 813 #define WillBeHeapTerminatedArrayBuilder blink::HeapTerminatedArrayBuilder |
814 #define WillBeHeapLinkedStack blink::HeapLinkedStack | 814 #define WillBeHeapLinkedStack blink::HeapLinkedStack |
815 #define PersistentHeapHashMapWillBeHeapHashMap blink::HeapHashMap | 815 #define PersistentHeapHashMapWillBeHeapHashMap blink::HeapHashMap |
816 #define PersistentHeapHashSetWillBeHeapHashSet blink::HeapHashSet | 816 #define PersistentHeapHashSetWillBeHeapHashSet blink::HeapHashSet |
817 #define PersistentHeapDequeWillBeHeapDeque blink::HeapDeque | 817 #define PersistentHeapDequeWillBeHeapDeque blink::HeapDeque |
818 #define PersistentHeapVectorWillBeHeapVector blink::HeapVector | 818 #define PersistentHeapVectorWillBeHeapVector blink::HeapVector |
819 | 819 |
820 template<typename T> T* adoptRefWillBeNoop(T* ptr) | 820 template<typename T> T* adoptRefWillBeNoop(T* ptr) |
821 { | 821 { |
822 static const bool notRefCounted = !WTF::IsSubclassOfTemplate<typename WTF::R
emoveConst<T>::Type, RefCounted>::value; | 822 static const bool notRefCounted = !WTF::IsSubclassOfTemplate<typename WTF::R
emoveConst<T>::Type, RefCounted>::value; |
823 COMPILE_ASSERT(notRefCounted, youMustAdopt); | 823 static_assert(notRefCounted, "you must adopt"); |
824 return ptr; | 824 return ptr; |
825 } | 825 } |
826 | 826 |
827 template<typename T> T* adoptPtrWillBeNoop(T* ptr) | 827 template<typename T> T* adoptPtrWillBeNoop(T* ptr) |
828 { | 828 { |
829 static const bool notRefCounted = !WTF::IsSubclassOfTemplate<typename WTF::R
emoveConst<T>::Type, RefCounted>::value; | 829 static const bool notRefCounted = !WTF::IsSubclassOfTemplate<typename WTF::R
emoveConst<T>::Type, RefCounted>::value; |
830 COMPILE_ASSERT(notRefCounted, youMustAdopt); | 830 static_assert(notRefCounted, "you must adopt"); |
831 return ptr; | 831 return ptr; |
832 } | 832 } |
833 | 833 |
834 #define WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED // do nothing when oilpan is ena
bled. | 834 #define WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED // do nothing when oilpan is ena
bled. |
835 #define DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(type) // do nothing | 835 #define DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(type) // do nothing |
836 #define DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(type) // do nothing | 836 #define DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(type) // do nothing |
837 #define DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(type) // do nothing | 837 #define DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(type) // do nothing |
838 | 838 |
839 #define DEFINE_STATIC_REF_WILL_BE_PERSISTENT(type, name, arguments) \ | 839 #define DEFINE_STATIC_REF_WILL_BE_PERSISTENT(type, name, arguments) \ |
840 static type* name = (new Persistent<type>(arguments))->get(); | 840 static type* name = (new Persistent<type>(arguments))->get(); |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1189 template<typename T> | 1189 template<typename T> |
1190 struct ParamStorageTraits<RawPtr<T>> : public PointerParamStorageTraits<T*, blin
k::IsGarbageCollectedType<T>::value> { | 1190 struct ParamStorageTraits<RawPtr<T>> : public PointerParamStorageTraits<T*, blin
k::IsGarbageCollectedType<T>::value> { |
1191 }; | 1191 }; |
1192 | 1192 |
1193 template<typename T> | 1193 template<typename T> |
1194 PassRefPtr<T> adoptRef(blink::RefCountedGarbageCollected<T>*) = delete; | 1194 PassRefPtr<T> adoptRef(blink::RefCountedGarbageCollected<T>*) = delete; |
1195 | 1195 |
1196 } // namespace WTF | 1196 } // namespace WTF |
1197 | 1197 |
1198 #endif | 1198 #endif |
OLD | NEW |