Title: [206551] trunk/Source/WebCore
Revision
206551
Author
[email protected]
Date
2016-09-28 14:27:29 -0700 (Wed, 28 Sep 2016)

Log Message

Some media tests are crashing due to soft-linking failures
https://bugs.webkit.org/show_bug.cgi?id=162698

Reviewed by Jer Noble.

We should be handling soft-linking failures for MRMediaRemoteSetNowPlayingVisibility gracefully. Guards these
calls with canLoad_MediaRemote_MRMediaRemoteSetParentApplication and also use the
SOFT_LINK_FUNCTION_MAY_FAIL_FOR_HEADER macro when soft linking.

* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
* platform/mac/MediaRemoteSoftLink.cpp:
* platform/mac/MediaRemoteSoftLink.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (206550 => 206551)


--- trunk/Source/WebCore/ChangeLog	2016-09-28 21:23:29 UTC (rev 206550)
+++ trunk/Source/WebCore/ChangeLog	2016-09-28 21:27:29 UTC (rev 206551)
@@ -1,3 +1,19 @@
+2016-09-28  Wenson Hsieh  <[email protected]>
+
+        Some media tests are crashing due to soft-linking failures
+        https://bugs.webkit.org/show_bug.cgi?id=162698
+
+        Reviewed by Jer Noble.
+
+        We should be handling soft-linking failures for MRMediaRemoteSetNowPlayingVisibility gracefully. Guards these
+        calls with canLoad_MediaRemote_MRMediaRemoteSetParentApplication and also use the
+        SOFT_LINK_FUNCTION_MAY_FAIL_FOR_HEADER macro when soft linking.
+
+        * platform/audio/mac/MediaSessionManagerMac.mm:
+        (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
+        * platform/mac/MediaRemoteSoftLink.cpp:
+        * platform/mac/MediaRemoteSoftLink.h:
+
 2016-09-28  Alex Christensen  <[email protected]>
 
         URLParser should ignore tabs in authority

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


--- trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm	2016-09-28 21:23:29 UTC (rev 206550)
+++ trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm	2016-09-28 21:27:29 UTC (rev 206551)
@@ -130,7 +130,9 @@
 
     if (!currentSession) {
         if (m_nowPlayingActive) {
-            MRMediaRemoteSetNowPlayingVisibility(MRMediaRemoteGetLocalOrigin(), MRNowPlayingClientVisibilityNeverVisible);
+            if (canLoad_MediaRemote_MRMediaRemoteSetNowPlayingVisibility())
+                MRMediaRemoteSetNowPlayingVisibility(MRMediaRemoteGetLocalOrigin(), MRNowPlayingClientVisibilityNeverVisible);
+
             LOG(Media, "MediaSessionManagerMac::updateNowPlayingInfo - clearing now playing info");
             MRMediaRemoteSetNowPlayingInfo(nullptr);
             m_nowPlayingActive = false;
@@ -151,7 +153,8 @@
         MRMediaRemoteSetCanBeNowPlayingApplication(true);
     });
 
-    MRMediaRemoteSetNowPlayingVisibility(MRMediaRemoteGetLocalOrigin(), MRNowPlayingClientVisibilityAlwaysVisible);
+    if (canLoad_MediaRemote_MRMediaRemoteSetNowPlayingVisibility())
+        MRMediaRemoteSetNowPlayingVisibility(MRMediaRemoteGetLocalOrigin(), MRNowPlayingClientVisibilityAlwaysVisible);
 
     String title = currentSession->title();
     double duration = currentSession->duration();

Modified: trunk/Source/WebCore/platform/mac/MediaRemoteSoftLink.cpp (206550 => 206551)


--- trunk/Source/WebCore/platform/mac/MediaRemoteSoftLink.cpp	2016-09-28 21:23:29 UTC (rev 206550)
+++ trunk/Source/WebCore/platform/mac/MediaRemoteSoftLink.cpp	2016-09-28 21:27:29 UTC (rev 206551)
@@ -35,7 +35,7 @@
 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteAddAsyncCommandHandlerBlock, void*, (MRMediaRemoteAsyncCommandHandlerBlock block), (block))
 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteRemoveCommandHandlerBlock, void, (void* observer), (observer))
 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteSetSupportedCommands, void, (CFArrayRef commands, MROriginRef origin, dispatch_queue_t replyQ, void(^completion)(MRMediaRemoteError err)), (commands, origin, replyQ, completion))
-SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteSetNowPlayingVisibility, void, (MROriginRef origin, MRNowPlayingClientVisibility visibility), (origin, visibility))
+SOFT_LINK_FUNCTION_MAY_FAIL_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteSetNowPlayingVisibility, void, (MROriginRef origin, MRNowPlayingClientVisibility visibility), (origin, visibility))
 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteCommandInfoCreate, MRMediaRemoteCommandInfoRef, (CFAllocatorRef allocator), (allocator));
 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteCommandInfoSetCommand, void, (MRMediaRemoteCommandInfoRef commandInfo, MRMediaRemoteCommand command), (commandInfo, command))
 SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteCommandInfoSetEnabled, void, (MRMediaRemoteCommandInfoRef commandInfo, Boolean enabled), (commandInfo, enabled))

Modified: trunk/Source/WebCore/platform/mac/MediaRemoteSoftLink.h (206550 => 206551)


--- trunk/Source/WebCore/platform/mac/MediaRemoteSoftLink.h	2016-09-28 21:23:29 UTC (rev 206550)
+++ trunk/Source/WebCore/platform/mac/MediaRemoteSoftLink.h	2016-09-28 21:27:29 UTC (rev 206551)
@@ -39,7 +39,7 @@
 #define MRMediaRemoteRemoveCommandHandlerBlock softLink_MediaRemote_MRMediaRemoteRemoveCommandHandlerBlock
 SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteSetSupportedCommands, void, (CFArrayRef commands, MROriginRef origin, dispatch_queue_t replyQ, void(^completion)(MRMediaRemoteError err)), (commands, origin, replyQ, completion))
 #define MRMediaRemoteSetSupportedCommands softLink_MediaRemote_MRMediaRemoteSetSupportedCommands
-SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteSetNowPlayingVisibility, void, (MROriginRef origin, MRNowPlayingClientVisibility visibility), (origin, visibility))
+SOFT_LINK_FUNCTION_MAY_FAIL_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteSetNowPlayingVisibility, void, (MROriginRef origin, MRNowPlayingClientVisibility visibility), (origin, visibility))
 #define MRMediaRemoteSetNowPlayingVisibility softLink_MediaRemote_MRMediaRemoteSetNowPlayingVisibility
 SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteCommandInfoCreate, MRMediaRemoteCommandInfoRef, (CFAllocatorRef allocator), (allocator));
 #define MRMediaRemoteCommandInfoCreate softLink_MediaRemote_MRMediaRemoteCommandInfoCreate
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to