Changeset 247415 in webkit
- Timestamp:
- Jul 13, 2019 4:07:41 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r247407 r247415 1 2019-07-13 Chris Dumez <cdumez@apple.com> 2 3 Fix non thread-safe usage of makeWeakPtr() in MediaPlayerPrivateAVFoundation 4 https://bugs.webkit.org/show_bug.cgi?id=199777 5 6 Reviewed by Eric Carlson. 7 8 The code was calling makeWeakPtr() on a main-thread object, from a background thread. 9 This is not thread safe. To address the issue, this patches creates the WeakPtr ahead 10 of time, on the main thread. 11 12 * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: 13 (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation): 14 (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification): 15 (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification): 16 * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: 17 1 18 2019-07-12 Thibault Saunier <tsaunier@igalia.com> 2 19 -
trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp
r245510 r247415 56 56 57 57 MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation(MediaPlayer* player) 58 : m_player(player) 58 : m_weakThis(makeWeakPtr(*this)) 59 , m_player(player) 59 60 , m_queuedNotifications() 60 61 , m_queueMutex() … … 775 776 m_mainThreadCallPending = true; 776 777 777 callOnMainThread([weakThis = m akeWeakPtr(*this)] {778 callOnMainThread([weakThis = m_weakThis] { 778 779 if (!weakThis) 779 780 return; … … 808 809 809 810 if (!m_queuedNotifications.isEmpty() && !m_mainThreadCallPending) { 810 callOnMainThread([weakThis = m akeWeakPtr(*this)] {811 callOnMainThread([weakThis = m_weakThis] { 811 812 if (!weakThis) 812 813 return; -
trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h
r240123 r247415 328 328 329 329 private: 330 WeakPtr<MediaPlayerPrivateAVFoundation> m_weakThis; 330 331 MediaPlayer* m_player; 331 332
Note: See TracChangeset
for help on using the changeset viewer.