Changeset 185570 in webkit
- Timestamp:
- Jun 15, 2015 4:06:01 PM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r185569 r185570 1 2015-06-15 Matt Rajca <mrajca@apple.com> 2 3 Media Session: Improve the safety of playback toggling 4 https://bugs.webkit.org/show_bug.cgi?id=145986 5 6 Reviewed by Darin Adler. 7 8 * Modules/mediasession/MediaSession.cpp: 9 (WebCore::MediaSession::togglePlayback): Improved the safety of the loop so that we don't re-visit elements that 10 may have been deleted underneath us. 11 * Modules/mediasession/MediaSession.h: Added a pointer to the set of iterated active participating elements so 12 we can remove any elements that are deleted from the underlying "real" set. 13 1 14 2015-06-15 Brent Fulgham <bfulgham@apple.com> 2 15 -
trunk/Source/WebCore/Modules/mediasession/MediaSession.cpp
r185560 r185570 95 95 void MediaSession::togglePlayback() 96 96 { 97 ASSERT(!m_iteratedActiveParticipatingElements); 98 97 99 HashSet<HTMLMediaElement*> activeParticipatingElementsCopy = m_activeParticipatingElements; 100 m_iteratedActiveParticipatingElements = &activeParticipatingElementsCopy; 98 101 99 for (auto* element : activeParticipatingElementsCopy) { 102 while (!activeParticipatingElementsCopy.isEmpty()) { 103 HTMLMediaElement* element = activeParticipatingElementsCopy.takeAny(); 104 100 105 if (element->paused()) 101 106 element->play(); … … 103 108 element->pause(); 104 109 } 110 111 m_iteratedActiveParticipatingElements = nullptr; 105 112 } 106 113 -
trunk/Source/WebCore/Modules/mediasession/MediaSession.h
r185514 r185570 74 74 Vector<HTMLMediaElement*> m_participatingElements; 75 75 HashSet<HTMLMediaElement*> m_activeParticipatingElements; 76 HashSet<HTMLMediaElement*>* m_iteratedActiveParticipatingElements { nullptr }; 76 77 77 78 const String m_kind;
Note: See TracChangeset
for help on using the changeset viewer.