Rename MediaSession and MediaSessionClient to PlatformMediaSession and PlatformMediaS...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 May 2015 21:53:30 +0000 (21:53 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 May 2015 21:53:30 +0000 (21:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=145447

Patch by Matt Rajca <mrajca@apple.com> on 2015-05-29
Reviewed by Eric Carlson.

* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::AudioContext):
(WebCore::AudioContext::suspendPlayback):
* Modules/webaudio/AudioContext.h:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLAudioElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::pausedForUserInteraction):
(WebCore::HTMLMediaElement::mediaType):
(WebCore::HTMLMediaElement::presentationType):
(WebCore::HTMLMediaElement::displayType):
(WebCore::HTMLMediaElement::didReceiveRemoteControlCommand):
* html/HTMLMediaElement.h:
* html/HTMLMediaSession.cpp:
(WebCore::HTMLMediaSession::HTMLMediaSession):
(WebCore::HTMLMediaSession::requiresFullscreenForVideoPlayback):
* html/HTMLMediaSession.h:
* html/HTMLVideoElement.h:
* platform/RemoteCommandListener.h:
* platform/audio/MediaSessionManager.cpp:
(WebCore::MediaSessionManager::resetRestrictions):
(WebCore::MediaSessionManager::has):
(WebCore::MediaSessionManager::activeAudioSessionRequired):
(WebCore::MediaSessionManager::count):
(WebCore::MediaSessionManager::beginInterruption):
(WebCore::MediaSessionManager::endInterruption):
(WebCore::MediaSessionManager::addSession):
(WebCore::MediaSessionManager::removeSession):
(WebCore::MediaSessionManager::addRestriction):
(WebCore::MediaSessionManager::removeRestriction):
(WebCore::MediaSessionManager::restrictions):
(WebCore::MediaSessionManager::sessionWillBeginPlayback):
(WebCore::MediaSessionManager::sessionWillEndPlayback):
(WebCore::MediaSessionManager::setCurrentSession):
(WebCore::MediaSessionManager::currentSession):
(WebCore::MediaSessionManager::sessionRestrictsInlineVideoPlayback):
(WebCore::MediaSessionManager::sessionCanLoadMedia):
(WebCore::MediaSessionManager::applicationWillEnterBackground):
(WebCore::MediaSessionManager::applicationWillEnterForeground):
(WebCore::MediaSessionManager::didReceiveRemoteControlCommand):
(WebCore::MediaSessionManager::systemWillSleep):
(WebCore::MediaSessionManager::systemDidWake):
* platform/audio/MediaSessionManager.h:
(WebCore::MediaSessionManager::sessions):
* platform/audio/PlatformMediaSession.cpp: Renamed from Source/WebCore/platform/audio/MediaSession.cpp.
(WebCore::stateName):
(WebCore::PlatformMediaSession::create):
(WebCore::PlatformMediaSession::PlatformMediaSession):
(WebCore::PlatformMediaSession::~PlatformMediaSession):
(WebCore::PlatformMediaSession::setState):
(WebCore::PlatformMediaSession::beginInterruption):
(WebCore::PlatformMediaSession::endInterruption):
(WebCore::PlatformMediaSession::clientWillBeginPlayback):
(WebCore::PlatformMediaSession::clientWillPausePlayback):
(WebCore::PlatformMediaSession::pauseSession):
(WebCore::PlatformMediaSession::mediaType):
(WebCore::PlatformMediaSession::presentationType):
(WebCore::PlatformMediaSession::title):
(WebCore::PlatformMediaSession::duration):
(WebCore::PlatformMediaSession::currentTime):
(WebCore::PlatformMediaSession::canReceiveRemoteControlCommands):
(WebCore::PlatformMediaSession::didReceiveRemoteControlCommand):
(WebCore::PlatformMediaSession::visibilityChanged):
(WebCore::PlatformMediaSession::clientDataBufferingTimerFired):
(WebCore::PlatformMediaSession::updateClientDataBuffering):
(WebCore::PlatformMediaSession::isHidden):
(WebCore::PlatformMediaSession::displayType):
(WebCore::PlatformMediaSessionClient::mediaSessionTitle):
(WebCore::PlatformMediaSessionClient::mediaSessionDuration):
(WebCore::PlatformMediaSessionClient::mediaSessionCurrentTime):
* platform/audio/PlatformMediaSession.h: Renamed from Source/WebCore/platform/audio/MediaSession.h.
(WebCore::PlatformMediaSession::state):
(WebCore::PlatformMediaSession::canPlayToWirelessPlaybackTarget):
(WebCore::PlatformMediaSession::isPlayingToWirelessPlaybackTarget):
(WebCore::PlatformMediaSession::requiresPlaybackTargetRouteMonitoring):
(WebCore::PlatformMediaSession::client):
(WebCore::PlatformMediaSessionClient::PlatformMediaSessionClient):
(WebCore::PlatformMediaSessionClient::displayType):
(WebCore::PlatformMediaSessionClient::setShouldBufferData):
(WebCore::PlatformMediaSessionClient::elementIsHidden):
(WebCore::PlatformMediaSessionClient::wirelessRoutesAvailableDidChange):
(WebCore::PlatformMediaSessionClient::setWirelessPlaybackTarget):
(WebCore::PlatformMediaSessionClient::canPlayToWirelessPlaybackTarget):
(WebCore::PlatformMediaSessionClient::isPlayingToWirelessPlaybackTarget):
(WebCore::PlatformMediaSessionClient::setShouldPlayToPlaybackTarget):
(WebCore::PlatformMediaSessionClient::~PlatformMediaSessionClient):
* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::resetRestrictions):
(WebCore::MediaSessionManageriOS::sessionWillBeginPlayback):
(WebCore::MediaSessionManageriOS::sessionWillEndPlayback):
(WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
(WebCore::MediaSessionManageriOS::sessionCanLoadMedia):
(-[WebMediaSessionHelper interruption:]):
* platform/audio/mac/MediaSessionManagerMac.cpp:
(MediaSessionManager::updateSessionState):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::handlePlaybackCommand):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerHandlePlaybackCommand):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::rateChanged):
* platform/ios/RemoteCommandListenerIOS.mm:
(WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS):
* testing/Internals.cpp:
(WebCore::Internals::beginMediaSessionInterruption):
(WebCore::Internals::endMediaSessionInterruption):
(WebCore::Internals::setMediaSessionRestrictions):
(WebCore::Internals::postRemoteControlCommand):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185006 268f45cc-cd09-0410-ab3c-d52691b4dbfc

26 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/webaudio/AudioContext.cpp
Source/WebCore/Modules/webaudio/AudioContext.h
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/html/HTMLAudioElement.h
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/HTMLVideoElement.h
Source/WebCore/html/MediaElementSession.cpp
Source/WebCore/html/MediaElementSession.h
Source/WebCore/platform/RemoteCommandListener.h
Source/WebCore/platform/audio/MediaSessionManager.cpp
Source/WebCore/platform/audio/MediaSessionManager.h
Source/WebCore/platform/audio/PlatformMediaSession.cpp [moved from Source/WebCore/platform/audio/MediaSession.cpp with 64% similarity]
Source/WebCore/platform/audio/PlatformMediaSession.h [moved from Source/WebCore/platform/audio/MediaSession.h with 83% similarity]
Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h
Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm
Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp
Source/WebCore/platform/graphics/MediaPlayer.cpp
Source/WebCore/platform/graphics/MediaPlayer.h
Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp
Source/WebCore/platform/ios/RemoteCommandListenerIOS.mm
Source/WebCore/testing/Internals.cpp

