NowPlayingInfo should contain a unique identifier
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Oct 2017 22:44:18 +0000 (22:44 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Oct 2017 22:44:18 +0000 (22:44 +0000)
commit92abac26e00749244484de7c90a999653bb25c86
tree751b681aba179d0fa72516e9526a0d9af0fb0875
parent183f22c5e1f61480793be2c8bd9c0c2a30140a15
NowPlayingInfo should contain a unique identifier
https://bugs.webkit.org/show_bug.cgi?id=178872

Reviewed by Jer Noble.

Source/WebCore:

Updated TestWebKitAPI/Tests/WebKitCocoa/NowPlayingControlsTests.mm.

* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingInfoUniqueIdentifier const): New.

* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Ditto.

* platform/audio/mac/MediaSessionManagerMac.h:
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Ditto. Don't leak CFString.

* platform/mac/MediaRemoteSoftLink.cpp: Softlink kMRMediaRemoteNowPlayingInfoUniqueIdentifier.
* platform/mac/MediaRemoteSoftLink.h:

Source/WebKit:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _requestActiveNowPlayingSessionInfo:]): Take a completion handler.
(-[WKWebView _requestActiveNowPlayingSessionInfo]): Deleted.
(-[WKWebView _handleActiveNowPlayingSessionInfoResponse:title:duration:elapsedTime:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/PageClient.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo): Ditto.
(WebKit::WebPageProxy::nowPlayingInfoCallback): Lookup and call completion handler.
(WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse const): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:

* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse): Deleted.

* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse): Deleted.

* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::requestActiveNowPlayingSessionInfo): Take callback ID. Pass unique ID.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/NowPlayingControlsTests.mm:
(-[NowPlayingTestWebView hasActiveNowPlayingSession]): Use completion handler.
(TestWebKitAPI::TEST): Cleanup tests. Use new API.
(-[NowPlayingTestWebView waitForNowPlayingInfoToChange]): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/audio/PlatformMediaSessionManager.h
Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h
Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm
Source/WebCore/platform/audio/mac/MediaSessionManagerMac.h
Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm
Source/WebCore/platform/mac/MediaRemoteSoftLink.cpp
Source/WebCore/platform/mac/MediaRemoteSoftLink.h
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
Source/WebKit/UIProcess/PageClient.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/WebPageProxy.messages.in
Source/WebKit/UIProcess/ios/PageClientImplIOS.h
Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
Source/WebKit/UIProcess/mac/PageClientImplMac.h
Source/WebKit/UIProcess/mac/PageClientImplMac.mm
Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm
Source/WebKit/WebProcess/WebPage/WebPage.h
Source/WebKit/WebProcess/WebPage/WebPage.messages.in
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/NowPlayingControlsTests.mm