Title: [227529] trunk/Source/WebCore
Revision
227529
Author
eric.carl...@apple.com
Date
2018-01-24 10:07:18 -0800 (Wed, 24 Jan 2018)

Log Message

REGRESSION(r227457): Release assert in updateLayout while destructing a media element
https://bugs.webkit.org/show_bug.cgi?id=182038
<rdar://problem/36812083>

Reviewed by Jer Noble.

* html/MediaElementSession.cpp:
(WebCore::isMainContentForPurposesOfAutoplay): Early return if element.isSuspended().
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::clientCharacteristicsChanged): Call scheduleUpdateNowPlayingInfo
instead of updateNowPlayingInfo.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (227528 => 227529)


--- trunk/Source/WebCore/ChangeLog	2018-01-24 18:04:53 UTC (rev 227528)
+++ trunk/Source/WebCore/ChangeLog	2018-01-24 18:07:18 UTC (rev 227529)
@@ -1,3 +1,17 @@
+2018-01-24  Eric Carlson  <eric.carl...@apple.com>
+
+        REGRESSION(r227457): Release assert in updateLayout while destructing a media element
+        https://bugs.webkit.org/show_bug.cgi?id=182038
+        <rdar://problem/36812083>
+
+        Reviewed by Jer Noble.
+
+        * html/MediaElementSession.cpp:
+        (WebCore::isMainContentForPurposesOfAutoplay): Early return if element.isSuspended().
+        * platform/audio/mac/MediaSessionManagerMac.mm:
+        (WebCore::MediaSessionManagerMac::clientCharacteristicsChanged): Call scheduleUpdateNowPlayingInfo
+        instead of updateNowPlayingInfo.
+
 2018-01-24  Chris Fleizach  <cfleiz...@apple.com>
 
         AX: Provide a way for VoiceOver to uniquely identify a web session

Modified: trunk/Source/WebCore/html/MediaElementSession.cpp (227528 => 227529)


--- trunk/Source/WebCore/html/MediaElementSession.cpp	2018-01-24 18:04:53 UTC (rev 227528)
+++ trunk/Source/WebCore/html/MediaElementSession.cpp	2018-01-24 18:07:18 UTC (rev 227529)
@@ -695,7 +695,7 @@
 static bool isMainContentForPurposesOfAutoplay(const HTMLMediaElement& element)
 {
     Document& document = element.document();
-    if (!document.isSafeToUpdateStyleOrLayout() || !element.hasAudio() || !element.hasVideo())
+    if (element.isSuspended() || !element.hasAudio() || !element.hasVideo())
         return false;
 
     // Elements which have not yet been laid out, or which are not yet in the DOM, cannot be main content.
@@ -715,7 +715,7 @@
         return false;
 
     // Main content elements must be in the main frame.
-    if (!document.frame() || !document.frame()->isMainFrame())
+    if (!document.frame() || !document.frame()->isMainFrame() || !document.isSafeToUpdateStyleOrLayout())
         return false;
 
     MainFrame& mainFrame = document.frame()->mainFrame();

Modified: trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm (227528 => 227529)


--- trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm	2018-01-24 18:04:53 UTC (rev 227528)
+++ trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm	2018-01-24 18:07:18 UTC (rev 227529)
@@ -102,7 +102,7 @@
 void MediaSessionManagerMac::clientCharacteristicsChanged(PlatformMediaSession&)
 {
     LOG(Media, "MediaSessionManagerMac::clientCharacteristicsChanged");
-    updateNowPlayingInfo();
+    scheduleUpdateNowPlayingInfo();
 }
 
 PlatformMediaSession* MediaSessionManagerMac::nowPlayingEligibleSession()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to