index ba6a504..6af84d3 100644 (file)
@@ -2101,10 +2101,10 @@ set(WebCore_SOURCES
     platform/audio/HRTFElevation.cpp
     platform/audio/HRTFKernel.cpp
     platform/audio/HRTFPanner.cpp
-    platform/audio/MediaSession.cpp
     platform/audio/MediaSessionManager.cpp
     platform/audio/MultiChannelResampler.cpp
     platform/audio/Panner.cpp
+    platform/audio/PlatformMediaSession.cpp
     platform/audio/Reverb.cpp
     platform/audio/ReverbAccumulationBuffer.cpp
     platform/audio/ReverbConvolver.cpp
index 9883081..e8ca2e6 100644 (file)
@@ -1,3 +1,122 @@
+2015-05-29  Matt Rajca  <mrajca@apple.com>
+
+        Rename MediaSession and MediaSessionClient to PlatformMediaSession and PlatformMediaSessionClient so we can use MediaSession for the formal implementation of the Media Session spec.
+        https://bugs.webkit.org/show_bug.cgi?id=145447
+
+        Reviewed by Eric Carlson.
+
+        * Modules/webaudio/AudioContext.cpp:
+        (WebCore::AudioContext::AudioContext):
+        (WebCore::AudioContext::suspendPlayback):
+        * Modules/webaudio/AudioContext.h:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/HTMLAudioElement.h:
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::pausedForUserInteraction):
+        (WebCore::HTMLMediaElement::mediaType):
+        (WebCore::HTMLMediaElement::presentationType):
+        (WebCore::HTMLMediaElement::displayType):
+        (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand):
+        * html/HTMLMediaElement.h:
+        * html/HTMLMediaSession.cpp:
+        (WebCore::HTMLMediaSession::HTMLMediaSession):
+        (WebCore::HTMLMediaSession::requiresFullscreenForVideoPlayback):
+        * html/HTMLMediaSession.h:
+        * html/HTMLVideoElement.h:
+        * platform/RemoteCommandListener.h:
+        * platform/audio/MediaSessionManager.cpp:
+        (WebCore::MediaSessionManager::resetRestrictions):
+        (WebCore::MediaSessionManager::has):
+        (WebCore::MediaSessionManager::activeAudioSessionRequired):
+        (WebCore::MediaSessionManager::count):
+        (WebCore::MediaSessionManager::beginInterruption):
+        (WebCore::MediaSessionManager::endInterruption):
+        (WebCore::MediaSessionManager::addSession):
+        (WebCore::MediaSessionManager::removeSession):
+        (WebCore::MediaSessionManager::addRestriction):
+        (WebCore::MediaSessionManager::removeRestriction):
+        (WebCore::MediaSessionManager::restrictions):
+        (WebCore::MediaSessionManager::sessionWillBeginPlayback):
+        (WebCore::MediaSessionManager::sessionWillEndPlayback):
+        (WebCore::MediaSessionManager::setCurrentSession):
+        (WebCore::MediaSessionManager::currentSession):
+        (WebCore::MediaSessionManager::sessionRestrictsInlineVideoPlayback):
+        (WebCore::MediaSessionManager::sessionCanLoadMedia):
+        (WebCore::MediaSessionManager::applicationWillEnterBackground):
+        (WebCore::MediaSessionManager::applicationWillEnterForeground):
+        (WebCore::MediaSessionManager::didReceiveRemoteControlCommand):
+        (WebCore::MediaSessionManager::systemWillSleep):
+        (WebCore::MediaSessionManager::systemDidWake):
+        * platform/audio/MediaSessionManager.h:
+        (WebCore::MediaSessionManager::sessions):
+        * platform/audio/PlatformMediaSession.cpp: Renamed from Source/WebCore/platform/audio/MediaSession.cpp.
+        (WebCore::stateName):
+        (WebCore::PlatformMediaSession::create):
+        (WebCore::PlatformMediaSession::PlatformMediaSession):
+        (WebCore::PlatformMediaSession::~PlatformMediaSession):
+        (WebCore::PlatformMediaSession::setState):
+        (WebCore::PlatformMediaSession::beginInterruption):
+        (WebCore::PlatformMediaSession::endInterruption):
+        (WebCore::PlatformMediaSession::clientWillBeginPlayback):
+        (WebCore::PlatformMediaSession::clientWillPausePlayback):
+        (WebCore::PlatformMediaSession::pauseSession):
+        (WebCore::PlatformMediaSession::mediaType):
+        (WebCore::PlatformMediaSession::presentationType):
+        (WebCore::PlatformMediaSession::title):
+        (WebCore::PlatformMediaSession::duration):
+        (WebCore::PlatformMediaSession::currentTime):
+        (WebCore::PlatformMediaSession::canReceiveRemoteControlCommands):
+        (WebCore::PlatformMediaSession::didReceiveRemoteControlCommand):
+        (WebCore::PlatformMediaSession::visibilityChanged):
+        (WebCore::PlatformMediaSession::clientDataBufferingTimerFired):
+        (WebCore::PlatformMediaSession::updateClientDataBuffering):
+        (WebCore::PlatformMediaSession::isHidden):
+        (WebCore::PlatformMediaSession::displayType):
+        (WebCore::PlatformMediaSessionClient::mediaSessionTitle):
+        (WebCore::PlatformMediaSessionClient::mediaSessionDuration):
+        (WebCore::PlatformMediaSessionClient::mediaSessionCurrentTime):
+        * platform/audio/PlatformMediaSession.h: Renamed from Source/WebCore/platform/audio/MediaSession.h.
+        (WebCore::PlatformMediaSession::state):
+        (WebCore::PlatformMediaSession::canPlayToWirelessPlaybackTarget):
+        (WebCore::PlatformMediaSession::isPlayingToWirelessPlaybackTarget):
+        (WebCore::PlatformMediaSession::requiresPlaybackTargetRouteMonitoring):
+        (WebCore::PlatformMediaSession::client):
+        (WebCore::PlatformMediaSessionClient::PlatformMediaSessionClient):
+        (WebCore::PlatformMediaSessionClient::displayType):
+        (WebCore::PlatformMediaSessionClient::setShouldBufferData):
+        (WebCore::PlatformMediaSessionClient::elementIsHidden):
+        (WebCore::PlatformMediaSessionClient::wirelessRoutesAvailableDidChange):
+        (WebCore::PlatformMediaSessionClient::setWirelessPlaybackTarget):
+        (WebCore::PlatformMediaSessionClient::canPlayToWirelessPlaybackTarget):
+        (WebCore::PlatformMediaSessionClient::isPlayingToWirelessPlaybackTarget):
+        (WebCore::PlatformMediaSessionClient::setShouldPlayToPlaybackTarget):
+        (WebCore::PlatformMediaSessionClient::~PlatformMediaSessionClient):
+        * platform/audio/ios/MediaSessionManagerIOS.h:
+        * platform/audio/ios/MediaSessionManagerIOS.mm:
+        (WebCore::MediaSessionManageriOS::resetRestrictions):
+        (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback):
+        (WebCore::MediaSessionManageriOS::sessionWillEndPlayback):
+        (WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
+        (WebCore::MediaSessionManageriOS::sessionCanLoadMedia):
+        (-[WebMediaSessionHelper interruption:]):
+        * platform/audio/mac/MediaSessionManagerMac.cpp:
+        (MediaSessionManager::updateSessionState):
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::MediaPlayer::handlePlaybackCommand):
+        * platform/graphics/MediaPlayer.h:
+        (WebCore::MediaPlayerClient::mediaPlayerHandlePlaybackCommand):
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+        (WebCore::MediaPlayerPrivateAVFoundation::rateChanged):
+        * platform/ios/RemoteCommandListenerIOS.mm:
+        (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS):
+        * testing/Internals.cpp:
+        (WebCore::Internals::beginMediaSessionInterruption):
+        (WebCore::Internals::endMediaSessionInterruption):
+        (WebCore::Internals::setMediaSessionRestrictions):
+        (WebCore::Internals::postRemoteControlCommand):
+
 2015-05-29  Alex Christensen  <achristensen@webkit.org>
 
         [Content Extensions] Decrease maxNFASize
index c8f6d51..90ac490 100644 (file)
@@ -129,7 +129,7 @@ RefPtr<AudioContext> AudioContext::create(Document& document, ExceptionCode& ec)
 // Constructor for rendering to the audio hardware.
 AudioContext::AudioContext(Document& document)
     : ActiveDOMObject(&document)
-    , m_mediaSession(MediaSession::create(*this))
+    , m_mediaSession(PlatformMediaSession::create(*this))
     , m_eventQueue(std::make_unique<GenericEventQueue>(*this))
     , m_graphOwnerThread(UndefinedThreadIdentifier)
 {
@@ -145,7 +145,7 @@ AudioContext::AudioContext(Document& document)
 AudioContext::AudioContext(Document& document, unsigned numberOfChannels, size_t numberOfFrames, float sampleRate)
     : ActiveDOMObject(&document)
     , m_isOfflineContext(true)
-    , m_mediaSession(MediaSession::create(*this))
+    , m_mediaSession(PlatformMediaSession::create(*this))
     , m_eventQueue(std::make_unique<GenericEventQueue>(*this))
     , m_graphOwnerThread(UndefinedThreadIdentifier)
 {
@@ -1200,7 +1200,7 @@ void AudioContext::suspendPlayback()
         return;
 
     if (m_state == State::Suspended) {
-        if (m_mediaSession->state() == MediaSession::Interrupted)
+        if (m_mediaSession->state() == PlatformMediaSession::Interrupted)
             setState(State::Interrupted);
         return;
     }
@@ -1209,7 +1209,7 @@ void AudioContext::suspendPlayback()
 
     RefPtr<AudioContext> strongThis(this);
     m_destinationNode->suspend([strongThis] {
-        bool interrupted = strongThis->m_mediaSession->state() == MediaSession::Interrupted;
+        bool interrupted = strongThis->m_mediaSession->state() == PlatformMediaSession::Interrupted;
         strongThis->setState(interrupted ? State::Interrupted : State::Suspended);
     });
 }
index 9ff3532..43968f2 100644 (file)
@@ -33,7 +33,7 @@
 #include "EventTarget.h"
 #include "MediaCanStartListener.h"
 #include "MediaProducer.h"
-#include "MediaSession.h"
+#include "PlatformMediaSession.h"
 #include <atomic>
 #include <wtf/HashSet.h>
 #include <wtf/MainThread.h>
@@ -76,7 +76,7 @@ class PeriodicWave;
 // AudioContext is the cornerstone of the web audio API and all AudioNodes are created from it.
 // For thread safety between the audio thread and the main thread, it has a rendering graph locking mechanism. 
 
-class AudioContext : public ActiveDOMObject, public ThreadSafeRefCounted<AudioContext>, public EventTargetWithInlineData, public MediaCanStartListener, public MediaProducer, private MediaSessionClient {
+class AudioContext : public ActiveDOMObject, public ThreadSafeRefCounted<AudioContext>, public EventTargetWithInlineData, public MediaCanStartListener, public MediaProducer, private PlatformMediaSessionClient {
 public:
     // Create an AudioContext for rendering to the audio hardware.
     static RefPtr<AudioContext> create(Document&, ExceptionCode&);
@@ -308,13 +308,13 @@ private:
     // Make sure to dereference them here.
     void derefUnfinishedSourceNodes();
 
-    // MediaSessionClient
-    virtual MediaSession::MediaType mediaType() const override { return MediaSession::WebAudio; }
-    virtual MediaSession::MediaType presentationType() const override { return MediaSession::WebAudio; }
+    // PlatformMediaSessionClient
+    virtual PlatformMediaSession::MediaType mediaType() const override { return PlatformMediaSession::WebAudio; }
+    virtual PlatformMediaSession::MediaType presentationType() const override { return PlatformMediaSession::WebAudio; }
     virtual void mayResumePlayback(bool shouldResume) override;
     virtual void suspendPlayback() override;
     virtual bool canReceiveRemoteControlCommands() const override { return false; }
-    virtual void didReceiveRemoteControlCommand(MediaSession::RemoteControlCommandType) override { }
+    virtual void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) override { }
     virtual bool overrideBackgroundPlaybackRestriction() const override { return false; }
 
     // EventTarget
@@ -363,7 +363,7 @@ private:
     Vector<AudioNode*> m_deferredFinishDerefList;
     Vector<Vector<std::function<void()>>> m_stateReactions;
 
-    std::unique_ptr<MediaSession> m_mediaSession;
+    std::unique_ptr<PlatformMediaSession> m_mediaSession;
     std::unique_ptr<GenericEventQueue> m_eventQueue;
 
     RefPtr<AudioBuffer> m_renderTarget;
index cdf96c9..92b9b3f 100644 (file)
     <ClCompile Include="..\platform\graphics\avfoundation\cf\WebCoreAVCFResourceLoader.cpp" />
     <ClCompile Include="..\platform\graphics\ISOVTTCue.cpp" />
     <ClCompile Include="..\platform\audio\AudioSession.cpp" />
-    <ClCompile Include="..\platform\audio\MediaSession.cpp" />
+    <ClCompile Include="..\platform\audio\PlatformMediaSession.cpp" />
     <ClCompile Include="..\platform\audio\MediaSessionManager.cpp" />
     <ClCompile Include="..\platform\graphics\ANGLEWebKitBridge.cpp" />
     <ClCompile Include="..\platform\graphics\avfoundation\cf\InbandTextTrackPrivateAVCF.cpp" />
     <ClInclude Include="..\platform\FloatConversion.h" />
     <ClInclude Include="..\platform\GenericTaskQueue.h" />
     <ClInclude Include="..\platform\audio\AudioSession.h" />
-    <ClInclude Include="..\platform\audio\MediaSession.h" />
+    <ClInclude Include="..\platform\audio\PlatformMediaSession.h" />
     <ClInclude Include="..\platform\audio\MediaSessionManager.h" />
     <ClInclude Include="..\platform\graphics\ANGLEWebKitBridge.h" />
     <ClInclude Include="..\platform\graphics\AudioTrackPrivate.h" />
index 7a71131..349a69e 100644 (file)
     <ClCompile Include="..\rendering\line\LineInfo.cpp">
       <Filter>rendering\line</Filter>
     </ClCompile>
-    <ClCompile Include="..\platform\audio\MediaSession.cpp">
+    <ClCompile Include="..\platform\audio\PlatformMediaSession.cpp">
       <Filter>platform\audio</Filter>
     </ClCompile>
     <ClCompile Include="..\platform\audio\MediaSessionManager.cpp">
     <ClInclude Include="..\platform\audio\MediaSessionManager.h">
       <Filter>platform\audio</Filter>
     </ClInclude>
-    <ClInclude Include="..\platform\audio\MediaSession.h">
+    <ClInclude Include="..\platform\audio\PlatformMediaSession.h">
       <Filter>platform\audio</Filter>
     </ClInclude>
     <ClInclude Include="..\Modules\gamepad\NavigatorGamepad.h">
index 4a79603..031d9a4 100644 (file)
                0709D7931AE5557E004E42F8 /* WebMediaSessionManagerMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 0709D7911AE5557E004E42F8 /* WebMediaSessionManagerMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0709D7951AE55A29004E42F8 /* WebMediaSessionManagerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 0709D7941AE55A29004E42F8 /* WebMediaSessionManagerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0709FC4E1025DEE30059CDBA /* AccessibilitySlider.h in Headers */ = {isa = PBXBuildFile; fileRef = 0709FC4D1025DEE30059CDBA /* AccessibilitySlider.h */; };
-               070E09191875EEFC003A1D3C /* MediaSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 070E09181875ED93003A1D3C /* MediaSession.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               070E091B1875EF71003A1D3C /* MediaSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 070E091A1875EF71003A1D3C /* MediaSession.cpp */; };
+               070E09191875EEFC003A1D3C /* PlatformMediaSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 070E09181875ED93003A1D3C /* PlatformMediaSession.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               070E091B1875EF71003A1D3C /* PlatformMediaSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 070E091A1875EF71003A1D3C /* PlatformMediaSession.cpp */; };
                070F549817F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 070F549717F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h */; };
                070F549E17F2402700169E04 /* AudioDestinationConsumer.h in Headers */ = {isa = PBXBuildFile; fileRef = 070F549D17F2402700169E04 /* AudioDestinationConsumer.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0711589117DF6F6600EDFE2B /* MediaStreamPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0711588F17DF633700EDFE2B /* MediaStreamPrivate.cpp */; };
                0709D7941AE55A29004E42F8 /* WebMediaSessionManagerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebMediaSessionManagerClient.h; sourceTree = "<group>"; };
                0709FC4D1025DEE30059CDBA /* AccessibilitySlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilitySlider.h; sourceTree = "<group>"; };
                070DD8F50F01868000727DEB /* mediaControls.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mediaControls.css; sourceTree = "<group>"; };
-               070E09181875ED93003A1D3C /* MediaSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSession.h; sourceTree = "<group>"; };
-               070E091A1875EF71003A1D3C /* MediaSession.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaSession.cpp; sourceTree = "<group>"; };
+               070E09181875ED93003A1D3C /* PlatformMediaSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformMediaSession.h; sourceTree = "<group>"; };
+               070E091A1875EF71003A1D3C /* PlatformMediaSession.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformMediaSession.cpp; sourceTree = "<group>"; };
                070F549717F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamConstraintsValidationClient.h; sourceTree = "<group>"; };
                070F549D17F2402700169E04 /* AudioDestinationConsumer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioDestinationConsumer.h; sourceTree = "<group>"; };
                0711588F17DF633700EDFE2B /* MediaStreamPrivate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamPrivate.cpp; sourceTree = "<group>"; };
                                FD31606912B026F700C1A359 /* HRTFKernel.h */,
                                FD31606A12B026F700C1A359 /* HRTFPanner.cpp */,
                                FD31606B12B026F700C1A359 /* HRTFPanner.h */,
