Changeset 218705 in webkit
- Timestamp:
- Jun 22, 2017 10:34:35 AM (7 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r218704 r218705 1 2017-06-22 Brady Eidson <beidson@apple.com> 2 3 Add some thread safety guards to GenericCallback. 4 https://bugs.webkit.org/show_bug.cgi?id=173693 5 6 Reviewed by Sam Weinig. 7 8 A callback should be created, performed, invalidated, and/or destroyed all on the same thread. 9 Let's write code to notify us if that doesn't happen. 10 11 * UIProcess/GenericCallback.h: 12 (WebKit::GenericCallback::~GenericCallback): 13 (WebKit::GenericCallback::performCallbackWithReturnValue): 14 (WebKit::GenericCallback::invalidate): 15 1 16 2017-06-22 David Kilzer <ddkilzer@apple.com> 2 17 -
trunk/Source/WebKit2/UIProcess/GenericCallback.h
r218676 r218705 36 36 #include <wtf/RefCounted.h> 37 37 #include <wtf/RunLoop.h> 38 #include <wtf/Threading.h> 38 39 39 40 namespace WebKit { … … 101 102 virtual ~GenericCallback() 102 103 { 104 ASSERT(currentThread() == m_originThreadID); 103 105 ASSERT(!m_callback); 104 106 } … … 106 108 void performCallbackWithReturnValue(T... returnValue) 107 109 { 110 ASSERT(currentThread() == m_originThreadID); 111 108 112 if (!m_callback) 109 113 return; … … 121 125 void invalidate(Error error = Error::Unknown) final 122 126 { 127 ASSERT(currentThread() == m_originThreadID); 128 123 129 if (!m_callback) 124 130 return; … … 144 150 145 151 std::optional<CallbackFunction> m_callback; 152 153 #ifndef NDEBUG 154 ThreadIdentifier m_originThreadID { currentThread() }; 155 #endif 146 156 }; 147 157
Note: See TracChangeset
for help on using the changeset viewer.