Title: [252331] trunk/Source/WebCore
Revision
252331
Author
jer.no...@apple.com
Date
2019-11-11 10:06:45 -0800 (Mon, 11 Nov 2019)

Log Message

Ensure MediaRemote callback always called.
https://bugs.webkit.org/show_bug.cgi?id=204072
<rdar://problem/56301651>

Reviewed by Eric Carlson.

MediaRemote.framework will complain if the callback passed in via MRMediaRemoteAddAsyncCommandHandlerBlock()
is not called for each invocation of the handler. Make sure we always call the completion handler, even in
the case of unsupported commands, or if the listener object has already been destroyed.

* platform/mac/RemoteCommandListenerMac.mm:
(WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (252330 => 252331)


--- trunk/Source/WebCore/ChangeLog	2019-11-11 18:01:20 UTC (rev 252330)
+++ trunk/Source/WebCore/ChangeLog	2019-11-11 18:06:45 UTC (rev 252331)
@@ -1,3 +1,18 @@
+2019-11-11  Jer Noble  <jer.no...@apple.com>
+
+        Ensure MediaRemote callback always called.
+        https://bugs.webkit.org/show_bug.cgi?id=204072
+        <rdar://problem/56301651>
+
+        Reviewed by Eric Carlson.
+
+        MediaRemote.framework will complain if the callback passed in via MRMediaRemoteAddAsyncCommandHandlerBlock()
+        is not called for each invocation of the handler. Make sure we always call the completion handler, even in
+        the case of unsupported commands, or if the listener object has already been destroyed.
+
+        * platform/mac/RemoteCommandListenerMac.mm:
+        (WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac):
+
 2019-11-11  Peng Liu  <peng.l...@apple.com>
 
         [Picture-in-Picture Web API] Support picture-in-picture CSS pseudo-class

Modified: trunk/Source/WebCore/platform/mac/RemoteCommandListenerMac.mm (252330 => 252331)


--- trunk/Source/WebCore/platform/mac/RemoteCommandListenerMac.mm	2019-11-11 18:01:20 UTC (rev 252330)
+++ trunk/Source/WebCore/platform/mac/RemoteCommandListenerMac.mm	2019-11-11 18:06:45 UTC (rev 252331)
@@ -137,12 +137,11 @@
         default:
             LOG(Media, "RemoteCommandListenerMac::RemoteCommandListenerMac - command %u not supported!", command);
             status = MRMediaRemoteCommandHandlerStatusCommandFailed;
-            return;
         };
 
-        if (!weakThis)
-            return;
-        weakThis->m_client.didReceiveRemoteControlCommand(platformCommand, &argument);
+        if (weakThis && status != MRMediaRemoteCommandHandlerStatusCommandFailed)
+            weakThis->m_client.didReceiveRemoteControlCommand(platformCommand, &argument);
+
         completion((__bridge CFArrayRef)@[@(status)]);
     });
 #endif // USE(MEDIAREMOTE)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to