-                               070E091A1875EF71003A1D3C /* MediaSession.cpp */,
-                               070E09181875ED93003A1D3C /* MediaSession.h */,
                                CDAE8C071746B95700532D78 /* MediaSessionManager.cpp */,
                                CDAE8C081746B95700532D78 /* MediaSessionManager.h */,
                                FDB1700314A2BAB200A2B5D9 /* MultiChannelResampler.cpp */,
                                FDB1700414A2BAB200A2B5D9 /* MultiChannelResampler.h */,
                                FD31606C12B026F700C1A359 /* Panner.cpp */,
                                FD31606D12B026F700C1A359 /* Panner.h */,
+                               070E091A1875EF71003A1D3C /* PlatformMediaSession.cpp */,
+                               070E09181875ED93003A1D3C /* PlatformMediaSession.h */,
                                FD31606E12B026F700C1A359 /* Reverb.cpp */,
                                FD31606F12B026F700C1A359 /* Reverb.h */,
                                FD31607012B026F700C1A359 /* ReverbAccumulationBuffer.cpp */,
                                D3AA10F4123A98AA0092152B /* MediaQueryMatcher.h in Headers */,
                                CEEFCD7A19DB31F7003876D7 /* MediaResourceLoader.h in Headers */,
                                CDBEAEAD19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.h in Headers */,
-                               070E09191875EEFC003A1D3C /* MediaSession.h in Headers */,
                                07F944161864D046005D31CB /* MediaSessionManager.h in Headers */,
                                07638A991884487200E15A1B /* MediaSessionManagerIOS.h in Headers */,
                                CD3A495F17A9D01B00274E42 /* MediaSource.h in Headers */,
                                0562F9611573F88F0031CA16 /* PlatformLayer.h in Headers */,
                                F544F78915CFB2A800AF33A8 /* PlatformLocale.h in Headers */,
                                CEEFCD7C19DB33DC003876D7 /* PlatformMediaResourceLoader.h in Headers */,
+                               070E09191875EEFC003A1D3C /* PlatformMediaSession.h in Headers */,
                                932871C00B20DEB70049035A /* PlatformMenuDescription.h in Headers */,
                                41BF70100FE86F61005E8DEC /* PlatformMessagePortChannel.h in Headers */,
                                935C476909AC4D4300A6AAB4 /* PlatformMouseEvent.h in Headers */,
                                D3AA10F3123A98AA0092152B /* MediaQueryMatcher.cpp in Sources */,
                                CEEFCD7919DB31F7003876D7 /* MediaResourceLoader.cpp in Sources */,
                                CDBEAEAC19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.mm in Sources */,
-                               070E091B1875EF71003A1D3C /* MediaSession.cpp in Sources */,
                                CDAE8C091746B95700532D78 /* MediaSessionManager.cpp in Sources */,
                                07638A9A1884487200E15A1B /* MediaSessionManagerIOS.mm in Sources */,
                                07EDC3EE1AACB75D00983EB5 /* MediaSessionManagerMac.cpp in Sources */,
                                26601EC014B3B9AD0012C0FE /* PlatformEventFactoryIOS.mm in Sources */,
                                BCAA486F14A052530088FAC4 /* PlatformEventFactoryMac.mm in Sources */,
                                F544F78815CFB2A800AF33A8 /* PlatformLocale.cpp in Sources */,
+                               070E091B1875EF71003A1D3C /* PlatformMediaSession.cpp in Sources */,
                                41BF700F0FE86F61005E8DEC /* PlatformMessagePortChannel.cpp in Sources */,
                                C5278B0C17F212EA003A2998 /* PlatformPasteboardIOS.mm in Sources */,
                                C598902E14E9B0F800E8D18B /* PlatformPasteboardMac.mm in Sources */,
index cdecf0f..75c6755 100644 (file)
@@ -42,7 +42,7 @@ public:
 private:
     HTMLAudioElement(const QualifiedName&, Document&, bool);
 
-    virtual MediaSession::MediaType presentationType() const override { return MediaSession::Audio; }
+    virtual PlatformMediaSession::MediaType presentationType() const override { return PlatformMediaSession::Audio; }
 };
 
 } // namespace WebCore
index a62c284..99f40ba 100644 (file)
@@ -4533,7 +4533,7 @@ bool HTMLMediaElement::stoppedDueToErrors() const
 
 bool HTMLMediaElement::pausedForUserInteraction() const
 {
-    if (m_mediaSession->state() == MediaSession::Interrupted)
+    if (m_mediaSession->state() == PlatformMediaSession::Interrupted)
         return true;
 
     return false;
@@ -6167,33 +6167,33 @@ unsigned long long HTMLMediaElement::fileSize() const
     return 0;
 }
 
-MediaSession::MediaType HTMLMediaElement::mediaType() const
+PlatformMediaSession::MediaType HTMLMediaElement::mediaType() const
 {
     if (m_player && m_readyState >= HAVE_METADATA)
-        return hasVideo() ? MediaSession::Video : MediaSession::Audio;
+        return hasVideo() ? PlatformMediaSession::Video : PlatformMediaSession::Audio;
 
     return presentationType();
 }
 
-MediaSession::MediaType HTMLMediaElement::presentationType() const
+PlatformMediaSession::MediaType HTMLMediaElement::presentationType() const
 {
     if (hasTagName(HTMLNames::videoTag))
-        return MediaSession::Video;
+        return PlatformMediaSession::Video;
 
-    return MediaSession::Audio;
+    return PlatformMediaSession::Audio;
 }
 
-MediaSession::DisplayType HTMLMediaElement::displayType() const
+PlatformMediaSession::DisplayType HTMLMediaElement::displayType() const
 {
     if (m_videoFullscreenMode == VideoFullscreenModeStandard)
-        return MediaSession::Fullscreen;
+        return PlatformMediaSession::Fullscreen;
     if (m_videoFullscreenMode & VideoFullscreenModeOptimized)
-        return MediaSession::Optimized;
+        return PlatformMediaSession::Optimized;
     if (m_videoFullscreenMode == VideoFullscreenModeNone)
-        return MediaSession::Normal;
+        return PlatformMediaSession::Normal;
 
     ASSERT_NOT_REACHED();
-    return MediaSession::Normal;
+    return PlatformMediaSession::Normal;
 }
 
 #if ENABLE(MEDIA_SOURCE)
@@ -6225,28 +6225,28 @@ String HTMLMediaElement::mediaSessionTitle() const
     return m_currentSrc;
 }
 
