Changeset 247425 in webkit
- Timestamp:
- Jul 14, 2019 3:18:03 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r247422 r247425 1 2019-07-14 Chris Dumez <cdumez@apple.com> 2 3 Add threading assertion to WeakPtrFactory::createWeakPtr() 4 https://bugs.webkit.org/show_bug.cgi?id=199639 5 6 Reviewed by Ryosuke Niwa. 7 8 Add threading assertion to WeakPtrFactory::createWeakPtr() to make sure it 9 is called on the same thread where the WeakPtrFactory wad constructed. 10 11 * wtf/WeakPtr.h: 12 (WTF::WeakPtrFactory::WeakPtrFactory): 13 (WTF::WeakPtrFactory::createWeakPtr const): 14 1 15 2019-07-14 Dean Jackson <dino@apple.com> 2 16 -
trunk/Source/WTF/wtf/WeakPtr.h
r245972 r247425 27 27 #pragma once 28 28 29 #include <wtf/MainThread.h> 29 30 #include <wtf/Noncopyable.h> 30 31 #include <wtf/Ref.h> … … 115 116 WTF_MAKE_FAST_ALLOCATED; 116 117 public: 117 WeakPtrFactory() = default; 118 WeakPtrFactory() 119 #if !ASSERT_DISABLED 120 : m_wasConstructedOnMainThread(isMainThread()) 121 #endif 122 { 123 } 124 118 125 ~WeakPtrFactory() 119 126 { … … 125 132 WeakPtr<T> createWeakPtr(T& object) const 126 133 { 134 ASSERT(m_wasConstructedOnMainThread == isMainThread()); 127 135 if (!m_impl) 128 136 m_impl = WeakPtrImpl::create(&object); … … 134 142 WeakPtr<const T> createWeakPtr(const T& object) const 135 143 { 144 ASSERT(m_wasConstructedOnMainThread == isMainThread()); 136 145 if (!m_impl) 137 146 m_impl = WeakPtrImpl::create(const_cast<T*>(&object)); … … 154 163 155 164 mutable RefPtr<WeakPtrImpl> m_impl; 165 #if !ASSERT_DISABLED 166 bool m_wasConstructedOnMainThread; 167 #endif 156 168 }; 157 169 -
trunk/Source/WebCore/ChangeLog
r247422 r247425 1 2019-07-14 Chris Dumez <cdumez@apple.com> 2 3 Add threading assertion to WeakPtrFactory::createWeakPtr() 4 https://bugs.webkit.org/show_bug.cgi?id=199639 5 6 Reviewed by Ryosuke Niwa. 7 8 * platform/ScrollableArea.cpp: 9 * rendering/RenderObject.cpp: 10 1 11 2019-07-14 Dean Jackson <dino@apple.com> 2 12 -
trunk/Source/WebCore/platform/ScrollableArea.cpp
r246488 r247425 48 48 struct SameSizeAsScrollableArea { 49 49 virtual ~SameSizeAsScrollableArea(); 50 #if !ASSERT_DISABLED 51 bool weakPtrFactorWasConstructedOnMainThread; 52 #endif 50 53 #if ENABLE(CSS_SCROLL_SNAP) 51 54 void* pointers[3]; -
trunk/Source/WebCore/rendering/RenderObject.cpp
r246950 r247425 103 103 struct SameSizeAsRenderObject { 104 104 virtual ~SameSizeAsRenderObject() = default; // Allocate vtable pointer. 105 #if !ASSERT_DISABLED 106 bool weakPtrFactorWasConstructedOnMainThread; 107 #endif 105 108 void* pointers[5]; 106 109 #ifndef NDEBUG
Note: See TracChangeset
for help on using the changeset viewer.