<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[185006] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/185006">185006</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-05-29 14:53:30 -0700 (Fri, 29 May 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>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
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):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioAudioContextcpp">trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioAudioContexth">trunk/Source/WebCore/Modules/webaudio/AudioContext.h</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAudioElementh">trunk/Source/WebCore/html/HTMLAudioElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementh">trunk/Source/WebCore/html/HTMLMediaElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLVideoElementh">trunk/Source/WebCore/html/HTMLVideoElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlMediaElementSessioncpp">trunk/Source/WebCore/html/MediaElementSession.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlMediaElementSessionh">trunk/Source/WebCore/html/MediaElementSession.h</a></li>
<li><a href="#trunkSourceWebCoreplatformRemoteCommandListenerh">trunk/Source/WebCore/platform/RemoteCommandListener.h</a></li>
<li><a href="#trunkSourceWebCoreplatformaudioMediaSessionManagercpp">trunk/Source/WebCore/platform/audio/MediaSessionManager.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformaudioMediaSessionManagerh">trunk/Source/WebCore/platform/audio/MediaSessionManager.h</a></li>
<li><a href="#trunkSourceWebCoreplatformaudioiosMediaSessionManagerIOSh">trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h</a></li>
<li><a href="#trunkSourceWebCoreplatformaudioiosMediaSessionManagerIOSmm">trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformaudiomacMediaSessionManagerMaccpp">trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayercpp">trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayerh">trunk/Source/WebCore/platform/graphics/MediaPlayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationcpp">trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformiosRemoteCommandListenerIOSmm">trunk/Source/WebCore/platform/ios/RemoteCommandListenerIOS.mm</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformaudioPlatformMediaSessioncpp">trunk/Source/WebCore/platform/audio/PlatformMediaSession.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformaudioPlatformMediaSessionh">trunk/Source/WebCore/platform/audio/PlatformMediaSession.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformaudioMediaSessioncpp">trunk/Source/WebCore/platform/audio/MediaSession.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformaudioMediaSessionh">trunk/Source/WebCore/platform/audio/MediaSession.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -2101,10 +2101,10 @@
</span><span class="cx"> platform/audio/HRTFElevation.cpp
</span><span class="cx"> platform/audio/HRTFKernel.cpp
</span><span class="cx"> platform/audio/HRTFPanner.cpp
</span><del>- platform/audio/MediaSession.cpp
</del><span class="cx"> platform/audio/MediaSessionManager.cpp
</span><span class="cx"> platform/audio/MultiChannelResampler.cpp
</span><span class="cx"> platform/audio/Panner.cpp
</span><ins>+ platform/audio/PlatformMediaSession.cpp
</ins><span class="cx"> platform/audio/Reverb.cpp
</span><span class="cx"> platform/audio/ReverbAccumulationBuffer.cpp
</span><span class="cx"> platform/audio/ReverbConvolver.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/ChangeLog        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -1,3 +1,122 @@
</span><ins>+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):
+
</ins><span class="cx"> 2015-05-29 Alex Christensen <achristensen@webkit.org>
</span><span class="cx">
</span><span class="cx"> [Content Extensions] Decrease maxNFASize
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioAudioContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -129,7 +129,7 @@
</span><span class="cx"> // Constructor for rendering to the audio hardware.
</span><span class="cx"> AudioContext::AudioContext(Document& document)
</span><span class="cx"> : ActiveDOMObject(&document)
</span><del>- , m_mediaSession(MediaSession::create(*this))
</del><ins>+ , m_mediaSession(PlatformMediaSession::create(*this))
</ins><span class="cx"> , m_eventQueue(std::make_unique<GenericEventQueue>(*this))
</span><span class="cx"> , m_graphOwnerThread(UndefinedThreadIdentifier)
</span><span class="cx"> {
</span><span class="lines">@@ -145,7 +145,7 @@
</span><span class="cx"> AudioContext::AudioContext(Document& document, unsigned numberOfChannels, size_t numberOfFrames, float sampleRate)
</span><span class="cx"> : ActiveDOMObject(&document)
</span><span class="cx"> , m_isOfflineContext(true)
</span><del>- , m_mediaSession(MediaSession::create(*this))
</del><ins>+ , m_mediaSession(PlatformMediaSession::create(*this))
</ins><span class="cx"> , m_eventQueue(std::make_unique<GenericEventQueue>(*this))
</span><span class="cx"> , m_graphOwnerThread(UndefinedThreadIdentifier)
</span><span class="cx"> {
</span><span class="lines">@@ -1200,7 +1200,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if (m_state == State::Suspended) {
</span><del>- if (m_mediaSession->state() == MediaSession::Interrupted)
</del><ins>+ if (m_mediaSession->state() == PlatformMediaSession::Interrupted)
</ins><span class="cx"> setState(State::Interrupted);
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="lines">@@ -1209,7 +1209,7 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<AudioContext> strongThis(this);
</span><span class="cx"> m_destinationNode->suspend([strongThis] {
</span><del>- bool interrupted = strongThis->m_mediaSession->state() == MediaSession::Interrupted;
</del><ins>+ bool interrupted = strongThis->m_mediaSession->state() == PlatformMediaSession::Interrupted;
</ins><span class="cx"> strongThis->setState(interrupted ? State::Interrupted : State::Suspended);
</span><span class="cx"> });
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioAudioContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/AudioContext.h (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/AudioContext.h        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/Modules/webaudio/AudioContext.h        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> #include "EventTarget.h"
</span><span class="cx"> #include "MediaCanStartListener.h"
</span><span class="cx"> #include "MediaProducer.h"
</span><del>-#include "MediaSession.h"
</del><ins>+#include "PlatformMediaSession.h"
</ins><span class="cx"> #include <atomic>
</span><span class="cx"> #include <wtf/HashSet.h>
</span><span class="cx"> #include <wtf/MainThread.h>
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx"> // AudioContext is the cornerstone of the web audio API and all AudioNodes are created from it.
</span><span class="cx"> // For thread safety between the audio thread and the main thread, it has a rendering graph locking mechanism.
</span><span class="cx">
</span><del>-class AudioContext : public ActiveDOMObject, public ThreadSafeRefCounted<AudioContext>, public EventTargetWithInlineData, public MediaCanStartListener, public MediaProducer, private MediaSessionClient {
</del><ins>+class AudioContext : public ActiveDOMObject, public ThreadSafeRefCounted<AudioContext>, public EventTargetWithInlineData, public MediaCanStartListener, public MediaProducer, private PlatformMediaSessionClient {
</ins><span class="cx"> public:
</span><span class="cx"> // Create an AudioContext for rendering to the audio hardware.
</span><span class="cx"> static RefPtr<AudioContext> create(Document&, ExceptionCode&);
</span><span class="lines">@@ -308,13 +308,13 @@
</span><span class="cx"> // Make sure to dereference them here.
</span><span class="cx"> void derefUnfinishedSourceNodes();
</span><span class="cx">
</span><del>- // MediaSessionClient
- virtual MediaSession::MediaType mediaType() const override { return MediaSession::WebAudio; }
- virtual MediaSession::MediaType presentationType() const override { return MediaSession::WebAudio; }
</del><ins>+ // PlatformMediaSessionClient
+ virtual PlatformMediaSession::MediaType mediaType() const override { return PlatformMediaSession::WebAudio; }
+ virtual PlatformMediaSession::MediaType presentationType() const override { return PlatformMediaSession::WebAudio; }
</ins><span class="cx"> virtual void mayResumePlayback(bool shouldResume) override;
</span><span class="cx"> virtual void suspendPlayback() override;
</span><span class="cx"> virtual bool canReceiveRemoteControlCommands() const override { return false; }
</span><del>- virtual void didReceiveRemoteControlCommand(MediaSession::RemoteControlCommandType) override { }
</del><ins>+ virtual void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) override { }
</ins><span class="cx"> virtual bool overrideBackgroundPlaybackRestriction() const override { return false; }
</span><span class="cx">
</span><span class="cx"> // EventTarget
</span><span class="lines">@@ -363,7 +363,7 @@
</span><span class="cx"> Vector<AudioNode*> m_deferredFinishDerefList;
</span><span class="cx"> Vector<Vector<std::function<void()>>> m_stateReactions;
</span><span class="cx">
</span><del>- std::unique_ptr<MediaSession> m_mediaSession;
</del><ins>+ std::unique_ptr<PlatformMediaSession> m_mediaSession;
</ins><span class="cx"> std::unique_ptr<GenericEventQueue> m_eventQueue;
</span><span class="cx">
</span><span class="cx"> RefPtr<AudioBuffer> m_renderTarget;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -7395,7 +7395,7 @@
</span><span class="cx"> <ClCompile Include="..\platform\graphics\avfoundation\cf\WebCoreAVCFResourceLoader.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\ISOVTTCue.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\audio\AudioSession.cpp" />
</span><del>- <ClCompile Include="..\platform\audio\MediaSession.cpp" />
</del><ins>+ <ClCompile Include="..\platform\audio\PlatformMediaSession.cpp" />
</ins><span class="cx"> <ClCompile Include="..\platform\audio\MediaSessionManager.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\ANGLEWebKitBridge.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\avfoundation\cf\InbandTextTrackPrivateAVCF.cpp" />
</span><span class="lines">@@ -19764,7 +19764,7 @@
</span><span class="cx"> <ClInclude Include="..\platform\FloatConversion.h" />
</span><span class="cx"> <ClInclude Include="..\platform\GenericTaskQueue.h" />
</span><span class="cx"> <ClInclude Include="..\platform\audio\AudioSession.h" />
</span><del>- <ClInclude Include="..\platform\audio\MediaSession.h" />
</del><ins>+ <ClInclude Include="..\platform\audio\PlatformMediaSession.h" />
</ins><span class="cx"> <ClInclude Include="..\platform\audio\MediaSessionManager.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\ANGLEWebKitBridge.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\AudioTrackPrivate.h" />
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -7051,7 +7051,7 @@
</span><span class="cx"> <ClCompile Include="..\rendering\line\LineInfo.cpp">
</span><span class="cx"> <Filter>rendering\line</Filter>
</span><span class="cx"> </ClCompile>
</span><del>- <ClCompile Include="..\platform\audio\MediaSession.cpp">
</del><ins>+ <ClCompile Include="..\platform\audio\PlatformMediaSession.cpp">
</ins><span class="cx"> <Filter>platform\audio</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="cx"> <ClCompile Include="..\platform\audio\MediaSessionManager.cpp">
</span><span class="lines">@@ -14498,7 +14498,7 @@
</span><span class="cx"> <ClInclude Include="..\platform\audio\MediaSessionManager.h">
</span><span class="cx"> <Filter>platform\audio</Filter>
</span><span class="cx"> </ClInclude>
</span><del>- <ClInclude Include="..\platform\audio\MediaSession.h">
</del><ins>+ <ClInclude Include="..\platform\audio\PlatformMediaSession.h">
</ins><span class="cx"> <Filter>platform\audio</Filter>
</span><span class="cx"> </ClInclude>
</span><span class="cx"> <ClInclude Include="..\Modules\gamepad\NavigatorGamepad.h">
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -119,8 +119,8 @@
</span><span class="cx">                 0709D7931AE5557E004E42F8 /* WebMediaSessionManagerMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 0709D7911AE5557E004E42F8 /* WebMediaSessionManagerMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 0709D7951AE55A29004E42F8 /* WebMediaSessionManagerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 0709D7941AE55A29004E42F8 /* WebMediaSessionManagerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 0709FC4E1025DEE30059CDBA /* AccessibilitySlider.h in Headers */ = {isa = PBXBuildFile; fileRef = 0709FC4D1025DEE30059CDBA /* AccessibilitySlider.h */; };
</span><del>-                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 */; };
</del><ins>+                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 */; };
</ins><span class="cx">                 070F549817F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 070F549717F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h */; };
</span><span class="cx">                 070F549E17F2402700169E04 /* AudioDestinationConsumer.h in Headers */ = {isa = PBXBuildFile; fileRef = 070F549D17F2402700169E04 /* AudioDestinationConsumer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 0711589117DF6F6600EDFE2B /* MediaStreamPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0711588F17DF633700EDFE2B /* MediaStreamPrivate.cpp */; };
</span><span class="lines">@@ -7134,8 +7134,8 @@
</span><span class="cx">                 0709D7941AE55A29004E42F8 /* WebMediaSessionManagerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebMediaSessionManagerClient.h; sourceTree = "<group>"; };
</span><span class="cx">                 0709FC4D1025DEE30059CDBA /* AccessibilitySlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilitySlider.h; sourceTree = "<group>"; };
</span><span class="cx">                 070DD8F50F01868000727DEB /* mediaControls.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mediaControls.css; sourceTree = "<group>"; };
</span><del>-                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>"; };
</del><ins>+                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>"; };
</ins><span class="cx">                 070F549717F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamConstraintsValidationClient.h; sourceTree = "<group>"; };
</span><span class="cx">                 070F549D17F2402700169E04 /* AudioDestinationConsumer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioDestinationConsumer.h; sourceTree = "<group>"; };
</span><span class="cx">                 0711588F17DF633700EDFE2B /* MediaStreamPrivate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamPrivate.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -23548,14 +23548,14 @@
</span><span class="cx">                                 FD31606912B026F700C1A359 /* HRTFKernel.h */,
</span><span class="cx">                                 FD31606A12B026F700C1A359 /* HRTFPanner.cpp */,
</span><span class="cx">                                 FD31606B12B026F700C1A359 /* HRTFPanner.h */,
</span><del>-                                070E091A1875EF71003A1D3C /* MediaSession.cpp */,
-                                070E09181875ED93003A1D3C /* MediaSession.h */,
</del><span class="cx">                                 CDAE8C071746B95700532D78 /* MediaSessionManager.cpp */,
</span><span class="cx">                                 CDAE8C081746B95700532D78 /* MediaSessionManager.h */,
</span><span class="cx">                                 FDB1700314A2BAB200A2B5D9 /* MultiChannelResampler.cpp */,
</span><span class="cx">                                 FDB1700414A2BAB200A2B5D9 /* MultiChannelResampler.h */,
</span><span class="cx">                                 FD31606C12B026F700C1A359 /* Panner.cpp */,
</span><span class="cx">                                 FD31606D12B026F700C1A359 /* Panner.h */,
</span><ins>+                                070E091A1875EF71003A1D3C /* PlatformMediaSession.cpp */,
+                                070E09181875ED93003A1D3C /* PlatformMediaSession.h */,
</ins><span class="cx">                                 FD31606E12B026F700C1A359 /* Reverb.cpp */,
</span><span class="cx">                                 FD31606F12B026F700C1A359 /* Reverb.h */,
</span><span class="cx">                                 FD31607012B026F700C1A359 /* ReverbAccumulationBuffer.cpp */,
</span><span class="lines">@@ -25799,7 +25799,6 @@
</span><span class="cx">                                 D3AA10F4123A98AA0092152B /* MediaQueryMatcher.h in Headers */,
</span><span class="cx">                                 CEEFCD7A19DB31F7003876D7 /* MediaResourceLoader.h in Headers */,
</span><span class="cx">                                 CDBEAEAD19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.h in Headers */,
</span><del>-                                070E09191875EEFC003A1D3C /* MediaSession.h in Headers */,
</del><span class="cx">                                 07F944161864D046005D31CB /* MediaSessionManager.h in Headers */,
</span><span class="cx">                                 07638A991884487200E15A1B /* MediaSessionManagerIOS.h in Headers */,
</span><span class="cx">                                 CD3A495F17A9D01B00274E42 /* MediaSource.h in Headers */,
</span><span class="lines">@@ -26023,6 +26022,7 @@
</span><span class="cx">                                 0562F9611573F88F0031CA16 /* PlatformLayer.h in Headers */,
</span><span class="cx">                                 F544F78915CFB2A800AF33A8 /* PlatformLocale.h in Headers */,
</span><span class="cx">                                 CEEFCD7C19DB33DC003876D7 /* PlatformMediaResourceLoader.h in Headers */,
</span><ins>+                                070E09191875EEFC003A1D3C /* PlatformMediaSession.h in Headers */,
</ins><span class="cx">                                 932871C00B20DEB70049035A /* PlatformMenuDescription.h in Headers */,
</span><span class="cx">                                 41BF70100FE86F61005E8DEC /* PlatformMessagePortChannel.h in Headers */,
</span><span class="cx">                                 935C476909AC4D4300A6AAB4 /* PlatformMouseEvent.h in Headers */,
</span><span class="lines">@@ -29378,7 +29378,6 @@
</span><span class="cx">                                 D3AA10F3123A98AA0092152B /* MediaQueryMatcher.cpp in Sources */,
</span><span class="cx">                                 CEEFCD7919DB31F7003876D7 /* MediaResourceLoader.cpp in Sources */,
</span><span class="cx">                                 CDBEAEAC19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.mm in Sources */,
</span><del>-                                070E091B1875EF71003A1D3C /* MediaSession.cpp in Sources */,
</del><span class="cx">                                 CDAE8C091746B95700532D78 /* MediaSessionManager.cpp in Sources */,
</span><span class="cx">                                 07638A9A1884487200E15A1B /* MediaSessionManagerIOS.mm in Sources */,
</span><span class="cx">                                 07EDC3EE1AACB75D00983EB5 /* MediaSessionManagerMac.cpp in Sources */,
</span><span class="lines">@@ -29549,6 +29548,7 @@
</span><span class="cx">                                 26601EC014B3B9AD0012C0FE /* PlatformEventFactoryIOS.mm in Sources */,
</span><span class="cx">                                 BCAA486F14A052530088FAC4 /* PlatformEventFactoryMac.mm in Sources */,
</span><span class="cx">                                 F544F78815CFB2A800AF33A8 /* PlatformLocale.cpp in Sources */,
</span><ins>+                                070E091B1875EF71003A1D3C /* PlatformMediaSession.cpp in Sources */,
</ins><span class="cx">                                 41BF700F0FE86F61005E8DEC /* PlatformMessagePortChannel.cpp in Sources */,
</span><span class="cx">                                 C5278B0C17F212EA003A2998 /* PlatformPasteboardIOS.mm in Sources */,
</span><span class="cx">                                 C598902E14E9B0F800E8D18B /* PlatformPasteboardMac.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAudioElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAudioElement.h (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAudioElement.h        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/html/HTMLAudioElement.h        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx"> private:
</span><span class="cx"> HTMLAudioElement(const QualifiedName&, Document&, bool);
</span><span class="cx">
</span><del>- virtual MediaSession::MediaType presentationType() const override { return MediaSession::Audio; }
</del><ins>+ virtual PlatformMediaSession::MediaType presentationType() const override { return PlatformMediaSession::Audio; }
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -4533,7 +4533,7 @@
</span><span class="cx">
</span><span class="cx"> bool HTMLMediaElement::pausedForUserInteraction() const
</span><span class="cx"> {
</span><del>- if (m_mediaSession->state() == MediaSession::Interrupted)
</del><ins>+ if (m_mediaSession->state() == PlatformMediaSession::Interrupted)
</ins><span class="cx"> return true;
</span><span class="cx">
</span><span class="cx"> return false;
</span><span class="lines">@@ -6167,33 +6167,33 @@
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-MediaSession::MediaType HTMLMediaElement::mediaType() const
</del><ins>+PlatformMediaSession::MediaType HTMLMediaElement::mediaType() const
</ins><span class="cx"> {
</span><span class="cx"> if (m_player && m_readyState >= HAVE_METADATA)
</span><del>- return hasVideo() ? MediaSession::Video : MediaSession::Audio;
</del><ins>+ return hasVideo() ? PlatformMediaSession::Video : PlatformMediaSession::Audio;
</ins><span class="cx">
</span><span class="cx"> return presentationType();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-MediaSession::MediaType HTMLMediaElement::presentationType() const
</del><ins>+PlatformMediaSession::MediaType HTMLMediaElement::presentationType() const
</ins><span class="cx"> {
</span><span class="cx"> if (hasTagName(HTMLNames::videoTag))
</span><del>- return MediaSession::Video;
</del><ins>+ return PlatformMediaSession::Video;
</ins><span class="cx">
</span><del>- return MediaSession::Audio;
</del><ins>+ return PlatformMediaSession::Audio;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-MediaSession::DisplayType HTMLMediaElement::displayType() const
</del><ins>+PlatformMediaSession::DisplayType HTMLMediaElement::displayType() const
</ins><span class="cx"> {
</span><span class="cx"> if (m_videoFullscreenMode == VideoFullscreenModeStandard)
</span><del>- return MediaSession::Fullscreen;
</del><ins>+ return PlatformMediaSession::Fullscreen;
</ins><span class="cx"> if (m_videoFullscreenMode & VideoFullscreenModeOptimized)
</span><del>- return MediaSession::Optimized;
</del><ins>+ return PlatformMediaSession::Optimized;
</ins><span class="cx"> if (m_videoFullscreenMode == VideoFullscreenModeNone)
</span><del>- return MediaSession::Normal;
</del><ins>+ return PlatformMediaSession::Normal;
</ins><span class="cx">
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><del>- return MediaSession::Normal;
</del><ins>+ return PlatformMediaSession::Normal;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><span class="lines">@@ -6225,28 +6225,28 @@
</span><span class="cx"> return m_currentSrc;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void HTMLMediaElement::didReceiveRemoteControlCommand(MediaSession::RemoteControlCommandType command)
</del><ins>+void HTMLMediaElement::didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType command)
</ins><span class="cx"> {
</span><span class="cx"> LOG(Media, "HTMLMediaElement::didReceiveRemoteControlCommand(%p) - %i", this, static_cast<int>(command));
</span><span class="cx">
</span><span class="cx"> switch (command) {
</span><del>- case MediaSession::PlayCommand:
</del><ins>+ case PlatformMediaSession::PlayCommand:
</ins><span class="cx"> play();
</span><span class="cx"> break;
</span><del>- case MediaSession::PauseCommand:
</del><ins>+ case PlatformMediaSession::PauseCommand:
</ins><span class="cx"> pause();
</span><span class="cx"> break;
</span><del>- case MediaSession::TogglePlayPauseCommand:
</del><ins>+ case PlatformMediaSession::TogglePlayPauseCommand:
</ins><span class="cx"> canPlay() ? play() : pause();
</span><span class="cx"> break;
</span><del>- case MediaSession::BeginSeekingBackwardCommand:
</del><ins>+ case PlatformMediaSession::BeginSeekingBackwardCommand:
</ins><span class="cx"> beginScanning(Backward);
</span><span class="cx"> break;
</span><del>- case MediaSession::BeginSeekingForwardCommand:
</del><ins>+ case PlatformMediaSession::BeginSeekingForwardCommand:
</ins><span class="cx"> beginScanning(Forward);
</span><span class="cx"> break;
</span><del>- case MediaSession::EndSeekingBackwardCommand:
- case MediaSession::EndSeekingForwardCommand:
</del><ins>+ case PlatformMediaSession::EndSeekingBackwardCommand:
+ case PlatformMediaSession::EndSeekingForwardCommand:
</ins><span class="cx"> endScanning();
</span><span class="cx"> break;
</span><span class="cx"> default:
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.h        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx">
</span><span class="cx"> class HTMLMediaElement
</span><span class="cx"> : public HTMLElement
</span><del>- , private MediaPlayerClient, public MediaPlayerSupportsTypeClient, private MediaCanStartListener, public ActiveDOMObject, public MediaControllerInterface , public MediaSessionClient, private MediaProducer
</del><ins>+ , private MediaPlayerClient, public MediaPlayerSupportsTypeClient, private MediaCanStartListener, public ActiveDOMObject, public MediaControllerInterface , public PlatformMediaSessionClient, private MediaProducer
</ins><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> , private AudioTrackClient
</span><span class="cx"> , private TextTrackClient
</span><span class="lines">@@ -568,7 +568,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> virtual bool mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&) override;
</span><del>- virtual void mediaPlayerHandlePlaybackCommand(MediaSession::RemoteControlCommandType command) override { didReceiveRemoteControlCommand(command); }
</del><ins>+ virtual void mediaPlayerHandlePlaybackCommand(PlatformMediaSession::RemoteControlCommandType command) override { didReceiveRemoteControlCommand(command); }
</ins><span class="cx"> virtual String mediaPlayerSourceApplicationIdentifier() const override;
</span><span class="cx"> virtual Vector<String> mediaPlayerPreferredAudioCharacteristics() const override;
</span><span class="cx">
</span><span class="lines">@@ -690,17 +690,17 @@
</span><span class="cx"> bool ensureMediaControlsInjectedScript();
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- // MediaSessionClient Overrides
- virtual MediaSession::MediaType mediaType() const override;
- virtual MediaSession::MediaType presentationType() const override;
- virtual MediaSession::DisplayType displayType() const override;
</del><ins>+ // PlatformMediaSessionClient Overrides
+ virtual PlatformMediaSession::MediaType mediaType() const override;
+ virtual PlatformMediaSession::MediaType presentationType() const override;
+ virtual PlatformMediaSession::DisplayType displayType() const override;
</ins><span class="cx"> virtual void suspendPlayback() override;
</span><span class="cx"> virtual void mayResumePlayback(bool shouldResume) override;
</span><span class="cx"> virtual String mediaSessionTitle() const override;
</span><span class="cx"> virtual double mediaSessionDuration() const override { return duration(); }
</span><span class="cx"> virtual double mediaSessionCurrentTime() const override { return currentTime(); }
</span><span class="cx"> virtual bool canReceiveRemoteControlCommands() const override { return true; }
</span><del>- virtual void didReceiveRemoteControlCommand(MediaSession::RemoteControlCommandType) override;
</del><ins>+ virtual void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) override;
</ins><span class="cx"> virtual bool overrideBackgroundPlaybackRestriction() const override;
</span><span class="cx">
</span><span class="cx"> virtual void pageMutedStateDidChange() override;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLVideoElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLVideoElement.h (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLVideoElement.h        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/html/HTMLVideoElement.h        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -104,7 +104,7 @@
</span><span class="cx"> virtual void didMoveToNewDocument(Document* oldDocument) override;
</span><span class="cx"> virtual void setDisplayMode(DisplayMode) override;
</span><span class="cx">
</span><del>- virtual MediaSession::MediaType presentationType() const override { return MediaSession::Video; }
</del><ins>+ virtual PlatformMediaSession::MediaType presentationType() const override { return PlatformMediaSession::Video; }
</ins><span class="cx">
</span><span class="cx"> std::unique_ptr<HTMLImageLoader> m_imageLoader;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlMediaElementSessioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/MediaElementSession.cpp (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/MediaElementSession.cpp        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/html/MediaElementSession.cpp        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -78,8 +78,8 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-MediaElementSession::MediaElementSession(MediaSessionClient& client)
- : MediaSession(client)
</del><ins>+MediaElementSession::MediaElementSession(PlatformMediaSessionClient& client)
+ : PlatformMediaSession(client)
</ins><span class="cx"> , m_restrictions(NoRestrictions)
</span><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET)
</span><span class="cx"> , m_targetAvailabilityChangedTimer(*this, &MediaElementSession::targetAvailabilityChangedTimerFired)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlMediaElementSessionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/MediaElementSession.h (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/MediaElementSession.h        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/html/MediaElementSession.h        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx">
</span><span class="cx"> #include "MediaPlayer.h"
</span><del>-#include "MediaSession.h"
</del><ins>+#include "PlatformMediaSession.h"
</ins><span class="cx"> #include "Timer.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -38,10 +38,10 @@
</span><span class="cx"> class HTMLMediaElement;
</span><span class="cx"> class SourceBuffer;
</span><span class="cx">
</span><del>-class MediaElementSession final : public MediaSession {
</del><ins>+class MediaElementSession final : public PlatformMediaSession {
</ins><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>- explicit MediaElementSession(MediaSessionClient&);
</del><ins>+ explicit MediaElementSession(PlatformMediaSessionClient&);
</ins><span class="cx"> virtual ~MediaElementSession() { }
</span><span class="cx">
</span><span class="cx"> void registerWithDocument(const HTMLMediaElement&);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformRemoteCommandListenerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/RemoteCommandListener.h (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/RemoteCommandListener.h        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/platform/RemoteCommandListener.h        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> #ifndef RemoteCommandListener_h
</span><span class="cx"> #define RemoteCommandListener_h
</span><span class="cx">
</span><del>-#include "MediaSession.h"
</del><ins>+#include "PlatformMediaSession.h"
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="cx"> virtual ~RemoteCommandListenerClient() { }
</span><del>- virtual void didReceiveRemoteControlCommand(MediaSession::RemoteControlCommandType) = 0;
</del><ins>+ virtual void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) = 0;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> class RemoteCommandListener {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioMediaSessioncpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/audio/MediaSession.cpp (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/MediaSession.cpp        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/platform/audio/MediaSession.cpp        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -1,245 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014-2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "MediaSession.h"
-
-#if ENABLE(VIDEO)
-#include "HTMLMediaElement.h"
-#include "Logging.h"
-#include "MediaPlayer.h"
-#include "MediaSessionManager.h"
-
-namespace WebCore {
-
-const double kClientDataBufferingTimerThrottleDelay = 0.1;
-
-#if !LOG_DISABLED
-static const char* stateName(MediaSession::State state)
-{
-#define CASE(state) case MediaSession::state: return #state
- switch (state) {
- CASE(Idle);
- CASE(Playing);
- CASE(Paused);
- CASE(Interrupted);
- }
-
- ASSERT_NOT_REACHED();
- return "";
-}
-#endif
-
-std::unique_ptr<MediaSession> MediaSession::create(MediaSessionClient& client)
-{
- return std::make_unique<MediaSession>(client);
-}
-
-MediaSession::MediaSession(MediaSessionClient& client)
- : m_client(client)
- , m_clientDataBufferingTimer(*this, &MediaSession::clientDataBufferingTimerFired)
- , m_state(Idle)
- , m_stateToRestore(Idle)
- , m_notifyingClient(false)
-{
- ASSERT(m_client.mediaType() >= None && m_client.mediaType() <= WebAudio);
- MediaSessionManager::sharedManager().addSession(*this);
-}
-
-MediaSession::~MediaSession()
-{
- MediaSessionManager::sharedManager().removeSession(*this);
-}
-
-void MediaSession::setState(State state)
-{
- LOG(Media, "MediaSession::setState(%p) - %s", this, stateName(state));
- m_state = state;
-}
-
-void MediaSession::beginInterruption(InterruptionType type)
-{
- LOG(Media, "MediaSession::beginInterruption(%p), state = %s, interruption count = %i", this, stateName(m_state), m_interruptionCount);
-
- if (++m_interruptionCount > 1 || (type == EnteringBackground && client().overrideBackgroundPlaybackRestriction()))
- return;
-
- m_stateToRestore = state();
- m_notifyingClient = true;
- setState(Interrupted);
- client().suspendPlayback();
- m_notifyingClient = false;
-}
-
-void MediaSession::endInterruption(EndInterruptionFlags flags)
-{
- LOG(Media, "MediaSession::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);
- return;
- }
-
- if (--m_interruptionCount)
- return;
-
- State stateToRestore = m_stateToRestore;
- m_stateToRestore = Idle;
- setState(Paused);
-
- bool shouldResume = flags & MayResumePlaying && stateToRestore == Playing;
- client().mayResumePlayback(shouldResume);
-}
-
-bool MediaSession::clientWillBeginPlayback()
-{
- if (m_notifyingClient)
- return true;
-
- if (!MediaSessionManager::sharedManager().sessionWillBeginPlayback(*this)) {
- if (state() == Interrupted)
- m_stateToRestore = Playing;
- return false;
- }
-
- setState(Playing);
- updateClientDataBuffering();
- return true;
-}
-
-bool MediaSession::clientWillPausePlayback()
-{
- if (m_notifyingClient)
- return true;
-
- LOG(Media, "MediaSession::clientWillPausePlayback(%p)- state = %s", this, stateName(m_state));
- if (state() == Interrupted) {
- m_stateToRestore = Paused;
- LOG(Media, " setting stateToRestore to \"Paused\"");
- return false;
- }
-
- setState(Paused);
- MediaSessionManager::sharedManager().sessionWillEndPlayback(*this);
- if (!m_clientDataBufferingTimer.isActive())
- m_clientDataBufferingTimer.startOneShot(kClientDataBufferingTimerThrottleDelay);
- return true;
-}
-
-void MediaSession::pauseSession()
-{
- LOG(Media, "MediaSession::pauseSession(%p)", this);
- m_client.suspendPlayback();
-}
-
-MediaSession::MediaType MediaSession::mediaType() const
-{
- return m_client.mediaType();
-}
-
-MediaSession::MediaType MediaSession::presentationType() const
-{
- return m_client.presentationType();
-}
-
-String MediaSession::title() const
-{
- return m_client.mediaSessionTitle();
-}
-
-double MediaSession::duration() const
-{
- return m_client.mediaSessionDuration();
-}
-
-double MediaSession::currentTime() const
-{
- return m_client.mediaSessionCurrentTime();
-}
-
-bool MediaSession::canReceiveRemoteControlCommands() const
-{
- return m_client.canReceiveRemoteControlCommands();
-}
-
-void MediaSession::didReceiveRemoteControlCommand(RemoteControlCommandType command)
-{
- m_client.didReceiveRemoteControlCommand(command);
-}
-
-void MediaSession::visibilityChanged()
-{
- if (!m_clientDataBufferingTimer.isActive())
- m_clientDataBufferingTimer.startOneShot(kClientDataBufferingTimerThrottleDelay);
-}
-
-void MediaSession::clientDataBufferingTimerFired()
-{
- LOG(Media, "MediaSession::clientDataBufferingTimerFired(%p)- visible = %s", this, m_client.elementIsHidden() ? "false" : "true");
-
- updateClientDataBuffering();
-
- if (m_state != Playing || !m_client.elementIsHidden())
- return;
-
- MediaSessionManager::SessionRestrictions restrictions = MediaSessionManager::sharedManager().restrictions(mediaType());
- if ((restrictions & MediaSessionManager::BackgroundTabPlaybackRestricted) == MediaSessionManager::BackgroundTabPlaybackRestricted)
- pauseSession();
-}
-
-void MediaSession::updateClientDataBuffering()
-{
- if (m_clientDataBufferingTimer.isActive())
- m_clientDataBufferingTimer.stop();
-
- m_client.setShouldBufferData(MediaSessionManager::sharedManager().sessionCanLoadMedia(*this));
-}
-
-bool MediaSession::isHidden() const
-{
- return m_client.elementIsHidden();
-}
-
-MediaSession::DisplayType MediaSession::displayType() const
-{
- return m_client.displayType();
-}
-
-String MediaSessionClient::mediaSessionTitle() const
-{
- return String();
-}
-
-double MediaSessionClient::mediaSessionDuration() const
-{
- return MediaPlayer::invalidTime();
-}
-
-double MediaSessionClient::mediaSessionCurrentTime() const
-{
- return MediaPlayer::invalidTime();
-}
-}
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioMediaSessionh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/audio/MediaSession.h (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/MediaSession.h        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/platform/audio/MediaSession.h        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -1,186 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014-2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef MediaSession_h
-#define MediaSession_h
-
-#include "MediaProducer.h"
-#include "Timer.h"
-#include <wtf/Noncopyable.h>
-#include <wtf/text/WTFString.h>
-
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
-#include "MediaPlaybackTargetClient.h"
-#endif
-
-namespace WebCore {
-
-class MediaPlaybackTarget;
-class MediaSessionClient;
-
-class MediaSession
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
- : public MediaPlaybackTargetClient
-#endif
-{
-public:
- static std::unique_ptr<MediaSession> create(MediaSessionClient&);
-
- MediaSession(MediaSessionClient&);
- virtual ~MediaSession();
-
- enum MediaType {
- None = 0,
- Video,
- Audio,
- WebAudio,
- };
- MediaType mediaType() const;
- MediaType presentationType() const;
-
- enum State {
- Idle,
- Playing,
- Paused,
- Interrupted,
- };
- State state() const { return m_state; }
- void setState(State);
-
- enum InterruptionType {
- SystemSleep,
- EnteringBackground,
- SystemInterruption,
- };
- enum EndInterruptionFlags {
- NoFlags = 0,
- MayResumePlaying = 1 << 0,
- };
- void beginInterruption(InterruptionType);
- void endInterruption(EndInterruptionFlags);
-
- void applicationWillEnterForeground() const;
- void applicationWillEnterBackground() const;
-
- bool clientWillBeginPlayback();
- bool clientWillPausePlayback();
-
- void pauseSession();
-
- void visibilityChanged();
-
- String title() const;
- double duration() const;
- double currentTime() const;
-
- enum RemoteControlCommandType {
- NoCommand,
- PlayCommand,
- PauseCommand,
- StopCommand,
- TogglePlayPauseCommand,
- BeginSeekingBackwardCommand,
- EndSeekingBackwardCommand,
- BeginSeekingForwardCommand,
- EndSeekingForwardCommand,
- };
- bool canReceiveRemoteControlCommands() const;
- void didReceiveRemoteControlCommand(RemoteControlCommandType);
-
- enum DisplayType {
- Normal,
- Fullscreen,
- Optimized,
- };
- DisplayType displayType() const;
-
- bool isHidden() const;
-
- virtual bool canPlayToWirelessPlaybackTarget() const { return false; }
- virtual bool isPlayingToWirelessPlaybackTarget() const { return false; }
-
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
- // MediaPlaybackTargetClient
- virtual void setPlaybackTarget(Ref<MediaPlaybackTarget>&&) override { }
- virtual void externalOutputDeviceAvailableDidChange(bool) override { }
- virtual void setShouldPlayToPlaybackTarget(bool) override { }
-#endif
-
-#if PLATFORM(IOS)
- virtual bool requiresPlaybackTargetRouteMonitoring() const { return false; }
-#endif
-
-protected:
- MediaSessionClient& client() const { return m_client; }
-
-private:
- void clientDataBufferingTimerFired();
- void updateClientDataBuffering();
-
- MediaSessionClient& m_client;
- Timer m_clientDataBufferingTimer;
- State m_state;
- State m_stateToRestore;
- int m_interruptionCount { 0 };
- bool m_notifyingClient;
-};
-
-class MediaSessionClient {
- WTF_MAKE_NONCOPYABLE(MediaSessionClient);
-public:
- MediaSessionClient() { }
-
- virtual MediaSession::MediaType mediaType() const = 0;
- virtual MediaSession::MediaType presentationType() const = 0;
- virtual MediaSession::DisplayType displayType() const { return MediaSession::Normal; }
-
- virtual void mayResumePlayback(bool shouldResume) = 0;
- virtual void suspendPlayback() = 0;
-
- virtual String mediaSessionTitle() const;
- virtual double mediaSessionDuration() const;
- virtual double mediaSessionCurrentTime() const;
-
- virtual bool canReceiveRemoteControlCommands() const = 0;
- virtual void didReceiveRemoteControlCommand(MediaSession::RemoteControlCommandType) = 0;
-
- virtual void setShouldBufferData(bool) { }
- virtual bool elementIsHidden() const { return false; }
-
- virtual bool overrideBackgroundPlaybackRestriction() const = 0;
-
- virtual void wirelessRoutesAvailableDidChange() { }
- virtual void setWirelessPlaybackTarget(Ref<MediaPlaybackTarget>&&) { }
- virtual bool canPlayToWirelessPlaybackTarget() const { return false; }
- virtual bool isPlayingToWirelessPlaybackTarget() const { return false; }
- virtual void setShouldPlayToPlaybackTarget(bool) { }
-
-protected:
- virtual ~MediaSessionClient() { }
-};
-
-}
-
-#endif // MediaSession_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioMediaSessionManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/MediaSessionManager.cpp (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/MediaSessionManager.cpp        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/platform/audio/MediaSessionManager.cpp        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> #include "AudioSession.h"
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "NotImplemented.h"
</span><del>-#include "MediaSession.h"
</del><ins>+#include "PlatformMediaSession.h"
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -51,14 +51,14 @@
</span><span class="cx">
</span><span class="cx"> void MediaSessionManager::resetRestrictions()
</span><span class="cx"> {
</span><del>- m_restrictions[MediaSession::Video] = NoRestrictions;
- m_restrictions[MediaSession::Audio] = NoRestrictions;
- m_restrictions[MediaSession::WebAudio] = NoRestrictions;
</del><ins>+ m_restrictions[PlatformMediaSession::Video] = NoRestrictions;
+ m_restrictions[PlatformMediaSession::Audio] = NoRestrictions;
+ m_restrictions[PlatformMediaSession::WebAudio] = NoRestrictions;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-bool MediaSessionManager::has(MediaSession::MediaType type) const
</del><ins>+bool MediaSessionManager::has(PlatformMediaSession::MediaType type) const
</ins><span class="cx"> {
</span><del>- ASSERT(type >= MediaSession::None && type <= MediaSession::WebAudio);
</del><ins>+ ASSERT(type >= PlatformMediaSession::None && type <= PlatformMediaSession::WebAudio);
</ins><span class="cx">
</span><span class="cx"> for (auto* session : m_sessions) {
</span><span class="cx"> if (session->mediaType() == type)
</span><span class="lines">@@ -71,16 +71,16 @@
</span><span class="cx"> bool MediaSessionManager::activeAudioSessionRequired() const
</span><span class="cx"> {
</span><span class="cx"> for (auto* session : m_sessions) {
</span><del>- if (session->mediaType() != MediaSession::None && session->state() == MediaSession::State::Playing)
</del><ins>+ if (session->mediaType() != PlatformMediaSession::None && session->state() == PlatformMediaSession::State::Playing)
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-int MediaSessionManager::count(MediaSession::MediaType type) const
</del><ins>+int MediaSessionManager::count(PlatformMediaSession::MediaType type) const
</ins><span class="cx"> {
</span><del>- ASSERT(type >= MediaSession::None && type <= MediaSession::WebAudio);
</del><ins>+ ASSERT(type >= PlatformMediaSession::None && type <= PlatformMediaSession::WebAudio);
</ins><span class="cx">
</span><span class="cx"> int count = 0;
</span><span class="cx"> for (auto* session : m_sessions) {
</span><span class="lines">@@ -91,34 +91,34 @@
</span><span class="cx"> return count;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaSessionManager::beginInterruption(MediaSession::InterruptionType type)
</del><ins>+void MediaSessionManager::beginInterruption(PlatformMediaSession::InterruptionType type)
</ins><span class="cx"> {
</span><span class="cx"> LOG(Media, "MediaSessionManager::beginInterruption");
</span><span class="cx">
</span><span class="cx"> m_interrupted = true;
</span><del>- Vector<MediaSession*> sessions = m_sessions;
</del><ins>+ Vector<PlatformMediaSession*> sessions = m_sessions;
</ins><span class="cx"> for (auto* session : sessions)
</span><span class="cx"> session->beginInterruption(type);
</span><span class="cx"> updateSessionState();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaSessionManager::endInterruption(MediaSession::EndInterruptionFlags flags)
</del><ins>+void MediaSessionManager::endInterruption(PlatformMediaSession::EndInterruptionFlags flags)
</ins><span class="cx"> {
</span><span class="cx"> LOG(Media, "MediaSessionManager::endInterruption");
</span><span class="cx">
</span><span class="cx"> m_interrupted = false;
</span><del>- Vector<MediaSession*> sessions = m_sessions;
</del><ins>+ Vector<PlatformMediaSession*> sessions = m_sessions;
</ins><span class="cx"> for (auto* session : sessions)
</span><span class="cx"> session->endInterruption(flags);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaSessionManager::addSession(MediaSession& session)
</del><ins>+void MediaSessionManager::addSession(PlatformMediaSession& session)
</ins><span class="cx"> {
</span><span class="cx"> LOG(Media, "MediaSessionManager::addSession - %p", &session);
</span><span class="cx">
</span><span class="cx"> m_sessions.append(&session);
</span><span class="cx"> if (m_interrupted)
</span><del>- session.setState(MediaSession::Interrupted);
</del><ins>+ session.setState(PlatformMediaSession::Interrupted);
</ins><span class="cx">
</span><span class="cx"> if (!m_remoteCommandListener)
</span><span class="cx"> m_remoteCommandListener = RemoteCommandListener::create(*this);
</span><span class="lines">@@ -129,7 +129,7 @@
</span><span class="cx"> updateSessionState();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaSessionManager::removeSession(MediaSession& session)
</del><ins>+void MediaSessionManager::removeSession(PlatformMediaSession& session)
</ins><span class="cx"> {
</span><span class="cx"> LOG(Media, "MediaSessionManager::removeSession - %p", &session);
</span><span class="cx">
</span><span class="lines">@@ -148,33 +148,33 @@
</span><span class="cx"> updateSessionState();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaSessionManager::addRestriction(MediaSession::MediaType type, SessionRestrictions restriction)
</del><ins>+void MediaSessionManager::addRestriction(PlatformMediaSession::MediaType type, SessionRestrictions restriction)
</ins><span class="cx"> {
</span><del>- ASSERT(type > MediaSession::None && type <= MediaSession::WebAudio);
</del><ins>+ ASSERT(type > PlatformMediaSession::None && type <= PlatformMediaSession::WebAudio);
</ins><span class="cx"> m_restrictions[type] |= restriction;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaSessionManager::removeRestriction(MediaSession::MediaType type, SessionRestrictions restriction)
</del><ins>+void MediaSessionManager::removeRestriction(PlatformMediaSession::MediaType type, SessionRestrictions restriction)
</ins><span class="cx"> {
</span><del>- ASSERT(type > MediaSession::None && type <= MediaSession::WebAudio);
</del><ins>+ ASSERT(type > PlatformMediaSession::None && type <= PlatformMediaSession::WebAudio);
</ins><span class="cx"> m_restrictions[type] &= ~restriction;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-MediaSessionManager::SessionRestrictions MediaSessionManager::restrictions(MediaSession::MediaType type)
</del><ins>+MediaSessionManager::SessionRestrictions MediaSessionManager::restrictions(PlatformMediaSession::MediaType type)
</ins><span class="cx"> {
</span><del>- ASSERT(type > MediaSession::None && type <= MediaSession::WebAudio);
</del><ins>+ ASSERT(type > PlatformMediaSession::None && type <= PlatformMediaSession::WebAudio);
</ins><span class="cx"> return m_restrictions[type];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool MediaSessionManager::sessionWillBeginPlayback(MediaSession& session)
</del><ins>+bool MediaSessionManager::sessionWillBeginPlayback(PlatformMediaSession& session)
</ins><span class="cx"> {
</span><span class="cx"> LOG(Media, "MediaSessionManager::sessionWillBeginPlayback - %p", &session);
</span><span class="cx">
</span><span class="cx"> setCurrentSession(session);
</span><span class="cx">
</span><del>- MediaSession::MediaType sessionType = session.mediaType();
</del><ins>+ PlatformMediaSession::MediaType sessionType = session.mediaType();
</ins><span class="cx"> SessionRestrictions restrictions = m_restrictions[sessionType];
</span><del>- if (session.state() == MediaSession::Interrupted && restrictions & InterruptedPlaybackNotPermitted)
</del><ins>+ if (session.state() == PlatformMediaSession::Interrupted && restrictions & InterruptedPlaybackNotPermitted)
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> #if USE(AUDIO_SESSION)
</span><span class="lines">@@ -183,9 +183,9 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> if (m_interrupted)
</span><del>- endInterruption(MediaSession::NoFlags);
</del><ins>+ endInterruption(PlatformMediaSession::NoFlags);
</ins><span class="cx">
</span><del>- Vector<MediaSession*> sessions = m_sessions;
</del><ins>+ Vector<PlatformMediaSession*> sessions = m_sessions;
</ins><span class="cx"> for (auto* oneSession : sessions) {
</span><span class="cx"> if (oneSession == &session)
</span><span class="cx"> continue;
</span><span class="lines">@@ -197,7 +197,7 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaSessionManager::sessionWillEndPlayback(MediaSession& session)
</del><ins>+void MediaSessionManager::sessionWillEndPlayback(PlatformMediaSession& session)
</ins><span class="cx"> {
</span><span class="cx"> LOG(Media, "MediaSessionManager::sessionWillEndPlayback - %p", &session);
</span><span class="cx">
</span><span class="lines">@@ -207,17 +207,17 @@
</span><span class="cx"> size_t pausingSessionIndex = notFound;
</span><span class="cx"> size_t lastPlayingSessionIndex = notFound;
</span><span class="cx"> for (size_t i = 0; i < m_sessions.size(); ++i) {
</span><del>- MediaSession* oneSession = m_sessions[i];
</del><ins>+ PlatformMediaSession* oneSession = m_sessions[i];
</ins><span class="cx">
</span><span class="cx"> if (oneSession == &session) {
</span><span class="cx"> pausingSessionIndex = i;
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><del>- if (oneSession->state() == MediaSession::Playing) {
</del><ins>+ if (oneSession->state() == PlatformMediaSession::Playing) {
</ins><span class="cx"> lastPlayingSessionIndex = i;
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><del>- if (oneSession->state() != MediaSession::Playing)
</del><ins>+ if (oneSession->state() != PlatformMediaSession::Playing)
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> if (lastPlayingSessionIndex == notFound || pausingSessionIndex == notFound)
</span><span class="lines">@@ -232,7 +232,7 @@
</span><span class="cx"> LOG(Media, "MediaSessionManager::sessionWillEndPlayback - session moved from index %zu to %zu", pausingSessionIndex, lastPlayingSessionIndex);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaSessionManager::setCurrentSession(MediaSession& session)
</del><ins>+void MediaSessionManager::setCurrentSession(PlatformMediaSession& session)
</ins><span class="cx"> {
</span><span class="cx"> LOG(Media, "MediaSessionManager::setCurrentSession - %p", &session);
</span><span class="cx">
</span><span class="lines">@@ -250,7 +250,7 @@
</span><span class="cx"> LOG(Media, "MediaSessionManager::setCurrentSession - session moved from index %zu to 0", index);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-MediaSession* MediaSessionManager::currentSession()
</del><ins>+PlatformMediaSession* MediaSessionManager::currentSession()
</ins><span class="cx"> {
</span><span class="cx"> if (!m_sessions.size())
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -258,37 +258,37 @@
</span><span class="cx"> return m_sessions[0];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool MediaSessionManager::sessionRestrictsInlineVideoPlayback(const MediaSession& session) const
</del><ins>+bool MediaSessionManager::sessionRestrictsInlineVideoPlayback(const PlatformMediaSession& session) const
</ins><span class="cx"> {
</span><del>- MediaSession::MediaType sessionType = session.presentationType();
- if (sessionType != MediaSession::Video)
</del><ins>+ PlatformMediaSession::MediaType sessionType = session.presentationType();
+ if (sessionType != PlatformMediaSession::Video)
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> return m_restrictions[sessionType] & InlineVideoPlaybackRestricted;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool MediaSessionManager::sessionCanLoadMedia(const MediaSession& session) const
</del><ins>+bool MediaSessionManager::sessionCanLoadMedia(const PlatformMediaSession& session) const
</ins><span class="cx"> {
</span><del>- return session.state() == MediaSession::Playing || !session.isHidden() || session.isPlayingToWirelessPlaybackTarget();
</del><ins>+ return session.state() == PlatformMediaSession::Playing || !session.isHidden() || session.isPlayingToWirelessPlaybackTarget();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MediaSessionManager::applicationWillEnterBackground() const
</span><span class="cx"> {
</span><span class="cx"> LOG(Media, "MediaSessionManager::applicationWillEnterBackground");
</span><del>- Vector<MediaSession*> sessions = m_sessions;
</del><ins>+ Vector<PlatformMediaSession*> sessions = m_sessions;
</ins><span class="cx"> for (auto* session : sessions) {
</span><span class="cx"> if (m_restrictions[session->mediaType()] & BackgroundProcessPlaybackRestricted)
</span><del>- session->beginInterruption(MediaSession::EnteringBackground);
</del><ins>+ session->beginInterruption(PlatformMediaSession::EnteringBackground);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MediaSessionManager::applicationWillEnterForeground() const
</span><span class="cx"> {
</span><span class="cx"> LOG(Media, "MediaSessionManager::applicationWillEnterForeground");
</span><del>- Vector<MediaSession*> sessions = m_sessions;
</del><ins>+ Vector<PlatformMediaSession*> sessions = m_sessions;
</ins><span class="cx"> for (auto* session : sessions) {
</span><span class="cx"> if (m_restrictions[session->mediaType()] & BackgroundProcessPlaybackRestricted)
</span><del>- session->endInterruption(MediaSession::MayResumePlaying);
</del><ins>+ session->endInterruption(PlatformMediaSession::MayResumePlaying);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -298,9 +298,9 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-void MediaSessionManager::didReceiveRemoteControlCommand(MediaSession::RemoteControlCommandType command)
</del><ins>+void MediaSessionManager::didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType command)
</ins><span class="cx"> {
</span><del>- MediaSession* activeSession = currentSession();
</del><ins>+ PlatformMediaSession* activeSession = currentSession();
</ins><span class="cx"> if (!activeSession || !activeSession->canReceiveRemoteControlCommands())
</span><span class="cx"> return;
</span><span class="cx"> activeSession->didReceiveRemoteControlCommand(command);
</span><span class="lines">@@ -312,7 +312,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> for (auto session : m_sessions)
</span><del>- session->beginInterruption(MediaSession::SystemSleep);
</del><ins>+ session->beginInterruption(PlatformMediaSession::SystemSleep);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MediaSessionManager::systemDidWake()
</span><span class="lines">@@ -321,7 +321,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> for (auto session : m_sessions)
</span><del>- session->endInterruption(MediaSession::MayResumePlaying);
</del><ins>+ session->endInterruption(PlatformMediaSession::MayResumePlaying);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MediaSessionManager::audioOutputDeviceChanged()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioMediaSessionManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/MediaSessionManager.h (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/MediaSessionManager.h        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/platform/audio/MediaSessionManager.h        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx"> #define MediaSessionManager_h
</span><span class="cx">
</span><span class="cx"> #include "AudioHardwareListener.h"
</span><del>-#include "MediaSession.h"
</del><ins>+#include "PlatformMediaSession.h"
</ins><span class="cx"> #include "RemoteCommandListener.h"
</span><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include "SystemSleepListener.h"
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class HTMLMediaElement;
</span><del>-class MediaSession;
</del><ins>+class PlatformMediaSession;
</ins><span class="cx"> class RemoteCommandListener;
</span><span class="cx">
</span><span class="cx"> class MediaSessionManager : private RemoteCommandListenerClient, private SystemSleepListener::Client, private AudioHardwareListener::Client {
</span><span class="lines">@@ -46,12 +46,12 @@
</span><span class="cx"> WEBCORE_EXPORT static MediaSessionManager& sharedManager();
</span><span class="cx"> virtual ~MediaSessionManager() { }
</span><span class="cx">
</span><del>- bool has(MediaSession::MediaType) const;
- int count(MediaSession::MediaType) const;
</del><ins>+ bool has(PlatformMediaSession::MediaType) const;
+ int count(PlatformMediaSession::MediaType) const;
</ins><span class="cx"> bool activeAudioSessionRequired() const;
</span><span class="cx">
</span><del>- WEBCORE_EXPORT void beginInterruption(MediaSession::InterruptionType);
- WEBCORE_EXPORT void endInterruption(MediaSession::EndInterruptionFlags);
</del><ins>+ WEBCORE_EXPORT void beginInterruption(PlatformMediaSession::InterruptionType);
+ WEBCORE_EXPORT void endInterruption(PlatformMediaSession::EndInterruptionFlags);
</ins><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT void applicationWillEnterForeground() const;
</span><span class="cx"> WEBCORE_EXPORT void applicationWillEnterBackground() const;
</span><span class="lines">@@ -68,34 +68,34 @@
</span><span class="cx"> };
</span><span class="cx"> typedef unsigned SessionRestrictions;
</span><span class="cx">
</span><del>- WEBCORE_EXPORT void addRestriction(MediaSession::MediaType, SessionRestrictions);
- WEBCORE_EXPORT void removeRestriction(MediaSession::MediaType, SessionRestrictions);
- WEBCORE_EXPORT SessionRestrictions restrictions(MediaSession::MediaType);
</del><ins>+ WEBCORE_EXPORT void addRestriction(PlatformMediaSession::MediaType, SessionRestrictions);
+ WEBCORE_EXPORT void removeRestriction(PlatformMediaSession::MediaType, SessionRestrictions);
+ WEBCORE_EXPORT SessionRestrictions restrictions(PlatformMediaSession::MediaType);
</ins><span class="cx"> virtual void resetRestrictions();
</span><span class="cx">
</span><del>- virtual bool sessionWillBeginPlayback(MediaSession&);
- virtual void sessionWillEndPlayback(MediaSession&);
</del><ins>+ virtual bool sessionWillBeginPlayback(PlatformMediaSession&);
+ virtual void sessionWillEndPlayback(PlatformMediaSession&);
</ins><span class="cx">
</span><del>- bool sessionRestrictsInlineVideoPlayback(const MediaSession&) const;
</del><ins>+ bool sessionRestrictsInlineVideoPlayback(const PlatformMediaSession&) const;
</ins><span class="cx">
</span><del>- virtual bool sessionCanLoadMedia(const MediaSession&) const;
</del><ins>+ virtual bool sessionCanLoadMedia(const PlatformMediaSession&) const;
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> virtual void configureWireLessTargetMonitoring() { }
</span><span class="cx"> virtual bool hasWirelessTargetsAvailable() { return false; }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- void setCurrentSession(MediaSession&);
- MediaSession* currentSession();
</del><ins>+ void setCurrentSession(PlatformMediaSession&);
+ PlatformMediaSession* currentSession();
</ins><span class="cx">
</span><span class="cx"> protected:
</span><del>- friend class MediaSession;
</del><ins>+ friend class PlatformMediaSession;
</ins><span class="cx"> explicit MediaSessionManager();
</span><span class="cx">
</span><del>- void addSession(MediaSession&);
- void removeSession(MediaSession&);
</del><ins>+ void addSession(PlatformMediaSession&);
+ void removeSession(PlatformMediaSession&);
</ins><span class="cx">
</span><del>- Vector<MediaSession*> sessions() { return m_sessions; }
</del><ins>+ Vector<PlatformMediaSession*> sessions() { return m_sessions; }
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> friend class Internals;
</span><span class="lines">@@ -103,7 +103,7 @@
</span><span class="cx"> void updateSessionState();
</span><span class="cx">
</span><span class="cx"> // RemoteCommandListenerClient
</span><del>- WEBCORE_EXPORT virtual void didReceiveRemoteControlCommand(MediaSession::RemoteControlCommandType) override;
</del><ins>+ WEBCORE_EXPORT virtual void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) override;
</ins><span class="cx">
</span><span class="cx"> // AudioHardwareListenerClient
</span><span class="cx"> virtual void audioHardwareDidBecomeActive() override { }
</span><span class="lines">@@ -114,8 +114,8 @@
</span><span class="cx"> virtual void systemWillSleep() override;
</span><span class="cx"> virtual void systemDidWake() override;
</span><span class="cx">
</span><del>- SessionRestrictions m_restrictions[MediaSession::WebAudio + 1];
- Vector<MediaSession*> m_sessions;
</del><ins>+ SessionRestrictions m_restrictions[PlatformMediaSession::WebAudio + 1];
+ Vector<PlatformMediaSession*> m_sessions;
</ins><span class="cx"> std::unique_ptr<RemoteCommandListener> m_remoteCommandListener;
</span><span class="cx"> std::unique_ptr<SystemSleepListener> m_systemSleepListener;
</span><span class="cx"> RefPtr<AudioHardwareListener> m_audioHardwareListener;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioPlatformMediaSessioncppfromrev185005trunkSourceWebCoreplatformaudioMediaSessioncpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/audio/PlatformMediaSession.cpp (from rev 185005, trunk/Source/WebCore/platform/audio/MediaSession.cpp) (0 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/PlatformMediaSession.cpp         (rev 0)
+++ trunk/Source/WebCore/platform/audio/PlatformMediaSession.cpp        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -0,0 +1,245 @@
</span><ins>+/*
+ * Copyright (C) 2014-2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PlatformMediaSession.h"
+
+#if ENABLE(VIDEO)
+#include "HTMLMediaElement.h"
+#include "Logging.h"
+#include "MediaPlayer.h"
+#include "MediaSessionManager.h"
+
+namespace WebCore {
+
+const double kClientDataBufferingTimerThrottleDelay = 0.1;
+
+#if !LOG_DISABLED
+static const char* stateName(PlatformMediaSession::State state)
+{
+#define CASE(state) case PlatformMediaSession::state: return #state
+ switch (state) {
+ CASE(Idle);
+ CASE(Playing);
+ CASE(Paused);
+ CASE(Interrupted);
+ }
+
+ ASSERT_NOT_REACHED();
+ return "";
+}
+#endif
+
+std::unique_ptr<PlatformMediaSession> PlatformMediaSession::create(PlatformMediaSessionClient& client)
+{
+ return std::make_unique<PlatformMediaSession>(client);
+}
+
+PlatformMediaSession::PlatformMediaSession(PlatformMediaSessionClient& client)
+ : m_client(client)
+ , m_clientDataBufferingTimer(*this, &PlatformMediaSession::clientDataBufferingTimerFired)
+ , m_state(Idle)
+ , m_stateToRestore(Idle)
+ , m_notifyingClient(false)
+{
+ ASSERT(m_client.mediaType() >= None && m_client.mediaType() <= WebAudio);
+ MediaSessionManager::sharedManager().addSession(*this);
+}
+
+PlatformMediaSession::~PlatformMediaSession()
+{
+ MediaSessionManager::sharedManager().removeSession(*this);
+}
+
+void PlatformMediaSession::setState(State state)
+{
+ LOG(Media, "PlatformMediaSession::setState(%p) - %s", this, stateName(state));
+ m_state = state;
+}
+
+void PlatformMediaSession::beginInterruption(InterruptionType type)
+{
+ 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;
+
+ m_stateToRestore = state();
+ m_notifyingClient = true;
+ setState(Interrupted);
+ client().suspendPlayback();
+ m_notifyingClient = false;
+}
+
+void PlatformMediaSession::endInterruption(EndInterruptionFlags flags)
+{
+ 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, "PlatformMediaSession::endInterruption(%p) - !! ignoring spurious interruption end !!", this);
+ return;
+ }
+
+ if (--m_interruptionCount)
+ return;
+
+ State stateToRestore = m_stateToRestore;
+ m_stateToRestore = Idle;
+ setState(Paused);
+
+ bool shouldResume = flags & MayResumePlaying && stateToRestore == Playing;
+ client().mayResumePlayback(shouldResume);
+}
+
+bool PlatformMediaSession::clientWillBeginPlayback()
+{
+ if (m_notifyingClient)
+ return true;
+
+ if (!MediaSessionManager::sharedManager().sessionWillBeginPlayback(*this)) {
+ if (state() == Interrupted)
+ m_stateToRestore = Playing;
+ return false;
+ }
+
+ setState(Playing);
+ updateClientDataBuffering();
+ return true;
+}
+
+bool PlatformMediaSession::clientWillPausePlayback()
+{
+ if (m_notifyingClient)
+ return true;
+
+ LOG(Media, "PlatformMediaSession::clientWillPausePlayback(%p)- state = %s", this, stateName(m_state));
+ if (state() == Interrupted) {
+ m_stateToRestore = Paused;
+ LOG(Media, " setting stateToRestore to \"Paused\"");
+ return false;
+ }
+
+ setState(Paused);
+ MediaSessionManager::sharedManager().sessionWillEndPlayback(*this);
+ if (!m_clientDataBufferingTimer.isActive())
+ m_clientDataBufferingTimer.startOneShot(kClientDataBufferingTimerThrottleDelay);
+ return true;
+}
+
+void PlatformMediaSession::pauseSession()
+{
+ LOG(Media, "PlatformMediaSession::pauseSession(%p)", this);
+ m_client.suspendPlayback();
+}
+
+PlatformMediaSession::MediaType PlatformMediaSession::mediaType() const
+{
+ return m_client.mediaType();
+}
+
+PlatformMediaSession::MediaType PlatformMediaSession::presentationType() const
+{
+ return m_client.presentationType();
+}
+
+String PlatformMediaSession::title() const
+{
+ return m_client.mediaSessionTitle();
+}
+
+double PlatformMediaSession::duration() const
+{
+ return m_client.mediaSessionDuration();
+}
+
+double PlatformMediaSession::currentTime() const
+{
+ return m_client.mediaSessionCurrentTime();
+}
+
+bool PlatformMediaSession::canReceiveRemoteControlCommands() const
+{
+ return m_client.canReceiveRemoteControlCommands();
+}
+
+void PlatformMediaSession::didReceiveRemoteControlCommand(RemoteControlCommandType command)
+{
+ m_client.didReceiveRemoteControlCommand(command);
+}
+
+void PlatformMediaSession::visibilityChanged()
+{
+ if (!m_clientDataBufferingTimer.isActive())
+ m_clientDataBufferingTimer.startOneShot(kClientDataBufferingTimerThrottleDelay);
+}
+
+void PlatformMediaSession::clientDataBufferingTimerFired()
+{
+ LOG(Media, "PlatformMediaSession::clientDataBufferingTimerFired(%p)- visible = %s", this, m_client.elementIsHidden() ? "false" : "true");
+
+ updateClientDataBuffering();
+
+ if (m_state != Playing || !m_client.elementIsHidden())
+ return;
+
+ MediaSessionManager::SessionRestrictions restrictions = MediaSessionManager::sharedManager().restrictions(mediaType());
+ if ((restrictions & MediaSessionManager::BackgroundTabPlaybackRestricted) == MediaSessionManager::BackgroundTabPlaybackRestricted)
+ pauseSession();
+}
+
+void PlatformMediaSession::updateClientDataBuffering()
+{
+ if (m_clientDataBufferingTimer.isActive())
+ m_clientDataBufferingTimer.stop();
+
+ m_client.setShouldBufferData(MediaSessionManager::sharedManager().sessionCanLoadMedia(*this));
+}
+
+bool PlatformMediaSession::isHidden() const
+{
+ return m_client.elementIsHidden();
+}
+
+PlatformMediaSession::DisplayType PlatformMediaSession::displayType() const
+{
+ return m_client.displayType();
+}
+
+String PlatformMediaSessionClient::mediaSessionTitle() const
+{
+ return String();
+}
+
+double PlatformMediaSessionClient::mediaSessionDuration() const
+{
+ return MediaPlayer::invalidTime();
+}
+
+double PlatformMediaSessionClient::mediaSessionCurrentTime() const
+{
+ return MediaPlayer::invalidTime();
+}
+}
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioPlatformMediaSessionhfromrev185005trunkSourceWebCoreplatformaudioMediaSessionh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/audio/PlatformMediaSession.h (from rev 185005, trunk/Source/WebCore/platform/audio/MediaSession.h) (0 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/PlatformMediaSession.h         (rev 0)
+++ trunk/Source/WebCore/platform/audio/PlatformMediaSession.h        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -0,0 +1,186 @@
</span><ins>+/*
+ * Copyright (C) 2014-2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PlatformMediaSession_h
+#define PlatformMediaSession_h
+
+#include "MediaProducer.h"
+#include "Timer.h"
+#include <wtf/Noncopyable.h>
+#include <wtf/text/WTFString.h>
+
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+#include "MediaPlaybackTargetClient.h"
+#endif
+
+namespace WebCore {
+
+class MediaPlaybackTarget;
+class PlatformMediaSessionClient;
+
+class PlatformMediaSession
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+ : public MediaPlaybackTargetClient
+#endif
+{
+public:
+ static std::unique_ptr<PlatformMediaSession> create(PlatformMediaSessionClient&);
+
+ PlatformMediaSession(PlatformMediaSessionClient&);
+ virtual ~PlatformMediaSession();
+
+ enum MediaType {
+ None = 0,
+ Video,
+ Audio,
+ WebAudio,
+ };
+ MediaType mediaType() const;
+ MediaType presentationType() const;
+
+ enum State {
+ Idle,
+ Playing,
+ Paused,
+ Interrupted,
+ };
+ State state() const { return m_state; }
+ void setState(State);
+
+ enum InterruptionType {
+ SystemSleep,
+ EnteringBackground,
+ SystemInterruption,
+ };
+ enum EndInterruptionFlags {
+ NoFlags = 0,
+ MayResumePlaying = 1 << 0,
+ };
+ void beginInterruption(InterruptionType);
+ void endInterruption(EndInterruptionFlags);
+
+ void applicationWillEnterForeground() const;
+ void applicationWillEnterBackground() const;
+
+ bool clientWillBeginPlayback();
+ bool clientWillPausePlayback();
+
+ void pauseSession();
+
+ void visibilityChanged();
+
+ String title() const;
+ double duration() const;
+ double currentTime() const;
+
+ enum RemoteControlCommandType {
+ NoCommand,
+ PlayCommand,
+ PauseCommand,
+ StopCommand,
+ TogglePlayPauseCommand,
+ BeginSeekingBackwardCommand,
+ EndSeekingBackwardCommand,
+ BeginSeekingForwardCommand,
+ EndSeekingForwardCommand,
+ };
+ bool canReceiveRemoteControlCommands() const;
+ void didReceiveRemoteControlCommand(RemoteControlCommandType);
+
+ enum DisplayType {
+ Normal,
+ Fullscreen,
+ Optimized,
+ };
+ DisplayType displayType() const;
+
+ bool isHidden() const;
+
+ virtual bool canPlayToWirelessPlaybackTarget() const { return false; }
+ virtual bool isPlayingToWirelessPlaybackTarget() const { return false; }
+
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+ // MediaPlaybackTargetClient
+ virtual void setPlaybackTarget(Ref<MediaPlaybackTarget>&&) override { }
+ virtual void externalOutputDeviceAvailableDidChange(bool) override { }
+ virtual void setShouldPlayToPlaybackTarget(bool) override { }
+#endif
+
+#if PLATFORM(IOS)
+ virtual bool requiresPlaybackTargetRouteMonitoring() const { return false; }
+#endif
+
+protected:
+ PlatformMediaSessionClient& client() const { return m_client; }
+
+private:
+ void clientDataBufferingTimerFired();
+ void updateClientDataBuffering();
+
+ PlatformMediaSessionClient& m_client;
+ Timer m_clientDataBufferingTimer;
+ State m_state;
+ State m_stateToRestore;
+ int m_interruptionCount { 0 };
+ bool m_notifyingClient;
+};
+
+class PlatformMediaSessionClient {
+ WTF_MAKE_NONCOPYABLE(PlatformMediaSessionClient);
+public:
+ PlatformMediaSessionClient() { }
+
+ 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;
+
+ virtual String mediaSessionTitle() const;
+ virtual double mediaSessionDuration() const;
+ virtual double mediaSessionCurrentTime() const;
+
+ virtual bool canReceiveRemoteControlCommands() const = 0;
+ virtual void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) = 0;
+
+ virtual void setShouldBufferData(bool) { }
+ virtual bool elementIsHidden() const { return false; }
+
+ virtual bool overrideBackgroundPlaybackRestriction() const = 0;
+
+ virtual void wirelessRoutesAvailableDidChange() { }
+ virtual void setWirelessPlaybackTarget(Ref<MediaPlaybackTarget>&&) { }
+ virtual bool canPlayToWirelessPlaybackTarget() const { return false; }
+ virtual bool isPlayingToWirelessPlaybackTarget() const { return false; }
+ virtual void setShouldPlayToPlaybackTarget(bool) { }
+
+protected:
+ virtual ~PlatformMediaSessionClient() { }
+};
+
+}
+
+#endif // PlatformMediaSession_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioiosMediaSessionManagerIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -53,8 +53,8 @@
</span><span class="cx">
</span><span class="cx"> MediaSessionManageriOS();
</span><span class="cx">
</span><del>- virtual bool sessionWillBeginPlayback(MediaSession&) override;
- virtual void sessionWillEndPlayback(MediaSession&) override;
</del><ins>+ virtual bool sessionWillBeginPlayback(PlatformMediaSession&) override;
+ virtual void sessionWillEndPlayback(PlatformMediaSession&) override;
</ins><span class="cx">
</span><span class="cx"> void updateNowPlayingInfo();
</span><span class="cx">
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">
</span><span class="cx"> virtual void configureWireLessTargetMonitoring() override;
</span><span class="cx">
</span><del>- virtual bool sessionCanLoadMedia(const MediaSession&) const override;
</del><ins>+ virtual bool sessionCanLoadMedia(const PlatformMediaSession&) const override;
</ins><span class="cx">
</span><span class="cx"> RetainPtr<WebMediaSessionHelper> m_objcObserver;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioiosMediaSessionManagerIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> #import "Logging.h"
</span><span class="cx"> #import "MediaPlayer.h"
</span><span class="cx"> #import "MediaPlayerSPI.h"
</span><del>-#import "MediaSession.h"
</del><ins>+#import "PlatformMediaSession.h"
</ins><span class="cx"> #import "SoftLinking.h"
</span><span class="cx"> #import "SystemMemory.h"
</span><span class="cx"> #import "WebCoreSystemInterface.h"
</span><span class="lines">@@ -138,27 +138,27 @@
</span><span class="cx">
</span><span class="cx"> static wkDeviceClass deviceClass = iosDeviceClass();
</span><span class="cx"> if (deviceClass == wkDeviceClassiPhone || deviceClass == wkDeviceClassiPod)
</span><del>- addRestriction(MediaSession::Video, InlineVideoPlaybackRestricted);
</del><ins>+ addRestriction(PlatformMediaSession::Video, InlineVideoPlaybackRestricted);
</ins><span class="cx">
</span><span class="cx"> if (ramSize() < systemMemoryRequiredForVideoInBackgroundTabs) {
</span><span class="cx"> LOG(Media, "MediaSessionManageriOS::resetRestrictions - restricting video in background tabs because system memory = %zul", ramSize());
</span><del>- addRestriction(MediaSession::Video, BackgroundTabPlaybackRestricted);
</del><ins>+ addRestriction(PlatformMediaSession::Video, BackgroundTabPlaybackRestricted);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- addRestriction(MediaSession::Video, ConcurrentPlaybackNotPermitted);
- addRestriction(MediaSession::Video, BackgroundProcessPlaybackRestricted);
</del><ins>+ addRestriction(PlatformMediaSession::Video, ConcurrentPlaybackNotPermitted);
+ addRestriction(PlatformMediaSession::Video, BackgroundProcessPlaybackRestricted);
</ins><span class="cx">
</span><del>- removeRestriction(MediaSession::Audio, ConcurrentPlaybackNotPermitted);
- removeRestriction(MediaSession::Audio, BackgroundProcessPlaybackRestricted);
</del><ins>+ removeRestriction(PlatformMediaSession::Audio, ConcurrentPlaybackNotPermitted);
+ removeRestriction(PlatformMediaSession::Audio, BackgroundProcessPlaybackRestricted);
</ins><span class="cx">
</span><del>- removeRestriction(MediaSession::WebAudio, ConcurrentPlaybackNotPermitted);
- removeRestriction(MediaSession::WebAudio, BackgroundProcessPlaybackRestricted);
</del><ins>+ removeRestriction(PlatformMediaSession::WebAudio, ConcurrentPlaybackNotPermitted);
+ removeRestriction(PlatformMediaSession::WebAudio, BackgroundProcessPlaybackRestricted);
</ins><span class="cx">
</span><del>- removeRestriction(MediaSession::Audio, MetadataPreloadingNotPermitted);
- removeRestriction(MediaSession::Video, MetadataPreloadingNotPermitted);
</del><ins>+ removeRestriction(PlatformMediaSession::Audio, MetadataPreloadingNotPermitted);
+ removeRestriction(PlatformMediaSession::Video, MetadataPreloadingNotPermitted);
</ins><span class="cx">
</span><del>- addRestriction(MediaSession::Audio, AutoPreloadingNotPermitted);
- addRestriction(MediaSession::Video, AutoPreloadingNotPermitted);
</del><ins>+ addRestriction(PlatformMediaSession::Audio, AutoPreloadingNotPermitted);
+ addRestriction(PlatformMediaSession::Video, AutoPreloadingNotPermitted);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool MediaSessionManageriOS::hasWirelessTargetsAvailable()
</span><span class="lines">@@ -168,7 +168,7 @@
</span><span class="cx">
</span><span class="cx"> void MediaSessionManageriOS::configureWireLessTargetMonitoring()
</span><span class="cx"> {
</span><del>- Vector<MediaSession*> sessions = this->sessions();
</del><ins>+ Vector<PlatformMediaSession*> sessions = this->sessions();
</ins><span class="cx"> bool requiresMonitoring = false;
</span><span class="cx">
</span><span class="cx"> for (auto* session : sessions) {
</span><span class="lines">@@ -186,7 +186,7 @@
</span><span class="cx"> [m_objcObserver stopMonitoringAirPlayRoutes];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool MediaSessionManageriOS::sessionWillBeginPlayback(MediaSession& session)
</del><ins>+bool MediaSessionManageriOS::sessionWillBeginPlayback(PlatformMediaSession& session)
</ins><span class="cx"> {
</span><span class="cx"> if (!MediaSessionManager::sessionWillBeginPlayback(session))
</span><span class="cx"> return false;
</span><span class="lines">@@ -195,7 +195,7 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaSessionManageriOS::sessionWillEndPlayback(MediaSession& session)
</del><ins>+void MediaSessionManageriOS::sessionWillEndPlayback(PlatformMediaSession& session)
</ins><span class="cx"> {
</span><span class="cx"> MediaSessionManager::sessionWillEndPlayback(session);
</span><span class="cx"> updateNowPlayingInfo();
</span><span class="lines">@@ -206,7 +206,7 @@
</span><span class="cx"> LOG(Media, "MediaSessionManageriOS::updateNowPlayingInfo");
</span><span class="cx">
</span><span class="cx"> MPNowPlayingInfoCenter *nowPlaying = (MPNowPlayingInfoCenter *)[getMPNowPlayingInfoCenterClass() defaultCenter];
</span><del>- const MediaSession* currentSession = this->currentSession();
</del><ins>+ const PlatformMediaSession* currentSession = this->currentSession();
</ins><span class="cx">
</span><span class="cx"> if (!currentSession) {
</span><span class="cx"> [nowPlaying setNowPlayingInfo:nil];
</span><span class="lines">@@ -227,18 +227,18 @@
</span><span class="cx"> if (std::isfinite(currentTime) && currentTime != MediaPlayer::invalidTime())
</span><span class="cx"> [info setValue:@(currentTime) forKey:MPNowPlayingInfoPropertyElapsedPlaybackTime];
</span><span class="cx">
</span><del>- [info setValue:(currentSession->state() == MediaSession::Playing ? @YES : @NO) forKey:MPNowPlayingInfoPropertyPlaybackRate];
</del><ins>+ [info setValue:(currentSession->state() == PlatformMediaSession::Playing ? @YES : @NO) forKey:MPNowPlayingInfoPropertyPlaybackRate];
</ins><span class="cx"> [nowPlaying setNowPlayingInfo:info.get()];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool MediaSessionManageriOS::sessionCanLoadMedia(const MediaSession& session) const
</del><ins>+bool MediaSessionManageriOS::sessionCanLoadMedia(const PlatformMediaSession& session) const
</ins><span class="cx"> {
</span><del>- return session.state() == MediaSession::Playing || !session.isHidden() || session.displayType() == MediaSession::Optimized;
</del><ins>+ return session.state() == PlatformMediaSession::Playing || !session.isHidden() || session.displayType() == PlatformMediaSession::Optimized;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MediaSessionManageriOS::externalOutputDeviceAvailableDidChange()
</span><span class="cx"> {
</span><del>- Vector<MediaSession*> sessionList = sessions();
</del><ins>+ Vector<PlatformMediaSession*> sessionList = sessions();
</ins><span class="cx"> bool haveTargets = [m_objcObserver hasWirelessTargetsAvailable];
</span><span class="cx"> for (auto* session : sessionList)
</span><span class="cx"> session->externalOutputDeviceAvailableDidChange(haveTargets);
</span><span class="lines">@@ -383,19 +383,19 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> NSUInteger type = [[[notification userInfo] objectForKey:AVAudioSessionInterruptionTypeKey] unsignedIntegerValue];
</span><del>- MediaSession::EndInterruptionFlags flags = MediaSession::NoFlags;
</del><ins>+ PlatformMediaSession::EndInterruptionFlags flags = PlatformMediaSession::NoFlags;
</ins><span class="cx">
</span><span class="cx"> LOG(Media, "-[WebMediaSessionHelper interruption] - type = %i", (int)type);
</span><span class="cx">
</span><span class="cx"> if (type == AVAudioSessionInterruptionTypeEnded && [[[notification userInfo] objectForKey:AVAudioSessionInterruptionOptionKey] unsignedIntegerValue] == AVAudioSessionInterruptionOptionShouldResume)
</span><del>- flags = MediaSession::MayResumePlaying;
</del><ins>+ flags = PlatformMediaSession::MayResumePlaying;
</ins><span class="cx">
</span><span class="cx"> WebThreadRun(^{
</span><span class="cx"> if (!_callback)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if (type == AVAudioSessionInterruptionTypeBegan)
</span><del>- _callback->beginInterruption(MediaSession::SystemInterruption);
</del><ins>+ _callback->beginInterruption(PlatformMediaSession::SystemInterruption);
</ins><span class="cx"> else
</span><span class="cx"> _callback->endInterruption(flags);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudiomacMediaSessionManagerMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -39,11 +39,11 @@
</span><span class="cx">
</span><span class="cx"> void MediaSessionManager::updateSessionState()
</span><span class="cx"> {
</span><del>- LOG(Media, "MediaSessionManager::updateSessionState() - types: Video(%d), Audio(%d), WebAudio(%d)", count(MediaSession::Video), count(MediaSession::Audio), count(MediaSession::WebAudio));
</del><ins>+ LOG(Media, "MediaSessionManager::updateSessionState() - types: Video(%d), Audio(%d), WebAudio(%d)", count(PlatformMediaSession::Video), count(PlatformMediaSession::Audio), count(PlatformMediaSession::WebAudio));
</ins><span class="cx">
</span><del>- if (has(MediaSession::WebAudio))
</del><ins>+ if (has(PlatformMediaSession::WebAudio))
</ins><span class="cx"> AudioSession::sharedSession().setPreferredBufferSize(kWebAudioBufferSize);
</span><del>- else if ((has(MediaSession::Video) || has(MediaSession::Audio)) && Settings::lowPowerVideoAudioBufferSizeEnabled()) {
</del><ins>+ else if ((has(PlatformMediaSession::Video) || has(PlatformMediaSession::Audio)) && Settings::lowPowerVideoAudioBufferSizeEnabled()) {
</ins><span class="cx"> // FIXME: <http://webkit.org/b/116725> Figure out why enabling the code below
</span><span class="cx"> // causes media LayoutTests to fail on 10.8.
</span><span class="cx">
</span><span class="lines">@@ -60,9 +60,9 @@
</span><span class="cx"> if (!Settings::shouldManageAudioSessionCategory())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- if (has(MediaSession::Video) || has(MediaSession::Audio))
</del><ins>+ if (has(PlatformMediaSession::Video) || has(PlatformMediaSession::Audio))
</ins><span class="cx"> AudioSession::sharedSession().setCategory(AudioSession::MediaPlayback);
</span><del>- else if (has(MediaSession::WebAudio))
</del><ins>+ else if (has(PlatformMediaSession::WebAudio))
</ins><span class="cx"> AudioSession::sharedSession().setCategory(AudioSession::AmbientSound);
</span><span class="cx"> #endif
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -1347,7 +1347,7 @@
</span><span class="cx"> return m_client.mediaPlayerShouldWaitForResponseToAuthenticationChallenge(challenge);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaPlayer::handlePlaybackCommand(MediaSession::RemoteControlCommandType command)
</del><ins>+void MediaPlayer::handlePlaybackCommand(PlatformMediaSession::RemoteControlCommandType command)
</ins><span class="cx"> {
</span><span class="cx"> m_client.mediaPlayerHandlePlaybackCommand(command);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -36,10 +36,10 @@
</span><span class="cx"> #include "URL.h"
</span><span class="cx"> #include "LayoutRect.h"
</span><span class="cx"> #include "MediaPlayerEnums.h"
</span><del>-#include "MediaSession.h"
</del><span class="cx"> #include "NativeImagePtr.h"
</span><span class="cx"> #include "PlatformLayer.h"
</span><span class="cx"> #include "PlatformMediaResourceLoader.h"
</span><ins>+#include "PlatformMediaSession.h"
</ins><span class="cx"> #include "Timer.h"
</span><span class="cx"> #include "VideoTrackPrivate.h"
</span><span class="cx"> #include <runtime/Uint8Array.h>
</span><span class="lines">@@ -268,7 +268,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> virtual bool mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&) { return false; }
</span><del>- virtual void mediaPlayerHandlePlaybackCommand(MediaSession::RemoteControlCommandType) { }
</del><ins>+ virtual void mediaPlayerHandlePlaybackCommand(PlatformMediaSession::RemoteControlCommandType) { }
</ins><span class="cx">
</span><span class="cx"> virtual String mediaPlayerSourceApplicationIdentifier() const { return emptyString(); }
</span><span class="cx">
</span><span class="lines">@@ -594,7 +594,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> bool shouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&);
</span><del>- void handlePlaybackCommand(MediaSession::RemoteControlCommandType);
</del><ins>+ void handlePlaybackCommand(PlatformMediaSession::RemoteControlCommandType);
</ins><span class="cx"> String sourceApplicationIdentifier() const;
</span><span class="cx"> Vector<String> preferredAudioCharacteristics() const;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -621,7 +621,7 @@
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET) && PLATFORM(IOS)
</span><span class="cx"> if (isCurrentPlaybackTargetWireless())
</span><del>- m_player->handlePlaybackCommand(rate() ? MediaSession::PlayCommand : MediaSession::PauseCommand);
</del><ins>+ m_player->handlePlaybackCommand(rate() ? PlatformMediaSession::PlayCommand : PlatformMediaSession::PauseCommand);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> m_player->rateChanged();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosRemoteCommandListenerIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/RemoteCommandListenerIOS.mm (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/RemoteCommandListenerIOS.mm        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/platform/ios/RemoteCommandListenerIOS.mm        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx"> callOnMainThread([weakThis] {
</span><span class="cx"> if (!weakThis)
</span><span class="cx"> return;
</span><del>- weakThis->m_client.didReceiveRemoteControlCommand(MediaSession::PauseCommand);
</del><ins>+ weakThis->m_client.didReceiveRemoteControlCommand(PlatformMediaSession::PauseCommand);
</ins><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> return MPRemoteCommandHandlerStatusSuccess;
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx"> callOnMainThread([weakThis] {
</span><span class="cx"> if (!weakThis)
</span><span class="cx"> return;
</span><del>- weakThis->m_client.didReceiveRemoteControlCommand(MediaSession::PlayCommand);
</del><ins>+ weakThis->m_client.didReceiveRemoteControlCommand(PlatformMediaSession::PlayCommand);
</ins><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> return MPRemoteCommandHandlerStatusSuccess;
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx"> callOnMainThread([weakThis] {
</span><span class="cx"> if (!weakThis)
</span><span class="cx"> return;
</span><del>- weakThis->m_client.didReceiveRemoteControlCommand(MediaSession::TogglePlayPauseCommand);
</del><ins>+ weakThis->m_client.didReceiveRemoteControlCommand(PlatformMediaSession::TogglePlayPauseCommand);
</ins><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> return MPRemoteCommandHandlerStatusSuccess;
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx"> ASSERT([event isKindOfClass:getMPSeekCommandEventClass()]);
</span><span class="cx">
</span><span class="cx"> MPSeekCommandEvent* seekEvent = static_cast<MPSeekCommandEvent *>(event);
</span><del>- MediaSession::RemoteControlCommandType command = [seekEvent type] == MPSeekCommandEventTypeBeginSeeking ? MediaSession::BeginSeekingBackwardCommand : MediaSession::EndSeekingBackwardCommand;
</del><ins>+ PlatformMediaSession::RemoteControlCommandType command = [seekEvent type] == MPSeekCommandEventTypeBeginSeeking ? PlatformMediaSession::BeginSeekingBackwardCommand : PlatformMediaSession::EndSeekingBackwardCommand;
</ins><span class="cx">
</span><span class="cx"> callOnMainThread([weakThis, command] {
</span><span class="cx"> if (!weakThis)
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx"> ASSERT([event isKindOfClass:getMPSeekCommandEventClass()]);
</span><span class="cx"> MPSeekCommandEvent* seekEvent = static_cast<MPSeekCommandEvent *>(event);
</span><span class="cx">
</span><del>- MediaSession::RemoteControlCommandType command = [seekEvent type] == MPSeekCommandEventTypeBeginSeeking ? MediaSession::BeginSeekingForwardCommand : MediaSession::EndSeekingForwardCommand;
</del><ins>+ PlatformMediaSession::RemoteControlCommandType command = [seekEvent type] == MPSeekCommandEventTypeBeginSeeking ? PlatformMediaSession::BeginSeekingForwardCommand : PlatformMediaSession::EndSeekingForwardCommand;
</ins><span class="cx">
</span><span class="cx"> callOnMainThread([weakThis, command] {
</span><span class="cx"> if (!weakThis)
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (185005 => 185006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2015-05-29 21:46:32 UTC (rev 185005)
+++ trunk/Source/WebCore/testing/Internals.cpp        2015-05-29 21:53:30 UTC (rev 185006)
</span><span class="lines">@@ -2578,15 +2578,15 @@
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx"> void Internals::beginMediaSessionInterruption()
</span><span class="cx"> {
</span><del>- MediaSessionManager::sharedManager().beginInterruption(MediaSession::SystemInterruption);
</del><ins>+ MediaSessionManager::sharedManager().beginInterruption(PlatformMediaSession::SystemInterruption);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Internals::endMediaSessionInterruption(const String& flagsString)
</span><span class="cx"> {
</span><del>- MediaSession::EndInterruptionFlags flags = MediaSession::NoFlags;
</del><ins>+ PlatformMediaSession::EndInterruptionFlags flags = PlatformMediaSession::NoFlags;
</ins><span class="cx">
</span><span class="cx"> if (equalIgnoringCase(flagsString, "MayResumePlaying"))
</span><del>- flags = MediaSession::MayResumePlaying;
</del><ins>+ flags = PlatformMediaSession::MayResumePlaying;
</ins><span class="cx">
</span><span class="cx"> MediaSessionManager::sharedManager().endInterruption(flags);
</span><span class="cx"> }
</span><span class="lines">@@ -2603,13 +2603,13 @@
</span><span class="cx">
</span><span class="cx"> void Internals::setMediaSessionRestrictions(const String& mediaTypeString, const String& restrictionsString, ExceptionCode& ec)
</span><span class="cx"> {
</span><del>- MediaSession::MediaType mediaType = MediaSession::None;
</del><ins>+ PlatformMediaSession::MediaType mediaType = PlatformMediaSession::None;
</ins><span class="cx"> if (equalIgnoringCase(mediaTypeString, "Video"))
</span><del>- mediaType = MediaSession::Video;
</del><ins>+ mediaType = PlatformMediaSession::Video;
</ins><span class="cx"> else if (equalIgnoringCase(mediaTypeString, "Audio"))
</span><del>- mediaType = MediaSession::Audio;
</del><ins>+ mediaType = PlatformMediaSession::Audio;
</ins><span class="cx"> else if (equalIgnoringCase(mediaTypeString, "WebAudio"))
</span><del>- mediaType = MediaSession::WebAudio;
</del><ins>+ mediaType = PlatformMediaSession::WebAudio;
</ins><span class="cx"> else {
</span><span class="cx"> ec = INVALID_ACCESS_ERR;
</span><span class="cx"> return;
</span><span class="lines">@@ -2682,24 +2682,24 @@
</span><span class="cx">
</span><span class="cx"> void Internals::postRemoteControlCommand(const String& commandString, ExceptionCode& ec)
</span><span class="cx"> {
</span><del>- MediaSession::RemoteControlCommandType command;
</del><ins>+ PlatformMediaSession::RemoteControlCommandType command;
</ins><span class="cx">
</span><span class="cx"> if (equalIgnoringCase(commandString, "Play"))
</span><del>- command = MediaSession::PlayCommand;
</del><ins>+ command = PlatformMediaSession::PlayCommand;
</ins><span class="cx"> else if (equalIgnoringCase(commandString, "Pause"))
</span><del>- command = MediaSession::PauseCommand;
</del><ins>+ command = PlatformMediaSession::PauseCommand;
</ins><span class="cx"> else if (equalIgnoringCase(commandString, "Stop"))
</span><del>- command = MediaSession::StopCommand;
</del><ins>+ command = PlatformMediaSession::StopCommand;
</ins><span class="cx"> else if (equalIgnoringCase(commandString, "TogglePlayPause"))
</span><del>- command = MediaSession::TogglePlayPauseCommand;
</del><ins>+ command = PlatformMediaSession::TogglePlayPauseCommand;
</ins><span class="cx"> else if (equalIgnoringCase(commandString, "BeginSeekingBackward"))
</span><del>- command = MediaSession::BeginSeekingBackwardCommand;
</del><ins>+ command = PlatformMediaSession::BeginSeekingBackwardCommand;
</ins><span class="cx"> else if (equalIgnoringCase(commandString, "EndSeekingBackward"))
</span><del>- command = MediaSession::EndSeekingBackwardCommand;
</del><ins>+ command = PlatformMediaSession::EndSeekingBackwardCommand;
</ins><span class="cx"> else if (equalIgnoringCase(commandString, "BeginSeekingForward"))
</span><del>- command = MediaSession::BeginSeekingForwardCommand;
</del><ins>+ command = PlatformMediaSession::BeginSeekingForwardCommand;
</ins><span class="cx"> else if (equalIgnoringCase(commandString, "EndSeekingForward"))
</span><del>- command = MediaSession::EndSeekingForwardCommand;
</del><ins>+ command = PlatformMediaSession::EndSeekingForwardCommand;
</ins><span class="cx"> else {
</span><span class="cx"> ec = INVALID_ACCESS_ERR;
</span><span class="cx"> return;
</span></span></pre>
</div>
</div>
</body>
</html>