Title: [262880] trunk/Source/WebCore
Revision
262880
Author
[email protected]
Date
2020-06-10 17:33:24 -0700 (Wed, 10 Jun 2020)

Log Message

[Cocoa] CRASH: imported/w3c/web-platform-tests/remote-playback/watch-availability-initial-callback.html is flaky crashing
https://bugs.webkit.org/show_bug.cgi?id=213044
<rdar://problem/62317723>

Reviewed by Eric Carlson.

Add null-checks around previously non-null-checked derefs of WeakPtr<HTMLMediaElement>.

* Modules/remoteplayback/RemotePlayback.cpp:
(WebCore::RemotePlayback::watchAvailability):
(WebCore::RemotePlayback::shouldPlayToRemoteTargetChanged):
(WebCore::RemotePlayback::playbackTargetPickerWasDismissed):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (262879 => 262880)


--- trunk/Source/WebCore/ChangeLog	2020-06-11 00:28:06 UTC (rev 262879)
+++ trunk/Source/WebCore/ChangeLog	2020-06-11 00:33:24 UTC (rev 262880)
@@ -1,3 +1,18 @@
+2020-06-10  Jer Noble  <[email protected]>
+
+        [Cocoa] CRASH: imported/w3c/web-platform-tests/remote-playback/watch-availability-initial-callback.html is flaky crashing
+        https://bugs.webkit.org/show_bug.cgi?id=213044
+        <rdar://problem/62317723>
+
+        Reviewed by Eric Carlson.
+
+        Add null-checks around previously non-null-checked derefs of WeakPtr<HTMLMediaElement>.
+
+        * Modules/remoteplayback/RemotePlayback.cpp:
+        (WebCore::RemotePlayback::watchAvailability):
+        (WebCore::RemotePlayback::shouldPlayToRemoteTargetChanged):
+        (WebCore::RemotePlayback::playbackTargetPickerWasDismissed):
+
 2020-06-10  Sihui Liu  <[email protected]>
 
         Text manipulation does not observe inserted elements that are invisible

Modified: trunk/Source/WebCore/Modules/remoteplayback/RemotePlayback.cpp (262879 => 262880)


--- trunk/Source/WebCore/Modules/remoteplayback/RemotePlayback.cpp	2020-06-11 00:28:06 UTC (rev 262879)
+++ trunk/Source/WebCore/Modules/remoteplayback/RemotePlayback.cpp	2020-06-11 00:33:24 UTC (rev 262880)
@@ -106,7 +106,8 @@
             });
 
             // 8.2 Run the algorithm to monitor the list of available remote playback devices.
-            m_mediaElement->remoteHasAvailabilityCallbacksChanged();
+            if (m_mediaElement)
+                m_mediaElement->remoteHasAvailabilityCallbacksChanged();
         });
         promise->resolve<IDLLong>(callbackId);
     });
@@ -257,7 +258,8 @@
     else
         disconnect();
 
-    m_mediaElement->remoteHasAvailabilityCallbacksChanged();
+    if (m_mediaElement)
+        m_mediaElement->remoteHasAvailabilityCallbacksChanged();
 }
 
 void RemotePlayback::setState(State state)
@@ -342,7 +344,9 @@
 
     for (auto& promise : std::exchange(m_promptPromises, { }))
         promise->reject(NotAllowedError);
-    m_mediaElement->remoteHasAvailabilityCallbacksChanged();
+
+    if (m_mediaElement)
+        m_mediaElement->remoteHasAvailabilityCallbacksChanged();
 }
 
 void RemotePlayback::isPlayingToRemoteTargetChanged(bool isPlayingToTarget)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to