-void HTMLMediaElement::didReceiveRemoteControlCommand(MediaSession::RemoteControlCommandType command)
+void HTMLMediaElement::didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType command)
 {
     LOG(Media, "HTMLMediaElement::didReceiveRemoteControlCommand(%p) - %i", this, static_cast<int>(command));
 
     switch (command) {
-    case MediaSession::PlayCommand:
+    case PlatformMediaSession::PlayCommand:
         play();
         break;
-    case MediaSession::PauseCommand:
+    case PlatformMediaSession::PauseCommand:
         pause();
         break;
-    case MediaSession::TogglePlayPauseCommand:
+    case PlatformMediaSession::TogglePlayPauseCommand:
         canPlay() ? play() : pause();
         break;
-    case MediaSession::BeginSeekingBackwardCommand:
+    case PlatformMediaSession::BeginSeekingBackwardCommand:
         beginScanning(Backward);
         break;
-    case MediaSession::BeginSeekingForwardCommand:
+    case PlatformMediaSession::BeginSeekingForwardCommand:
         beginScanning(Forward);
         break;
-    case MediaSession::EndSeekingBackwardCommand:
-    case MediaSession::EndSeekingForwardCommand:
+    case PlatformMediaSession::EndSeekingBackwardCommand:
+    case PlatformMediaSession::EndSeekingForwardCommand:
         endScanning();
         break;
     default:
index df445f8..7080cc8 100644 (file)
@@ -97,7 +97,7 @@ class MediaStream;
 
 class HTMLMediaElement
     : public HTMLElement
-    , private MediaPlayerClient, public MediaPlayerSupportsTypeClient, private MediaCanStartListener, public ActiveDOMObject, public MediaControllerInterface , public MediaSessionClient, private MediaProducer
+    , private MediaPlayerClient, public MediaPlayerSupportsTypeClient, private MediaCanStartListener, public ActiveDOMObject, public MediaControllerInterface , public PlatformMediaSessionClient, private MediaProducer
 #if ENABLE(VIDEO_TRACK)
     , private AudioTrackClient
     , private TextTrackClient
@@ -568,7 +568,7 @@ private:
 #endif
 
     virtual bool mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&) override;
-    virtual void mediaPlayerHandlePlaybackCommand(MediaSession::RemoteControlCommandType command) override { didReceiveRemoteControlCommand(command); }
+    virtual void mediaPlayerHandlePlaybackCommand(PlatformMediaSession::RemoteControlCommandType command) override { didReceiveRemoteControlCommand(command); }
     virtual String mediaPlayerSourceApplicationIdentifier() const override;
     virtual Vector<String> mediaPlayerPreferredAudioCharacteristics() const override;
 
@@ -690,17 +690,17 @@ private:
     bool ensureMediaControlsInjectedScript();
 #endif
 
-    // MediaSessionClient Overrides
-    virtual MediaSession::MediaType mediaType() const override;
-    virtual MediaSession::MediaType presentationType() const override;
-    virtual MediaSession::DisplayType displayType() const override;
+    // PlatformMediaSessionClient Overrides
+    virtual PlatformMediaSession::MediaType mediaType() const override;
+    virtual PlatformMediaSession::MediaType presentationType() const override;
+    virtual PlatformMediaSession::DisplayType displayType() const override;
     virtual void suspendPlayback() override;
     virtual void mayResumePlayback(bool shouldResume) override;
     virtual String mediaSessionTitle() const override;
     virtual double mediaSessionDuration() const override { return duration(); }
     virtual double mediaSessionCurrentTime() const override { return currentTime(); }
     virtual bool canReceiveRemoteControlCommands() const override { return true; }
-    virtual void didReceiveRemoteControlCommand(MediaSession::RemoteControlCommandType) override;
+    virtual void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) override;
     virtual bool overrideBackgroundPlaybackRestriction() const override;
 
     virtual void pageMutedStateDidChange() override;
index e8d6cd9..aea6ba8 100644 (file)
@@ -104,7 +104,7 @@ private:
     virtual void didMoveToNewDocument(Document* oldDocument) override;
     virtual void setDisplayMode(DisplayMode) override;
 
-    virtual MediaSession::MediaType presentationType() const override { return MediaSession::Video; }
+    virtual PlatformMediaSession::MediaType presentationType() const override { return PlatformMediaSession::Video; }
 
     std::unique_ptr<HTMLImageLoader> m_imageLoader;
 
index e089939..1a9e9a1 100644 (file)
@@ -78,8 +78,8 @@ static String restrictionName(MediaElementSession::BehaviorRestrictions restrict
 }
 #endif
 
-MediaElementSession::MediaElementSession(MediaSessionClient& client)
-    : MediaSession(client)
+MediaElementSession::MediaElementSession(PlatformMediaSessionClient& client)
+    : PlatformMediaSession(client)
     , m_restrictions(NoRestrictions)
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
     , m_targetAvailabilityChangedTimer(*this, &MediaElementSession::targetAvailabilityChangedTimerFired)
index 56d193a..f943551 100644 (file)
@@ -29,7 +29,7 @@
 #if ENABLE(VIDEO)
 
 #include "MediaPlayer.h"
