Changeset 248113 in webkit
- Timestamp:
- Aug 1, 2019 11:38:40 AM (5 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r248071 r248113 1 2019-08-01 Chris Dumez <cdumez@apple.com> 2 3 Add threading assertion to WeakPtr's operator->() 4 https://bugs.webkit.org/show_bug.cgi?id=199922 5 6 Reviewed by Ryosuke Niwa. 7 8 Add threading assertion to WeakPtr's operator->() to make sure that the WeakPtr 9 always gets dereferenced on the same thread it was constructed on. 10 11 * wtf/WeakPtr.h: 12 (WTF::WeakPtrImpl::get): 13 (WTF::WeakPtrImpl::WeakPtrImpl): 14 1 15 2019-07-31 Youenn Fablet <youenn@apple.com> 2 16 -
trunk/Source/WTF/wtf/WeakPtr.h
r247425 r248113 63 63 template<typename T> typename T::WeakValueType* get() 64 64 { 65 // FIXME: We need to fix thread-safety bugs in WebCore and stop being more permissive for GC threads here. 66 ASSERT(Thread::mayBeGCThread() || m_wasConstructedOnMainThread == isMainThread()); 65 67 return static_cast<typename T::WeakValueType*>(m_ptr); 66 68 } … … 72 74 template<typename T> explicit WeakPtrImpl(T* ptr) 73 75 : m_ptr(static_cast<typename T::WeakValueType*>(ptr)) 76 #if !ASSERT_DISABLED 77 , m_wasConstructedOnMainThread(isMainThread()) 78 #endif 74 79 { 75 80 DID_CREATE_WEAK_PTR_IMPL(ptr); … … 77 82 78 83 void* m_ptr; 84 #if !ASSERT_DISABLED 85 bool m_wasConstructedOnMainThread; 86 #endif 79 87 }; 80 88
Note: See TracChangeset
for help on using the changeset viewer.