Title: [193798] trunk/Source/WebCore
Revision
193798
Author
[email protected]
Date
2015-12-08 17:18:29 -0800 (Tue, 08 Dec 2015)

Log Message

Changing <video> src during 'ended' event can leave screen sleep disabled
https://bugs.webkit.org/show_bug.cgi?id=152018

Reviewed by Eric Carlson.

Resetting a HTMLMediaElement's src during 'ended' introduces a race condition: whether
the 'mediaPlayerRateChanged()' notification will fire before createMediaPlayer() destroys
the old MediaPlayer firing said notification.

To break the race condition, always update the sleep disabling assertion after destroying
the media player (by creating a new one).

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::createMediaPlayer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (193797 => 193798)


--- trunk/Source/WebCore/ChangeLog	2015-12-09 00:40:04 UTC (rev 193797)
+++ trunk/Source/WebCore/ChangeLog	2015-12-09 01:18:29 UTC (rev 193798)
@@ -1,3 +1,20 @@
+2015-12-08  Jer Noble  <[email protected]>
+
+        Changing <video> src during 'ended' event can leave screen sleep disabled
+        https://bugs.webkit.org/show_bug.cgi?id=152018
+
+        Reviewed by Eric Carlson.
+
+        Resetting a HTMLMediaElement's src during 'ended' introduces a race condition: whether
+        the 'mediaPlayerRateChanged()' notification will fire before createMediaPlayer() destroys
+        the old MediaPlayer firing said notification.
+
+        To break the race condition, always update the sleep disabling assertion after destroying
+        the media player (by creating a new one).
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::createMediaPlayer):
+
 2015-12-08  Brady Eidson  <[email protected]>
 
         Modern IDB: Fire blocked events for delete requests that are blocked.

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (193797 => 193798)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2015-12-09 00:40:04 UTC (rev 193797)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2015-12-09 01:18:29 UTC (rev 193798)
@@ -5790,6 +5790,8 @@
         enqueuePlaybackTargetAvailabilityChangedEvent(); // Ensure the event listener gets at least one event.
     }
 #endif
+
+    updateSleepDisabling();
 }
 
 #if ENABLE(WEB_AUDIO)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to