-#include "MediaSession.h"
+#include "PlatformMediaSession.h"
 #include "Timer.h"
 
 namespace WebCore {
@@ -38,10 +38,10 @@ class Document;
 class HTMLMediaElement;
 class SourceBuffer;
 
-class MediaElementSession final : public MediaSession {
+class MediaElementSession final : public PlatformMediaSession {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    explicit MediaElementSession(MediaSessionClient&);
+    explicit MediaElementSession(PlatformMediaSessionClient&);
     virtual ~MediaElementSession() { }
 
     void registerWithDocument(const HTMLMediaElement&);
index 9c6a246..b7d9120 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef RemoteCommandListener_h
 #define RemoteCommandListener_h
 
-#include "MediaSession.h"
+#include "PlatformMediaSession.h"
 
 namespace WebCore {
 
@@ -34,7 +34,7 @@ class RemoteCommandListenerClient {
     WTF_MAKE_FAST_ALLOCATED;
 public:
     virtual ~RemoteCommandListenerClient() { }
-    virtual void didReceiveRemoteControlCommand(MediaSession::RemoteControlCommandType) = 0;
+    virtual void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) = 0;
 };
 
 class RemoteCommandListener {
index f570477..e177053 100644 (file)
@@ -31,7 +31,7 @@
 #include "AudioSession.h"
 #include "Logging.h"
 #include "NotImplemented.h"
-#include "MediaSession.h"
+#include "PlatformMediaSession.h"
 
 namespace WebCore {
 
@@ -51,14 +51,14 @@ MediaSessionManager::MediaSessionManager()
 
 void MediaSessionManager::resetRestrictions()
 {
-    m_restrictions[MediaSession::Video] = NoRestrictions;
-    m_restrictions[MediaSession::Audio] = NoRestrictions;
-    m_restrictions[MediaSession::WebAudio] = NoRestrictions;
+    m_restrictions[PlatformMediaSession::Video] = NoRestrictions;
+    m_restrictions[PlatformMediaSession::Audio] = NoRestrictions;
+    m_restrictions[PlatformMediaSession::WebAudio] = NoRestrictions;
 }
 
-bool MediaSessionManager::has(MediaSession::MediaType type) const
+bool MediaSessionManager::has(PlatformMediaSession::MediaType type) const
 {
-    ASSERT(type >= MediaSession::None && type <= MediaSession::WebAudio);
+    ASSERT(type >= PlatformMediaSession::None && type <= PlatformMediaSession::WebAudio);
 
     for (auto* session : m_sessions) {
         if (session->mediaType() == type)
@@ -71,16 +71,16 @@ bool MediaSessionManager::has(MediaSession::MediaType type) const
 bool MediaSessionManager::activeAudioSessionRequired() const
 {
     for (auto* session : m_sessions) {
-        if (session->mediaType() != MediaSession::None && session->state() == MediaSession::State::Playing)
+        if (session->mediaType() != PlatformMediaSession::None && session->state() == PlatformMediaSession::State::Playing)
             return true;
     }
     
     return false;
 }
 
-int MediaSessionManager::count(MediaSession::MediaType type) const
+int MediaSessionManager::count(PlatformMediaSession::MediaType type) const
 {
-    ASSERT(type >= MediaSession::None && type <= MediaSession::WebAudio);
+    ASSERT(type >= PlatformMediaSession::None && type <= PlatformMediaSession::WebAudio);
 
     int count = 0;
     for (auto* session : m_sessions) {
@@ -91,34 +91,34 @@ int MediaSessionManager::count(MediaSession::MediaType type) const
     return count;
 }
 
-void MediaSessionManager::beginInterruption(MediaSession::InterruptionType type)
+void MediaSessionManager::beginInterruption(PlatformMediaSession::InterruptionType type)
 {
     LOG(Media, "MediaSessionManager::beginInterruption");
 
     m_interrupted = true;
-    Vector<MediaSession*> sessions = m_sessions;
+    Vector<PlatformMediaSession*> sessions = m_sessions;
     for (auto* session : sessions)
         session->beginInterruption(type);
     updateSessionState();
 }
 
-void MediaSessionManager::endInterruption(MediaSession::EndInterruptionFlags flags)
+void MediaSessionManager::endInterruption(PlatformMediaSession::EndInterruptionFlags flags)
 {
     LOG(Media, "MediaSessionManager::endInterruption");
 
     m_interrupted = false;
-    Vector<MediaSession*> sessions = m_sessions;
+    Vector<PlatformMediaSession*> sessions = m_sessions;
     for (auto* session : sessions)
         session->endInterruption(flags);
 }
 
-void MediaSessionManager::addSession(MediaSession& session)
+void MediaSessionManager::addSession(PlatformMediaSession& session)
 {
     LOG(Media, "MediaSessionManager::addSession - %p", &session);
     
     m_sessions.append(&session);
     if (m_interrupted)
-        session.setState(MediaSession::Interrupted);
+        session.setState(PlatformMediaSession::Interrupted);
 
     if (!m_remoteCommandListener)
         m_remoteCommandListener = RemoteCommandListener::create(*this);
@@ -129,7 +129,7 @@ void MediaSessionManager::addSession(MediaSession& session)
     updateSessionState();
 }
 
-void MediaSessionManager::removeSession(MediaSession& session)
+void MediaSessionManager::removeSession(PlatformMediaSession& session)
 {
     LOG(Media, "MediaSessionManager::removeSession - %p", &session);
     
@@ -148,33 +148,33 @@ void MediaSessionManager::removeSession(MediaSession& session)
     updateSessionState();
 }
 
-void MediaSessionManager::addRestriction(MediaSession::MediaType type, SessionRestrictions restriction)
+void MediaSessionManager::addRestriction(PlatformMediaSession::MediaType type, SessionRestrictions restriction)
 {
-    ASSERT(type > MediaSession::None && type <= MediaSession::WebAudio);
+    ASSERT(type > PlatformMediaSession::None && type <= PlatformMediaSession::WebAudio);
     m_restrictions[type] |= restriction;
 }
 
-void MediaSessionManager::removeRestriction(MediaSession::MediaType type, SessionRestrictions restriction)
+void MediaSessionManager::removeRestriction(PlatformMediaSession::MediaType type, SessionRestrictions restriction)
 {
-    ASSERT(type > MediaSession::None && type <= MediaSession::WebAudio);
+    ASSERT(type > PlatformMediaSession::None && type <= PlatformMediaSession::WebAudio);
     m_restrictions[type] &= ~restriction;
 }
 
-MediaSessionManager::SessionRestrictions MediaSessionManager::restrictions(MediaSession::MediaType type)
+MediaSessionManager::SessionRestrictions MediaSessionManager::restrictions(PlatformMediaSession::MediaType type)
 {
-    ASSERT(type > MediaSession::None && type <= MediaSession::WebAudio);
+    ASSERT(type > PlatformMediaSession::None && type <= PlatformMediaSession::WebAudio);
     return m_restrictions[type];
 }
 
-bool MediaSessionManager::sessionWillBeginPlayback(MediaSession& session)
+bool MediaSessionManager::sessionWillBeginPlayback(PlatformMediaSession& session)
 {
     LOG(Media, "MediaSessionManager::sessionWillBeginPlayback - %p", &session);
     
     setCurrentSession(session);
 
-    MediaSession::MediaType sessionType = session.mediaType();
+    PlatformMediaSession::MediaType sessionType = session.mediaType();
     SessionRestrictions restrictions = m_restrictions[sessionType];
-    if (session.state() == MediaSession::Interrupted && restrictions & InterruptedPlaybackNotPermitted)
+    if (session.state() == PlatformMediaSession::Interrupted && restrictions & InterruptedPlaybackNotPermitted)
         return false;
 
 #if USE(AUDIO_SESSION)
@@ -183,9 +183,9 @@ bool MediaSessionManager::sessionWillBeginPlayback(MediaSession& session)
 #endif
 
     if (m_interrupted)
-        endInterruption(MediaSession::NoFlags);
+        endInterruption(PlatformMediaSession::NoFlags);
 
-    Vector<MediaSession*> sessions = m_sessions;
+    Vector<PlatformMediaSession*> sessions = m_sessions;
     for (auto* oneSession : sessions) {
         if (oneSession == &session)
             continue;
@@ -197,7 +197,7 @@ bool MediaSessionManager::sessionWillBeginPlayback(MediaSession& session)
     return true;
 }
     
-void MediaSessionManager::sessionWillEndPlayback(MediaSession& session)
+void MediaSessionManager::sessionWillEndPlayback(PlatformMediaSession& session)
 {
     LOG(Media, "MediaSessionManager::sessionWillEndPlayback - %p", &session);
     
@@ -207,17 +207,17 @@ void MediaSessionManager::sessionWillEndPlayback(MediaSession& session)
     size_t pausingSessionIndex = notFound;
     size_t lastPlayingSessionIndex = notFound;
     for (size_t i = 0; i < m_sessions.size(); ++i) {
-        MediaSession* oneSession = m_sessions[i];
+        PlatformMediaSession* oneSession = m_sessions[i];
         
         if (oneSession == &session) {
             pausingSessionIndex = i;
             continue;
         }
-        if (oneSession->state() == MediaSession::Playing) {
+        if (oneSession->state() == PlatformMediaSession::Playing) {
             lastPlayingSessionIndex = i;
             continue;
         }
-        if (oneSession->state() != MediaSession::Playing)
+        if (oneSession->state() != PlatformMediaSession::Playing)
             break;
     }
     if (lastPlayingSessionIndex == notFound || pausingSessionIndex == notFound)
@@ -232,7 +232,7 @@ void MediaSessionManager::sessionWillEndPlayback(MediaSession& session)
     LOG(Media, "MediaSessionManager::sessionWillEndPlayback - session moved from index %zu to %zu", pausingSessionIndex, lastPlayingSessionIndex);
 }
 
-void MediaSessionManager::setCurrentSession(MediaSession& session)
+void MediaSessionManager::setCurrentSession(PlatformMediaSession& session)
 {
     LOG(Media, "MediaSessionManager::setCurrentSession - %p", &session);
     
@@ -250,7 +250,7 @@ void MediaSessionManager::setCurrentSession(MediaSession& session)
     LOG(Media, "MediaSessionManager::setCurrentSession - session moved from index %zu to 0", index);
 }
     
-MediaSession* MediaSessionManager::currentSession()
+PlatformMediaSession* MediaSessionManager::currentSession()
 {
     if (!m_sessions.size())
         return nullptr;
@@ -258,37 +258,37 @@ MediaSession* MediaSessionManager::currentSession()
     return m_sessions[0];
 }
     
-bool MediaSessionManager::sessionRestrictsInlineVideoPlayback(const MediaSession& session) const
+bool MediaSessionManager::sessionRestrictsInlineVideoPlayback(const PlatformMediaSession& session) const
 {
-    MediaSession::MediaType sessionType = session.presentationType();
-    if (sessionType != MediaSession::Video)
+    PlatformMediaSession::MediaType sessionType = session.presentationType();
+    if (sessionType != PlatformMediaSession::Video)
         return false;
 
     return m_restrictions[sessionType] & InlineVideoPlaybackRestricted;
 }
 
-bool MediaSessionManager::sessionCanLoadMedia(const MediaSession& session) const
+bool MediaSessionManager::sessionCanLoadMedia(const PlatformMediaSession& session) const
 {
-    return session.state() == MediaSession::Playing || !session.isHidden() || session.isPlayingToWirelessPlaybackTarget();
+    return session.state() == PlatformMediaSession::Playing || !session.isHidden() || session.isPlayingToWirelessPlaybackTarget();
 }
 
 void MediaSessionManager::applicationWillEnterBackground() const
 {
     LOG(Media, "MediaSessionManager::applicationWillEnterBackground");
-    Vector<MediaSession*> sessions = m_sessions;
+    Vector<PlatformMediaSession*> sessions = m_sessions;
     for (auto* session : sessions) {
         if (m_restrictions[session->mediaType()] & BackgroundProcessPlaybackRestricted)
-            session->beginInterruption(MediaSession::EnteringBackground);
+            session->beginInterruption(PlatformMediaSession::EnteringBackground);
     }
 }
 
 void MediaSessionManager::applicationWillEnterForeground() const
 {
     LOG(Media, "MediaSessionManager::applicationWillEnterForeground");
-    Vector<MediaSession*> sessions = m_sessions;
+    Vector<PlatformMediaSession*> sessions = m_sessions;
     for (auto* session : sessions) {
         if (m_restrictions[session->mediaType()] & BackgroundProcessPlaybackRestricted)
-            session->endInterruption(MediaSession::MayResumePlaying);
+            session->endInterruption(PlatformMediaSession::MayResumePlaying);
     }
 }
 
@@ -298,9 +298,9 @@ void MediaSessionManager::updateSessionState()
 }
 #endif
 
-void MediaSessionManager::didReceiveRemoteControlCommand(MediaSession::RemoteControlCommandType command)
+void MediaSessionManager::didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType command)
 {
-    MediaSession* activeSession = currentSession();
+    PlatformMediaSession* activeSession = currentSession();
     if (!activeSession || !activeSession->canReceiveRemoteControlCommands())
         return;
     activeSession->didReceiveRemoteControlCommand(command);
@@ -312,7 +312,7 @@ void MediaSessionManager::systemWillSleep()
         return;
 
     for (auto session : m_sessions)
-        session->beginInterruption(MediaSession::SystemSleep);
+        session->beginInterruption(PlatformMediaSession::SystemSleep);
 }
 
 void MediaSessionManager::systemDidWake()
@@ -321,7 +321,7 @@ void MediaSessionManager::systemDidWake()
         return;
 
     for (auto session : m_sessions)
-        session->endInterruption(MediaSession::MayResumePlaying);
+        session->endInterruption(PlatformMediaSession::MayResumePlaying);
 }
 
 void MediaSessionManager::audioOutputDeviceChanged()
index d940d5a..d150a98 100644 (file)
@@ -27,7 +27,7 @@
 #define MediaSessionManager_h
 
 #include "AudioHardwareListener.h"
-#include "MediaSession.h"
+#include "PlatformMediaSession.h"
 #include "RemoteCommandListener.h"
 #include "Settings.h"
 #include "SystemSleepListener.h"
@@ -37,7 +37,7 @@
 namespace WebCore {
 
 class HTMLMediaElement;
-class MediaSession;
+class PlatformMediaSession;
 class RemoteCommandListener;
 
 class MediaSessionManager : private RemoteCommandListenerClient, private SystemSleepListener::Client, private AudioHardwareListener::Client {
@@ -46,12 +46,12 @@ public:
     WEBCORE_EXPORT static MediaSessionManager& sharedManager();
     virtual ~MediaSessionManager() { }
 
-    bool has(MediaSession::MediaType) const;
-    int count(MediaSession::MediaType) const;
+    bool has(PlatformMediaSession::MediaType) const;
+    int count(PlatformMediaSession::MediaType) const;
     bool activeAudioSessionRequired() const;
 
-    WEBCORE_EXPORT void beginInterruption(MediaSession::InterruptionType);
-    WEBCORE_EXPORT void endInterruption(MediaSession::EndInterruptionFlags);
+    WEBCORE_EXPORT void beginInterruption(PlatformMediaSession::InterruptionType);
+    WEBCORE_EXPORT void endInterruption(PlatformMediaSession::EndInterruptionFlags);
 
     WEBCORE_EXPORT void applicationWillEnterForeground() const;
     WEBCORE_EXPORT void applicationWillEnterBackground() const;
@@ -68,34 +68,34 @@ public:
     };
     typedef unsigned SessionRestrictions;
 
-    WEBCORE_EXPORT void addRestriction(MediaSession::MediaType, SessionRestrictions);
-    WEBCORE_EXPORT void removeRestriction(MediaSession::MediaType, SessionRestrictions);
-    WEBCORE_EXPORT SessionRestrictions restrictions(MediaSession::MediaType);
+    WEBCORE_EXPORT void addRestriction(PlatformMediaSession::MediaType, SessionRestrictions);
+    WEBCORE_EXPORT void removeRestriction(PlatformMediaSession::MediaType, SessionRestrictions);
+    WEBCORE_EXPORT SessionRestrictions restrictions(PlatformMediaSession::MediaType);
     virtual void resetRestrictions();
 
-    virtual bool sessionWillBeginPlayback(MediaSession&);
-    virtual void sessionWillEndPlayback(MediaSession&);
+    virtual bool sessionWillBeginPlayback(PlatformMediaSession&);
+    virtual void sessionWillEndPlayback(PlatformMediaSession&);
 
-    bool sessionRestrictsInlineVideoPlayback(const MediaSession&) const;
+    bool sessionRestrictsInlineVideoPlayback(const PlatformMediaSession&) const;
 
-    virtual bool sessionCanLoadMedia(const MediaSession&) const;
+    virtual bool sessionCanLoadMedia(const PlatformMediaSession&) const;
 
 #if PLATFORM(IOS)
     virtual void configureWireLessTargetMonitoring() { }
     virtual bool hasWirelessTargetsAvailable() { return false; }
 #endif
 
-    void setCurrentSession(MediaSession&);
-    MediaSession* currentSession();
+    void setCurrentSession(PlatformMediaSession&);
+    PlatformMediaSession* currentSession();
 
 protected:
-    friend class MediaSession;
+    friend class PlatformMediaSession;
     explicit MediaSessionManager();
 
-    void addSession(MediaSession&);
-    void removeSession(MediaSession&);
+    void addSession(PlatformMediaSession&);
+    void removeSession(PlatformMediaSession&);
 
-    Vector<MediaSession*> sessions() { return m_sessions; }
+    Vector<PlatformMediaSession*> sessions() { return m_sessions; }
 
 private:
     friend class Internals;
@@ -103,7 +103,7 @@ private:
     void updateSessionState();
 
     // RemoteCommandListenerClient
-    WEBCORE_EXPORT virtual void didReceiveRemoteControlCommand(MediaSession::RemoteControlCommandType) override;
+    WEBCORE_EXPORT virtual void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) override;
 
     // AudioHardwareListenerClient
     virtual void audioHardwareDidBecomeActive() override { }
@@ -114,8 +114,8 @@ private:
     virtual void systemWillSleep() override;
     virtual void systemDidWake() override;
 
-    SessionRestrictions m_restrictions[MediaSession::WebAudio + 1];
-    Vector<MediaSession*> m_sessions;
+    SessionRestrictions m_restrictions[PlatformMediaSession::WebAudio + 1];
+    Vector<PlatformMediaSession*> m_sessions;
     std::unique_ptr<RemoteCommandListener> m_remoteCommandListener;
     std::unique_ptr<SystemSleepListener> m_systemSleepListener;
     RefPtr<AudioHardwareListener> m_audioHardwareListener;
@@ -24,7 +24,7 @@
  */
 
 #include "config.h"
-#include "MediaSession.h"
+#include "PlatformMediaSession.h"
 
 #if ENABLE(VIDEO)
 #include "HTMLMediaElement.h"
@@ -37,9 +37,9 @@ namespace WebCore {
 const double kClientDataBufferingTimerThrottleDelay = 0.1;
 
 #if !LOG_DISABLED
-static const char* stateName(MediaSession::State state)
+static const char* stateName(PlatformMediaSession::State state)
 {
-#define CASE(state) case MediaSession::state: return #state
+#define CASE(state) case PlatformMediaSession::state: return #state
     switch (state) {
     CASE(Idle);
     CASE(Playing);
@@ -52,14 +52,14 @@ static const char* stateName(MediaSession::State state)
 }
 #endif
 
-std::unique_ptr<MediaSession> MediaSession::create(MediaSessionClient& client)
+std::unique_ptr<PlatformMediaSession> PlatformMediaSession::create(PlatformMediaSessionClient& client)
 {
-    return std::make_unique<MediaSession>(client);
+    return std::make_unique<PlatformMediaSession>(client);
 }
 
-MediaSession::MediaSession(MediaSessionClient& client)
+PlatformMediaSession::PlatformMediaSession(PlatformMediaSessionClient& client)
     : m_client(client)
-    , m_clientDataBufferingTimer(*this, &MediaSession::clientDataBufferingTimerFired)
+    , m_clientDataBufferingTimer(*this, &PlatformMediaSession::clientDataBufferingTimerFired)
     , m_state(Idle)
     , m_stateToRestore(Idle)
     , m_notifyingClient(false)
@@ -68,20 +68,20 @@ MediaSession::MediaSession(MediaSessionClient& client)
     MediaSessionManager::sharedManager().addSession(*this);
 }
 
-MediaSession::~MediaSession()
+PlatformMediaSession::~PlatformMediaSession()
 {
     MediaSessionManager::sharedManager().removeSession(*this);
 }
 
-void MediaSession::setState(State state)
+void PlatformMediaSession::setState(State state)
 {
-    LOG(Media, "MediaSession::setState(%p) - %s", this, stateName(state));
+    LOG(Media, "PlatformMediaSession::setState(%p) - %s", this, stateName(state));
     m_state = state;
 }
 
-void MediaSession::beginInterruption(InterruptionType type)
+void PlatformMediaSession::beginInterruption(InterruptionType type)
 {
-    LOG(Media, "MediaSession::beginInterruption(%p), state = %s, interruption count = %i", this, stateName(m_state), m_interruptionCount);
+    LOG(Media, "PlatformMediaSession::beginInterruption(%p), state = %s, interruption count = %i", this, stateName(m_state), m_interruptionCount);
 
     if (++m_interruptionCount > 1 || (type == EnteringBackground && client().overrideBackgroundPlaybackRestriction()))
         return;
@@ -93,12 +93,12 @@ void MediaSession::beginInterruption(InterruptionType type)
     m_notifyingClient = false;
 }
 
-void MediaSession::endInterruption(EndInterruptionFlags flags)
+void PlatformMediaSession::endInterruption(EndInterruptionFlags flags)
 {
-    LOG(Media, "MediaSession::endInterruption(%p) - flags = %i, stateToRestore = %s, interruption count = %i", this, (int)flags, stateName(m_stateToRestore), m_interruptionCount);
+    LOG(Media, "PlatformMediaSession::endInterruption(%p) - flags = %i, stateToRestore = %s, interruption count = %i", this, (int)flags, stateName(m_stateToRestore), m_interruptionCount);
 
     if (!m_interruptionCount) {
-        LOG(Media, "MediaSession::endInterruption(%p) - !! ignoring spurious interruption end !!", this);
+        LOG(Media, "PlatformMediaSession::endInterruption(%p) - !! ignoring spurious interruption end !!", this);
         return;
     }
 
@@ -113,7 +113,7 @@ void MediaSession::endInterruption(EndInterruptionFlags flags)
     client().mayResumePlayback(shouldResume);
 }
 
-bool MediaSession::clientWillBeginPlayback()
+bool PlatformMediaSession::clientWillBeginPlayback()
 {
     if (m_notifyingClient)
         return true;
@@ -129,12 +129,12 @@ bool MediaSession::clientWillBeginPlayback()
     return true;
 }
 
-bool MediaSession::clientWillPausePlayback()
+bool PlatformMediaSession::clientWillPausePlayback()
 {
     if (m_notifyingClient)
         return true;
 
-    LOG(Media, "MediaSession::clientWillPausePlayback(%p)- state = %s", this, stateName(m_state));
+    LOG(Media, "PlatformMediaSession::clientWillPausePlayback(%p)- state = %s", this, stateName(m_state));
     if (state() == Interrupted) {
         m_stateToRestore = Paused;
         LOG(Media, "      setting stateToRestore to \"Paused\"");
@@ -148,56 +148,56 @@ bool MediaSession::clientWillPausePlayback()
     return true;
 }
 
-void MediaSession::pauseSession()
+void PlatformMediaSession::pauseSession()
 {
-    LOG(Media, "MediaSession::pauseSession(%p)", this);
+    LOG(Media, "PlatformMediaSession::pauseSession(%p)", this);
     m_client.suspendPlayback();
 }
 
-MediaSession::MediaType MediaSession::mediaType() const
+PlatformMediaSession::MediaType PlatformMediaSession::mediaType() const
 {
     return m_client.mediaType();
 }
 
-MediaSession::MediaType MediaSession::presentationType() const
+PlatformMediaSession::MediaType PlatformMediaSession::presentationType() const
 {
     return m_client.presentationType();
 }
 
-String MediaSession::title() const
+String PlatformMediaSession::title() const
 {
     return m_client.mediaSessionTitle();
 }
 
-double MediaSession::duration() const
+double PlatformMediaSession::duration() const
 {
     return m_client.mediaSessionDuration();
 }
 
-double MediaSession::currentTime() const
+double PlatformMediaSession::currentTime() const
 {
     return m_client.mediaSessionCurrentTime();
 }
     
-bool MediaSession::canReceiveRemoteControlCommands() const
+bool PlatformMediaSession::canReceiveRemoteControlCommands() const
 {
     return m_client.canReceiveRemoteControlCommands();
 }
 
-void MediaSession::didReceiveRemoteControlCommand(RemoteControlCommandType command)
+void PlatformMediaSession::didReceiveRemoteControlCommand(RemoteControlCommandType command)
 {
     m_client.didReceiveRemoteControlCommand(command);
 }
 
-void MediaSession::visibilityChanged()
+void PlatformMediaSession::visibilityChanged()
 {
     if (!m_clientDataBufferingTimer.isActive())
         m_clientDataBufferingTimer.startOneShot(kClientDataBufferingTimerThrottleDelay);
 }
 
-void MediaSession::clientDataBufferingTimerFired()
+void PlatformMediaSession::clientDataBufferingTimerFired()
 {
-    LOG(Media, "MediaSession::clientDataBufferingTimerFired(%p)- visible = %s", this, m_client.elementIsHidden() ? "false" : "true");
+    LOG(Media, "PlatformMediaSession::clientDataBufferingTimerFired(%p)- visible = %s", this, m_client.elementIsHidden() ? "false" : "true");
 
     updateClientDataBuffering();
 
@@ -209,7 +209,7 @@ void MediaSession::clientDataBufferingTimerFired()
         pauseSession();
 }
 
-void MediaSession::updateClientDataBuffering()
+void PlatformMediaSession::updateClientDataBuffering()
 {
     if (m_clientDataBufferingTimer.isActive())
         m_clientDataBufferingTimer.stop();
@@ -217,27 +217,27 @@ void MediaSession::updateClientDataBuffering()
     m_client.setShouldBufferData(MediaSessionManager::sharedManager().sessionCanLoadMedia(*this));
 }
 
-bool MediaSession::isHidden() const
+bool PlatformMediaSession::isHidden() const
 {
     return m_client.elementIsHidden();
 }
 
-MediaSession::DisplayType MediaSession::displayType() const
+PlatformMediaSession::DisplayType PlatformMediaSession::displayType() const
 {
     return m_client.displayType();
 }
 
-String MediaSessionClient::mediaSessionTitle() const
+String PlatformMediaSessionClient::mediaSessionTitle() const
 {
     return String();
 }
 
-double MediaSessionClient::mediaSessionDuration() const
+double PlatformMediaSessionClient::mediaSessionDuration() const
 {
     return MediaPlayer::invalidTime();
 }
 
-double MediaSessionClient::mediaSessionCurrentTime() const
+double PlatformMediaSessionClient::mediaSessionCurrentTime() const
 {
     return MediaPlayer::invalidTime();
 }
@@ -23,8 +23,8 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef MediaSession_h
-#define MediaSession_h
+#ifndef PlatformMediaSession_h
+#define PlatformMediaSession_h
 
 #include "MediaProducer.h"
 #include "Timer.h"
 namespace WebCore {
 
 class MediaPlaybackTarget;
-class MediaSessionClient;
+class PlatformMediaSessionClient;
 
-class MediaSession
+class PlatformMediaSession
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
     : public MediaPlaybackTargetClient
 #endif
 {
 public:
-    static std::unique_ptr<MediaSession> create(MediaSessionClient&);
+    static std::unique_ptr<PlatformMediaSession> create(PlatformMediaSessionClient&);
 
-    MediaSession(MediaSessionClient&);
-    virtual ~MediaSession();
+    PlatformMediaSession(PlatformMediaSessionClient&);
+    virtual ~PlatformMediaSession();
 
     enum MediaType {
         None = 0,
@@ -133,13 +133,13 @@ public:
 #endif
 
 protected:
-    MediaSessionClient& client() const { return m_client; }
+    PlatformMediaSessionClient& client() const { return m_client; }
 
 private:
     void clientDataBufferingTimerFired();
     void updateClientDataBuffering();
 
-    MediaSessionClient& m_client;
+    PlatformMediaSessionClient& m_client;
     Timer m_clientDataBufferingTimer;
     State m_state;
     State m_stateToRestore;
@@ -147,14 +147,14 @@ private:
     bool m_notifyingClient;
 };
 
-class MediaSessionClient {
-    WTF_MAKE_NONCOPYABLE(MediaSessionClient);
+class PlatformMediaSessionClient {
+    WTF_MAKE_NONCOPYABLE(PlatformMediaSessionClient);
 public:
-    MediaSessionClient() { }
+    PlatformMediaSessionClient() { }
     
-    virtual MediaSession::MediaType mediaType() const = 0;
-    virtual MediaSession::MediaType presentationType() const = 0;
-    virtual MediaSession::DisplayType displayType() const { return MediaSession::Normal; }
+    virtual PlatformMediaSession::MediaType mediaType() const = 0;
+    virtual PlatformMediaSession::MediaType presentationType() const = 0;
+    virtual PlatformMediaSession::DisplayType displayType() const { return PlatformMediaSession::Normal; }
 
     virtual void mayResumePlayback(bool shouldResume) = 0;
     virtual void suspendPlayback() = 0;
@@ -164,7 +164,7 @@ public:
     virtual double mediaSessionCurrentTime() const;
     
     virtual bool canReceiveRemoteControlCommands() const = 0;
-    virtual void didReceiveRemoteControlCommand(MediaSession::RemoteControlCommandType) = 0;
+    virtual void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) = 0;
 
     virtual void setShouldBufferData(bool) { }
     virtual bool elementIsHidden() const { return false; }
@@ -178,9 +178,9 @@ public:
     virtual void setShouldPlayToPlaybackTarget(bool) { }
 
 protected:
-    virtual ~MediaSessionClient() { }
+    virtual ~PlatformMediaSessionClient() { }
 };
 
 }
 
-#endif // MediaSession_h
+#endif // PlatformMediaSession_h
index 93ecbce..dc8621f 100644 (file)
@@ -53,8 +53,8 @@ private:
 
     MediaSessionManageriOS();
 
-    virtual bool sessionWillBeginPlayback(MediaSession&) override;
-    virtual void sessionWillEndPlayback(MediaSession&) override;
+    virtual bool sessionWillBeginPlayback(PlatformMediaSession&) override;
+    virtual void sessionWillEndPlayback(PlatformMediaSession&) override;
     
     void updateNowPlayingInfo();
     
@@ -62,7 +62,7 @@ private:
 
     virtual void configureWireLessTargetMonitoring() override;
 
-    virtual bool sessionCanLoadMedia(const MediaSession&) const override;
+    virtual bool sessionCanLoadMedia(const PlatformMediaSession&) const override;
     
     RetainPtr<WebMediaSessionHelper> m_objcObserver;
 };
index 0444271..61755ce 100644 (file)
@@ -31,7 +31,7 @@
 #import "Logging.h"
 #import "MediaPlayer.h"
 #import "MediaPlayerSPI.h"
-#import "MediaSession.h"
+#import "PlatformMediaSession.h"
 #import "SoftLinking.h"
 #import "SystemMemory.h"
 #import "WebCoreSystemInterface.h"
@@ -138,27 +138,27 @@ void MediaSessionManageriOS::resetRestrictions()
 
     static wkDeviceClass deviceClass = iosDeviceClass();
     if (deviceClass == wkDeviceClassiPhone || deviceClass == wkDeviceClassiPod)
-        addRestriction(MediaSession::Video, InlineVideoPlaybackRestricted);
+        addRestriction(PlatformMediaSession::Video, InlineVideoPlaybackRestricted);
 
     if (ramSize() < systemMemoryRequiredForVideoInBackgroundTabs) {
         LOG(Media, "MediaSessionManageriOS::resetRestrictions - restricting video in background tabs because system memory = %zul", ramSize());
-        addRestriction(MediaSession::Video, BackgroundTabPlaybackRestricted);
+        addRestriction(PlatformMediaSession::Video, BackgroundTabPlaybackRestricted);
     }
 
-    addRestriction(MediaSession::Video, ConcurrentPlaybackNotPermitted);
-    addRestriction(MediaSession::Video, BackgroundProcessPlaybackRestricted);
+    addRestriction(PlatformMediaSession::Video, ConcurrentPlaybackNotPermitted);
+    addRestriction(PlatformMediaSession::Video, BackgroundProcessPlaybackRestricted);
 
-    removeRestriction(MediaSession::Audio, ConcurrentPlaybackNotPermitted);
-    removeRestriction(MediaSession::Audio, BackgroundProcessPlaybackRestricted);
+    removeRestriction(PlatformMediaSession::Audio, ConcurrentPlaybackNotPermitted);
+    removeRestriction(PlatformMediaSession::Audio, BackgroundProcessPlaybackRestricted);
 
-    removeRestriction(MediaSession::WebAudio, ConcurrentPlaybackNotPermitted);
-    removeRestriction(MediaSession::WebAudio, BackgroundProcessPlaybackRestricted);
+    removeRestriction(PlatformMediaSession::WebAudio, ConcurrentPlaybackNotPermitted);
+    removeRestriction(PlatformMediaSession::WebAudio, BackgroundProcessPlaybackRestricted);
 
-    removeRestriction(MediaSession::Audio, MetadataPreloadingNotPermitted);
-    removeRestriction(MediaSession::Video, MetadataPreloadingNotPermitted);
+    removeRestriction(PlatformMediaSession::Audio, MetadataPreloadingNotPermitted);
+    removeRestriction(PlatformMediaSession::Video, MetadataPreloadingNotPermitted);
 
-    addRestriction(MediaSession::Audio, AutoPreloadingNotPermitted);
-    addRestriction(MediaSession::Video, AutoPreloadingNotPermitted);
+    addRestriction(PlatformMediaSession::Audio, AutoPreloadingNotPermitted);
+    addRestriction(PlatformMediaSession::Video, AutoPreloadingNotPermitted);
 }
 
 bool MediaSessionManageriOS::hasWirelessTargetsAvailable()
@@ -168,7 +168,7 @@ bool MediaSessionManageriOS::hasWirelessTargetsAvailable()
 
 void MediaSessionManageriOS::configureWireLessTargetMonitoring()
 {
-    Vector<MediaSession*> sessions = this->sessions();
+    Vector<PlatformMediaSession*> sessions = this->sessions();
     bool requiresMonitoring = false;
 
     for (auto* session : sessions) {
@@ -186,7 +186,7 @@ void MediaSessionManageriOS::configureWireLessTargetMonitoring()
         [m_objcObserver stopMonitoringAirPlayRoutes];
 }
 
-bool MediaSessionManageriOS::sessionWillBeginPlayback(MediaSession& session)
+bool MediaSessionManageriOS::sessionWillBeginPlayback(PlatformMediaSession& session)
 {
     if (!MediaSessionManager::sessionWillBeginPlayback(session))
         return false;
@@ -195,7 +195,7 @@ bool MediaSessionManageriOS::sessionWillBeginPlayback(MediaSession& session)
     return true;
 }
     
-void MediaSessionManageriOS::sessionWillEndPlayback(MediaSession& session)
+void MediaSessionManageriOS::sessionWillEndPlayback(PlatformMediaSession& session)
 {
     MediaSessionManager::sessionWillEndPlayback(session);
     updateNowPlayingInfo();
@@ -206,7 +206,7 @@ void MediaSessionManageriOS::updateNowPlayingInfo()
     LOG(Media, "MediaSessionManageriOS::updateNowPlayingInfo");
 
     MPNowPlayingInfoCenter *nowPlaying = (MPNowPlayingInfoCenter *)[getMPNowPlayingInfoCenterClass() defaultCenter];
-    const MediaSession* currentSession = this->currentSession();
+    const PlatformMediaSession* currentSession = this->currentSession();
     
     if (!currentSession) {
         [nowPlaying setNowPlayingInfo:nil];
@@ -227,18 +227,18 @@ void MediaSessionManageriOS::updateNowPlayingInfo()
     if (std::isfinite(currentTime) && currentTime != MediaPlayer::invalidTime())
         [info setValue:@(currentTime) forKey:MPNowPlayingInfoPropertyElapsedPlaybackTime];
     
-    [info setValue:(currentSession->state() == MediaSession::Playing ? @YES : @NO) forKey:MPNowPlayingInfoPropertyPlaybackRate];
+    [info setValue:(currentSession->state() == PlatformMediaSession::Playing ? @YES : @NO) forKey:MPNowPlayingInfoPropertyPlaybackRate];
     [nowPlaying setNowPlayingInfo:info.get()];
 }
 
-bool MediaSessionManageriOS::sessionCanLoadMedia(const MediaSession& session) const
+bool MediaSessionManageriOS::sessionCanLoadMedia(const PlatformMediaSession& session) const
 {
-    return session.state() == MediaSession::Playing || !session.isHidden() || session.displayType() == MediaSession::Optimized;
+    return session.state() == PlatformMediaSession::Playing || !session.isHidden() || session.displayType() == PlatformMediaSession::Optimized;
 }
 
 void MediaSessionManageriOS::externalOutputDeviceAvailableDidChange()
 {
-    Vector<MediaSession*> sessionList = sessions();
+    Vector<PlatformMediaSession*> sessionList = sessions();
     bool haveTargets = [m_objcObserver hasWirelessTargetsAvailable];
     for (auto* session : sessionList)
         session->externalOutputDeviceAvailableDidChange(haveTargets);
@@ -383,19 +383,19 @@ void MediaSessionManageriOS::externalOutputDeviceAvailableDidChange()
         return;
 
     NSUInteger type = [[[notification userInfo] objectForKey:AVAudioSessionInterruptionTypeKey] unsignedIntegerValue];
-    MediaSession::EndInterruptionFlags flags = MediaSession::NoFlags;
+    PlatformMediaSession::EndInterruptionFlags flags = PlatformMediaSession::NoFlags;
 
     LOG(Media, "-[WebMediaSessionHelper interruption] - type = %i", (int)type);
 
     if (type == AVAudioSessionInterruptionTypeEnded && [[[notification userInfo] objectForKey:AVAudioSessionInterruptionOptionKey] unsignedIntegerValue] == AVAudioSessionInterruptionOptionShouldResume)
-        flags = MediaSession::MayResumePlaying;
+        flags = PlatformMediaSession::MayResumePlaying;
 
     WebThreadRun(^{
         if (!_callback)
             return;
 
         if (type == AVAudioSessionInterruptionTypeBegan)
-            _callback->beginInterruption(MediaSession::SystemInterruption);
+            _callback->beginInterruption(PlatformMediaSession::SystemInterruption);
         else
             _callback->endInterruption(flags);
 
index f5b2885..e274418 100644 (file)
@@ -39,11 +39,11 @@ static const size_t kLowPowerVideoBufferSize = 4096;
 
 void MediaSessionManager::updateSessionState()
 {
-    LOG(Media, "MediaSessionManager::updateSessionState() - types: Video(%d), Audio(%d), WebAudio(%d)", count(MediaSession::Video), count(MediaSession::Audio), count(MediaSession::WebAudio));
+    LOG(Media, "MediaSessionManager::updateSessionState() - types: Video(%d), Audio(%d), WebAudio(%d)", count(PlatformMediaSession::Video), count(PlatformMediaSession::Audio), count(PlatformMediaSession::WebAudio));
 
-    if (has(MediaSession::WebAudio))
+    if (has(PlatformMediaSession::WebAudio))
         AudioSession::sharedSession().setPreferredBufferSize(kWebAudioBufferSize);
-    else if ((has(MediaSession::Video) || has(MediaSession::Audio)) && Settings::lowPowerVideoAudioBufferSizeEnabled()) {
+    else if ((has(PlatformMediaSession::Video) || has(PlatformMediaSession::Audio)) && Settings::lowPowerVideoAudioBufferSizeEnabled()) {
         // FIXME: <http://webkit.org/b/116725> Figure out why enabling the code below
         // causes media LayoutTests to fail on 10.8.
 
@@ -60,9 +60,9 @@ void MediaSessionManager::updateSessionState()
     if (!Settings::shouldManageAudioSessionCategory())
         return;
 
-    if (has(MediaSession::Video) || has(MediaSession::Audio))
+    if (has(PlatformMediaSession::Video) || has(PlatformMediaSession::Audio))
         AudioSession::sharedSession().setCategory(AudioSession::MediaPlayback);
-    else if (has(MediaSession::WebAudio))
+    else if (has(PlatformMediaSession::WebAudio))
         AudioSession::sharedSession().setCategory(AudioSession::AmbientSound);
 #endif
 }
index 70ac172..7e89406 100644 (file)
@@ -1347,7 +1347,7 @@ bool MediaPlayer::shouldWaitForResponseToAuthenticationChallenge(const Authentic
     return m_client.mediaPlayerShouldWaitForResponseToAuthenticationChallenge(challenge);
 }
 
-void MediaPlayer::handlePlaybackCommand(MediaSession::RemoteControlCommandType command)
+void MediaPlayer::handlePlaybackCommand(PlatformMediaSession::RemoteControlCommandType command)
 {
     m_client.mediaPlayerHandlePlaybackCommand(command);
 }
index 9283e8f..1665130 100644 (file)
 #include "URL.h"
 #include "LayoutRect.h"
 #include "MediaPlayerEnums.h"
-#include "MediaSession.h"
 #include "NativeImagePtr.h"
 #include "PlatformLayer.h"
 #include "PlatformMediaResourceLoader.h"
+#include "PlatformMediaSession.h"
 #include "Timer.h"
 #include "VideoTrackPrivate.h"
 #include <runtime/Uint8Array.h>
@@ -268,7 +268,7 @@ public:
 #endif
     
     virtual bool mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&) { return false; }
-    virtual void mediaPlayerHandlePlaybackCommand(MediaSession::RemoteControlCommandType) { }
+    virtual void mediaPlayerHandlePlaybackCommand(PlatformMediaSession::RemoteControlCommandType) { }
 
     virtual String mediaPlayerSourceApplicationIdentifier() const { return emptyString(); }
 
@@ -594,7 +594,7 @@ public:
 #endif
 
     bool shouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&);
-    void handlePlaybackCommand(MediaSession::RemoteControlCommandType);
+    void handlePlaybackCommand(PlatformMediaSession::RemoteControlCommandType);
     String sourceApplicationIdentifier() const;
     Vector<String> preferredAudioCharacteristics() const;
 
index 79ae2ff..b2a7c1b 100644 (file)
@@ -621,7 +621,7 @@ void MediaPlayerPrivateAVFoundation::rateChanged()
 {
 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && PLATFORM(IOS)
     if (isCurrentPlaybackTargetWireless())
-        m_player->handlePlaybackCommand(rate() ? MediaSession::PlayCommand : MediaSession::PauseCommand);
+        m_player->handlePlaybackCommand(rate() ? PlatformMediaSession::PlayCommand : PlatformMediaSession::PauseCommand);
 #endif
 
     m_player->rateChanged();
index cbce5e3..7d14421 100644 (file)
@@ -55,7 +55,7 @@ RemoteCommandListenerIOS::RemoteCommandListenerIOS(RemoteCommandListenerClient&
         callOnMainThread([weakThis] {
             if (!weakThis)
                 return;
-            weakThis->m_client.didReceiveRemoteControlCommand(MediaSession::PauseCommand);
+            weakThis->m_client.didReceiveRemoteControlCommand(PlatformMediaSession::PauseCommand);
         });
 
         return MPRemoteCommandHandlerStatusSuccess;
@@ -65,7 +65,7 @@ RemoteCommandListenerIOS::RemoteCommandListenerIOS(RemoteCommandListenerClient&
         callOnMainThread([weakThis] {
             if (!weakThis)
                 return;
-            weakThis->m_client.didReceiveRemoteControlCommand(MediaSession::PlayCommand);
+            weakThis->m_client.didReceiveRemoteControlCommand(PlatformMediaSession::PlayCommand);
         });
 
         return MPRemoteCommandHandlerStatusSuccess;
@@ -75,7 +75,7 @@ RemoteCommandListenerIOS::RemoteCommandListenerIOS(RemoteCommandListenerClient&
         callOnMainThread([weakThis] {
             if (!weakThis)
                 return;
-            weakThis->m_client.didReceiveRemoteControlCommand(MediaSession::TogglePlayPauseCommand);
+            weakThis->m_client.didReceiveRemoteControlCommand(PlatformMediaSession::TogglePlayPauseCommand);
         });
 
         return MPRemoteCommandHandlerStatusSuccess;
@@ -85,7 +85,7 @@ RemoteCommandListenerIOS::RemoteCommandListenerIOS(RemoteCommandListenerClient&
         ASSERT([event isKindOfClass:getMPSeekCommandEventClass()]);
 
         MPSeekCommandEvent* seekEvent = static_cast<MPSeekCommandEvent *>(event);
-        MediaSession::RemoteControlCommandType command = [seekEvent type] == MPSeekCommandEventTypeBeginSeeking ? MediaSession::BeginSeekingBackwardCommand : MediaSession::EndSeekingBackwardCommand;
+        PlatformMediaSession::RemoteControlCommandType command = [seekEvent type] == MPSeekCommandEventTypeBeginSeeking ? PlatformMediaSession::BeginSeekingBackwardCommand : PlatformMediaSession::EndSeekingBackwardCommand;
 
         callOnMainThread([weakThis, command] {
             if (!weakThis)
@@ -100,7 +100,7 @@ RemoteCommandListenerIOS::RemoteCommandListenerIOS(RemoteCommandListenerClient&
         ASSERT([event isKindOfClass:getMPSeekCommandEventClass()]);
         MPSeekCommandEvent* seekEvent = static_cast<MPSeekCommandEvent *>(event);
 
-        MediaSession::RemoteControlCommandType command = [seekEvent type] == MPSeekCommandEventTypeBeginSeeking ? MediaSession::BeginSeekingForwardCommand : MediaSession::EndSeekingForwardCommand;
+        PlatformMediaSession::RemoteControlCommandType command = [seekEvent type] == MPSeekCommandEventTypeBeginSeeking ? PlatformMediaSession::BeginSeekingForwardCommand : PlatformMediaSession::EndSeekingForwardCommand;
 
         callOnMainThread([weakThis, command] {
             if (!weakThis)
index 5a22a17..90d0c64 100644 (file)
@@ -2578,15 +2578,15 @@ Vector<String> Internals::bufferedSamplesForTrackID(SourceBuffer* buffer, const
 #if ENABLE(VIDEO)
 void Internals::beginMediaSessionInterruption()
 {
-    MediaSessionManager::sharedManager().beginInterruption(MediaSession::SystemInterruption);
+    MediaSessionManager::sharedManager().beginInterruption(PlatformMediaSession::SystemInterruption);
 }
 
 void Internals::endMediaSessionInterruption(const String& flagsString)
 {
-    MediaSession::EndInterruptionFlags flags = MediaSession::NoFlags;
+    PlatformMediaSession::EndInterruptionFlags flags = PlatformMediaSession::NoFlags;
 
     if (equalIgnoringCase(flagsString, "MayResumePlaying"))
-        flags = MediaSession::MayResumePlaying;
+        flags = PlatformMediaSession::MayResumePlaying;
     
     MediaSessionManager::sharedManager().endInterruption(flags);
 }
@@ -2603,13 +2603,13 @@ void Internals::applicationWillEnterBackground() const
 
 void Internals::setMediaSessionRestrictions(const String& mediaTypeString, const String& restrictionsString, ExceptionCode& ec)
 {
-    MediaSession::MediaType mediaType = MediaSession::None;
+    PlatformMediaSession::MediaType mediaType = PlatformMediaSession::None;
     if (equalIgnoringCase(mediaTypeString, "Video"))
-        mediaType = MediaSession::Video;
+        mediaType = PlatformMediaSession::Video;
     else if (equalIgnoringCase(mediaTypeString, "Audio"))
-        mediaType = MediaSession::Audio;
+        mediaType = PlatformMediaSession::Audio;
     else if (equalIgnoringCase(mediaTypeString, "WebAudio"))
-        mediaType = MediaSession::WebAudio;
+        mediaType = PlatformMediaSession::WebAudio;
     else {
         ec = INVALID_ACCESS_ERR;
         return;
@@ -2682,24 +2682,24 @@ void Internals::setMediaElementRestrictions(HTMLMediaElement* element, const Str
 
 void Internals::postRemoteControlCommand(const String& commandString, ExceptionCode& ec)
 {
-    MediaSession::RemoteControlCommandType command;
+    PlatformMediaSession::RemoteControlCommandType command;
     
     if (equalIgnoringCase(commandString, "Play"))
-        command = MediaSession::PlayCommand;
+        command = PlatformMediaSession::PlayCommand;
     else if (equalIgnoringCase(commandString, "Pause"))
-        command = MediaSession::PauseCommand;
+        command = PlatformMediaSession::PauseCommand;
     else if (equalIgnoringCase(commandString, "Stop"))
-        command = MediaSession::StopCommand;
+        command = PlatformMediaSession::StopCommand;
     else if (equalIgnoringCase(commandString, "TogglePlayPause"))
-        command = MediaSession::TogglePlayPauseCommand;
+        command = PlatformMediaSession::TogglePlayPauseCommand;
     else if (equalIgnoringCase(commandString, "BeginSeekingBackward"))
-        command = MediaSession::BeginSeekingBackwardCommand;
+        command = PlatformMediaSession::BeginSeekingBackwardCommand;
     else if (equalIgnoringCase(commandString, "EndSeekingBackward"))
-        command = MediaSession::EndSeekingBackwardCommand;
+        command = PlatformMediaSession::EndSeekingBackwardCommand;
     else if (equalIgnoringCase(commandString, "BeginSeekingForward"))
-        command = MediaSession::BeginSeekingForwardCommand;
+        command = PlatformMediaSession::BeginSeekingForwardCommand;
     else if (equalIgnoringCase(commandString, "EndSeekingForward"))
-        command = MediaSession::EndSeekingForwardCommand;
+        command = PlatformMediaSession::EndSeekingForwardCommand;
     else {
         ec = INVALID_ACCESS_ERR;
         return;