[Mac] Restructure WebMediaSessionManager for testing
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Aug 2015 00:14:54 +0000 (00:14 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Aug 2015 00:14:54 +0000 (00:14 +0000)
commit7978178ff9136c6b39b40b3753792e2274d50175
treea141c33e1524a4f6ea2eeadd354b251487c8db3f
parent4d34485331380775b392863be8038130b1290df4
[Mac] Restructure WebMediaSessionManager for testing
https://bugs.webkit.org/show_bug.cgi?id=148593

Reviewed by Jer Noble.

Source/WebCore:

No new tests, no functional change.

* Modules/mediasession/WebMediaSessionManager.cpp:
(WebCore::mediaProducerStateString): Add some missing states.
(WebCore::webMediaSessionManagerOverride): New.
(WebCore::WebMediaSessionManager::singleton): New.
(WebCore::WebMediaSessionManager::setWebMediaSessionManagerOverride): New, will allow runtime
  registration of a mock manager.
* Modules/mediasession/WebMediaSessionManager.h:

* platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp:
(WebCore::WebMediaSessionManager::platformManager): Renamed from singleton.
(WebCore::WebMediaSessionManagerMac::singleton): Deleted.
* platform/graphics/avfoundation/WebMediaSessionManagerMac.h:

Source/WebKit/mac:

* WebView/WebMediaPlaybackTargetPicker.mm:
(WebMediaPlaybackTargetPicker::addPlaybackTargetPickerClient): Call WebMediaSessionManager::singleton,
  not WebMediaSessionManagerMac::singleton.
(WebMediaPlaybackTargetPicker::removePlaybackTargetPickerClient): Ditto.
(WebMediaPlaybackTargetPicker::showPlaybackTargetPicker): Ditto.
(WebMediaPlaybackTargetPicker::playbackTargetPickerClientStateDidChange): Ditto.
(WebMediaPlaybackTargetPicker::setPlaybackTarget): Ditto.
(WebMediaPlaybackTargetPicker::invalidate): Ditto.

Source/WebKit2:

* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::mediaSessionManager): Call WebMediaSessionManager::singleton, not
  WebMediaSessionManagerMac::singleton.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189135 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediasession/WebMediaSessionManager.cpp
Source/WebCore/Modules/mediasession/WebMediaSessionManager.h
Source/WebCore/platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp
Source/WebCore/platform/graphics/avfoundation/WebMediaSessionManagerMac.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebMediaPlaybackTargetPicker.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/mac/PageClientImpl.mm