Title: [185560] trunk/Source/WebCore
Revision
185560
Author
[email protected]
Date
2015-06-15 11:55:39 -0700 (Mon, 15 Jun 2015)

Log Message

Media Session: Active participating elements can change while being iterated
https://bugs.webkit.org/show_bug.cgi?id=145978

Patch by Matt Rajca <[email protected]> on 2015-06-15
Reviewed by Alex Christensen.

* Modules/mediasession/MediaSession.cpp:
(WebCore::MediaSession::togglePlayback): Iterate through a copy of m_activeParticipatingElements since its contents
  can be modified in the loop.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (185559 => 185560)


--- trunk/Source/WebCore/ChangeLog	2015-06-15 18:50:20 UTC (rev 185559)
+++ trunk/Source/WebCore/ChangeLog	2015-06-15 18:55:39 UTC (rev 185560)
@@ -1,3 +1,14 @@
+2015-06-15  Matt Rajca  <[email protected]>
+
+        Media Session: Active participating elements can change while being iterated 
+        https://bugs.webkit.org/show_bug.cgi?id=145978
+
+        Reviewed by Alex Christensen.
+
+        * Modules/mediasession/MediaSession.cpp:
+        (WebCore::MediaSession::togglePlayback): Iterate through a copy of m_activeParticipatingElements since its contents
+          can be modified in the loop.
+
 2015-06-15  Chris Fleizach  <[email protected]>
 
         AX: no accessibility support for details element

Modified: trunk/Source/WebCore/Modules/mediasession/MediaSession.cpp (185559 => 185560)


--- trunk/Source/WebCore/Modules/mediasession/MediaSession.cpp	2015-06-15 18:50:20 UTC (rev 185559)
+++ trunk/Source/WebCore/Modules/mediasession/MediaSession.cpp	2015-06-15 18:55:39 UTC (rev 185560)
@@ -94,7 +94,9 @@
 
 void MediaSession::togglePlayback()
 {
-    for (auto* element : m_activeParticipatingElements) {
+    HashSet<HTMLMediaElement*> activeParticipatingElementsCopy = m_activeParticipatingElements;
+
+    for (auto* element : activeParticipatingElementsCopy) {
         if (element->paused())
             element->play();
         else
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to