<!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>[185223] 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/185223">185223</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-06-04 15:37:25 -0700 (Thu, 04 Jun 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Rename MediaSessionManager to PlatformMediaSessionManager for consistency with PlatformMediaSession.
https://bugs.webkit.org/show_bug.cgi?id=145648

Patch by Matt Rajca &lt;mrajca@apple.com&gt; on 2015-06-04
Reviewed by Eric Carlson.

* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::effectivePreloadForElement):
(WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::PlatformMediaSession):
(WebCore::PlatformMediaSession::~PlatformMediaSession):
(WebCore::PlatformMediaSession::clientWillBeginPlayback):
(WebCore::PlatformMediaSession::clientWillPausePlayback):
(WebCore::PlatformMediaSession::clientDataBufferingTimerFired):
(WebCore::PlatformMediaSession::updateClientDataBuffering):
* platform/audio/PlatformMediaSessionManager.cpp: Renamed from Source/WebCore/platform/audio/MediaSessionManager.cpp.
(WebCore::PlatformMediaSessionManager::sharedManager):
(WebCore::PlatformMediaSessionManager::PlatformMediaSessionManager):
(WebCore::PlatformMediaSessionManager::resetRestrictions):
(WebCore::PlatformMediaSessionManager::has):
(WebCore::PlatformMediaSessionManager::activeAudioSessionRequired):
(WebCore::PlatformMediaSessionManager::count):
(WebCore::PlatformMediaSessionManager::beginInterruption):
(WebCore::PlatformMediaSessionManager::endInterruption):
(WebCore::PlatformMediaSessionManager::addSession):
(WebCore::PlatformMediaSessionManager::removeSession):
(WebCore::PlatformMediaSessionManager::addRestriction):
(WebCore::PlatformMediaSessionManager::removeRestriction):
(WebCore::PlatformMediaSessionManager::restrictions):
(WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
(WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
(WebCore::PlatformMediaSessionManager::setCurrentSession):
(WebCore::PlatformMediaSessionManager::currentSession):
(WebCore::PlatformMediaSessionManager::sessionRestrictsInlineVideoPlayback):
(WebCore::PlatformMediaSessionManager::sessionCanLoadMedia):
(WebCore::PlatformMediaSessionManager::applicationWillEnterBackground):
(WebCore::PlatformMediaSessionManager::applicationWillEnterForeground):
(WebCore::PlatformMediaSessionManager::updateSessionState):
(WebCore::PlatformMediaSessionManager::didReceiveRemoteControlCommand):
(WebCore::PlatformMediaSessionManager::systemWillSleep):
(WebCore::PlatformMediaSessionManager::systemDidWake):
(WebCore::PlatformMediaSessionManager::audioOutputDeviceChanged):
* platform/audio/PlatformMediaSessionManager.h: Renamed from Source/WebCore/platform/audio/MediaSessionManager.h.
(WebCore::PlatformMediaSessionManager::~PlatformMediaSessionManager):
(WebCore::PlatformMediaSessionManager::configureWireLessTargetMonitoring):
(WebCore::PlatformMediaSessionManager::hasWirelessTargetsAvailable):
(WebCore::PlatformMediaSessionManager::sessions):
* platform/audio/mac/AudioDestinationMac.cpp:
* platform/audio/mac/MediaSessionManagerMac.cpp:
(PlatformMediaSessionManager::updateSessionState):
(MediaSessionManager::updateSessionState): Deleted.
* testing/Internals.cpp:</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="#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="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlMediaElementSessioncpp">trunk/Source/WebCore/html/MediaElementSession.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformaudioPlatformMediaSessioncpp">trunk/Source/WebCore/platform/audio/PlatformMediaSession.cpp</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="#trunkSourceWebCoreplatformaudiomacAudioDestinationMaccpp">trunk/Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformaudiomacMediaSessionManagerMaccpp">trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformaudioPlatformMediaSessionManagercpp">trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformaudioPlatformMediaSessionManagerh">trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (185222 => 185223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-06-04 22:20:05 UTC (rev 185222)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-06-04 22:37:25 UTC (rev 185223)
</span><span class="lines">@@ -2111,10 +2111,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/MediaSessionManager.cpp
</del><span class="cx">     platform/audio/MultiChannelResampler.cpp
</span><span class="cx">     platform/audio/Panner.cpp
</span><span class="cx">     platform/audio/PlatformMediaSession.cpp
</span><ins>+    platform/audio/PlatformMediaSessionManager.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 (185222 => 185223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-06-04 22:20:05 UTC (rev 185222)
+++ trunk/Source/WebCore/ChangeLog        2015-06-04 22:37:25 UTC (rev 185223)
</span><span class="lines">@@ -1,3 +1,62 @@
</span><ins>+2015-06-04  Matt Rajca  &lt;mrajca@apple.com&gt;
+
+        Rename MediaSessionManager to PlatformMediaSessionManager for consistency with PlatformMediaSession.
+        https://bugs.webkit.org/show_bug.cgi?id=145648
+
+        Reviewed by Eric Carlson.
+
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/HTMLMediaElement.cpp:
+        * html/MediaElementSession.cpp:
+        (WebCore::MediaElementSession::effectivePreloadForElement):
+        (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
+        * platform/audio/PlatformMediaSession.cpp:
+        (WebCore::PlatformMediaSession::PlatformMediaSession):
+        (WebCore::PlatformMediaSession::~PlatformMediaSession):
+        (WebCore::PlatformMediaSession::clientWillBeginPlayback):
+        (WebCore::PlatformMediaSession::clientWillPausePlayback):
+        (WebCore::PlatformMediaSession::clientDataBufferingTimerFired):
+        (WebCore::PlatformMediaSession::updateClientDataBuffering):
+        * platform/audio/PlatformMediaSessionManager.cpp: Renamed from Source/WebCore/platform/audio/MediaSessionManager.cpp.
+        (WebCore::PlatformMediaSessionManager::sharedManager):
+        (WebCore::PlatformMediaSessionManager::PlatformMediaSessionManager):
+        (WebCore::PlatformMediaSessionManager::resetRestrictions):
+        (WebCore::PlatformMediaSessionManager::has):
+        (WebCore::PlatformMediaSessionManager::activeAudioSessionRequired):
+        (WebCore::PlatformMediaSessionManager::count):
+        (WebCore::PlatformMediaSessionManager::beginInterruption):
+        (WebCore::PlatformMediaSessionManager::endInterruption):
+        (WebCore::PlatformMediaSessionManager::addSession):
+        (WebCore::PlatformMediaSessionManager::removeSession):
+        (WebCore::PlatformMediaSessionManager::addRestriction):
+        (WebCore::PlatformMediaSessionManager::removeRestriction):
+        (WebCore::PlatformMediaSessionManager::restrictions):
+        (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
+        (WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
+        (WebCore::PlatformMediaSessionManager::setCurrentSession):
+        (WebCore::PlatformMediaSessionManager::currentSession):
+        (WebCore::PlatformMediaSessionManager::sessionRestrictsInlineVideoPlayback):
+        (WebCore::PlatformMediaSessionManager::sessionCanLoadMedia):
+        (WebCore::PlatformMediaSessionManager::applicationWillEnterBackground):
+        (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground):
+        (WebCore::PlatformMediaSessionManager::updateSessionState):
+        (WebCore::PlatformMediaSessionManager::didReceiveRemoteControlCommand):
+        (WebCore::PlatformMediaSessionManager::systemWillSleep):
+        (WebCore::PlatformMediaSessionManager::systemDidWake):
+        (WebCore::PlatformMediaSessionManager::audioOutputDeviceChanged):
+        * platform/audio/PlatformMediaSessionManager.h: Renamed from Source/WebCore/platform/audio/MediaSessionManager.h.
+        (WebCore::PlatformMediaSessionManager::~PlatformMediaSessionManager):
+        (WebCore::PlatformMediaSessionManager::configureWireLessTargetMonitoring):
+        (WebCore::PlatformMediaSessionManager::hasWirelessTargetsAvailable):
+        (WebCore::PlatformMediaSessionManager::sessions):
+        * platform/audio/mac/AudioDestinationMac.cpp:
+        * platform/audio/mac/MediaSessionManagerMac.cpp:
+        (PlatformMediaSessionManager::updateSessionState):
+        (MediaSessionManager::updateSessionState): Deleted.
+        * testing/Internals.cpp:
+
</ins><span class="cx"> 2015-06-04  Eric Carlson  &lt;eric.carlson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Mac] Don't show default controls after playing to wireless target, again
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (185222 => 185223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-06-04 22:20:05 UTC (rev 185222)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-06-04 22:37:25 UTC (rev 185223)
</span><span class="lines">@@ -7396,7 +7396,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\ISOVTTCue.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\audio\AudioSession.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\audio\PlatformMediaSession.cpp&quot; /&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\platform\audio\MediaSessionManager.cpp&quot; /&gt;
</del><ins>+    &lt;ClCompile Include=&quot;..\platform\audio\PlatformMediaSessionManager.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\ANGLEWebKitBridge.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\avfoundation\cf\InbandTextTrackPrivateAVCF.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\avfoundation\cf\InbandTextTrackPrivateLegacyAVCF.cpp&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (185222 => 185223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-06-04 22:20:05 UTC (rev 185222)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-06-04 22:37:25 UTC (rev 185223)
</span><span class="lines">@@ -7054,7 +7054,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\audio\PlatformMediaSession.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;platform\audio&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\platform\audio\MediaSessionManager.cpp&quot;&gt;
</del><ins>+    &lt;ClCompile Include=&quot;..\platform\audio\PlatformMediaSessionManager.cpp&quot;&gt;
</ins><span class="cx">       &lt;Filter&gt;platform\audio&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\Modules\gamepad\NavigatorGamepad.cpp&quot;&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (185222 => 185223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-06-04 22:20:05 UTC (rev 185222)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-06-04 22:37:25 UTC (rev 185223)
</span><span class="lines">@@ -349,7 +349,7 @@
</span><span class="cx">                 07F0B97A1AC5DB3300E535D9 /* AVKitSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F0B9791AC5DB3300E535D9 /* AVKitSPI.h */; };
</span><span class="cx">                 07F0B97C1AC5DB4600E535D9 /* AVFoundationSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F0B97B1AC5DB4600E535D9 /* AVFoundationSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 07F876841AD580F900905849 /* MediaPlaybackTargetContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F876831AD4A94500905849 /* MediaPlaybackTargetContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                07F944161864D046005D31CB /* MediaSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = CDAE8C081746B95700532D78 /* MediaSessionManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><ins>+                07F944161864D046005D31CB /* PlatformMediaSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = CDAE8C081746B95700532D78 /* PlatformMediaSessionManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 07FBDE2C18FED178001A7CFF /* JSDataCueCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07FBDE2B18FED178001A7CFF /* JSDataCueCustom.cpp */; };
</span><span class="cx">                 07FE99DC18807A7D00256648 /* MediaElementSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07FE99DA18807A7D00256648 /* MediaElementSession.cpp */; };
</span><span class="cx">                 07FE99DD18807A7D00256648 /* MediaElementSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 07FE99DB18807A7D00256648 /* MediaElementSession.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -5806,7 +5806,7 @@
</span><span class="cx">                 CDAB6D2E17C814EE00C60B34 /* JSMediaControlsHost.h in Headers */ = {isa = PBXBuildFile; fileRef = CDAB6D2C17C814EE00C60B34 /* JSMediaControlsHost.h */; };
</span><span class="cx">                 CDAB6D3117C9259500C60B34 /* UserAgentScripts.h in Headers */ = {isa = PBXBuildFile; fileRef = CDAB6D2F17C9259500C60B34 /* UserAgentScripts.h */; };
</span><span class="cx">                 CDAB6D3217C9259500C60B34 /* UserAgentScriptsData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDAB6D3017C9259500C60B34 /* UserAgentScriptsData.cpp */; };
</span><del>-                CDAE8C091746B95700532D78 /* MediaSessionManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDAE8C071746B95700532D78 /* MediaSessionManager.cpp */; };
</del><ins>+                CDAE8C091746B95700532D78 /* PlatformMediaSessionManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDAE8C071746B95700532D78 /* PlatformMediaSessionManager.cpp */; };
</ins><span class="cx">                 CDB859F7160D48A400E5B07F /* MediaKeyEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDB859F4160D489900E5B07F /* MediaKeyEvent.cpp */; };
</span><span class="cx">                 CDB859FA160D494900E5B07F /* JSMediaKeyEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDB859F8160D493E00E5B07F /* JSMediaKeyEvent.cpp */; };
</span><span class="cx">                 CDBEAEAC19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDBEAEAA19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.mm */; };
</span><span class="lines">@@ -13410,8 +13410,8 @@
</span><span class="cx">                 CDAB6D2C17C814EE00C60B34 /* JSMediaControlsHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaControlsHost.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDAB6D2F17C9259500C60B34 /* UserAgentScripts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserAgentScripts.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDAB6D3017C9259500C60B34 /* UserAgentScriptsData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserAgentScriptsData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                CDAE8C071746B95700532D78 /* MediaSessionManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaSessionManager.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDAE8C081746B95700532D78 /* MediaSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSessionManager.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                CDAE8C071746B95700532D78 /* PlatformMediaSessionManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformMediaSessionManager.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CDAE8C081746B95700532D78 /* PlatformMediaSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformMediaSessionManager.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CDB859F2160D489900E5B07F /* MediaKeyError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaKeyError.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDB859F3160D489900E5B07F /* MediaKeyError.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaKeyError.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDB859F4160D489900E5B07F /* MediaKeyEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaKeyEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -23594,14 +23594,14 @@
</span><span class="cx">                                 FD31606912B026F700C1A359 /* HRTFKernel.h */,
</span><span class="cx">                                 FD31606A12B026F700C1A359 /* HRTFPanner.cpp */,
</span><span class="cx">                                 FD31606B12B026F700C1A359 /* HRTFPanner.h */,
</span><del>-                                CDAE8C071746B95700532D78 /* MediaSessionManager.cpp */,
-                                CDAE8C081746B95700532D78 /* MediaSessionManager.h */,
</del><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><span class="cx">                                 070E091A1875EF71003A1D3C /* PlatformMediaSession.cpp */,
</span><span class="cx">                                 070E09181875ED93003A1D3C /* PlatformMediaSession.h */,
</span><ins>+                                CDAE8C071746B95700532D78 /* PlatformMediaSessionManager.cpp */,
+                                CDAE8C081746B95700532D78 /* PlatformMediaSessionManager.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">@@ -25850,7 +25850,6 @@
</span><span class="cx">                                 CEEFCD7A19DB31F7003876D7 /* MediaResourceLoader.h in Headers */,
</span><span class="cx">                                 CDBEAEAD19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.h in Headers */,
</span><span class="cx">                                 C9027F421B1D0AD200BFBFEF /* MediaSession.h in Headers */,
</span><del>-                                07F944161864D046005D31CB /* MediaSessionManager.h in Headers */,
</del><span class="cx">                                 07638A991884487200E15A1B /* MediaSessionManagerIOS.h in Headers */,
</span><span class="cx">                                 CD3A495F17A9D01B00274E42 /* MediaSource.h in Headers */,
</span><span class="cx">                                 CD641EB31818F5ED00EE4C41 /* MediaSourcePrivate.h in Headers */,
</span><span class="lines">@@ -26074,6 +26073,7 @@
</span><span class="cx">                                 F544F78915CFB2A800AF33A8 /* PlatformLocale.h in Headers */,
</span><span class="cx">                                 CEEFCD7C19DB33DC003876D7 /* PlatformMediaResourceLoader.h in Headers */,
</span><span class="cx">                                 070E09191875EEFC003A1D3C /* PlatformMediaSession.h in Headers */,
</span><ins>+                                07F944161864D046005D31CB /* PlatformMediaSessionManager.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">@@ -29436,7 +29436,6 @@
</span><span class="cx">                                 CEEFCD7919DB31F7003876D7 /* MediaResourceLoader.cpp in Sources */,
</span><span class="cx">                                 CDBEAEAC19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.mm in Sources */,
</span><span class="cx">                                 C9027F411B1D0AD200BFBFEF /* MediaSession.cpp in Sources */,
</span><del>-                                CDAE8C091746B95700532D78 /* MediaSessionManager.cpp in Sources */,
</del><span class="cx">                                 07638A9A1884487200E15A1B /* MediaSessionManagerIOS.mm in Sources */,
</span><span class="cx">                                 07EDC3EE1AACB75D00983EB5 /* MediaSessionManagerMac.cpp in Sources */,
</span><span class="cx">                                 CD3A495E17A9D01B00274E42 /* MediaSource.cpp in Sources */,
</span><span class="lines">@@ -29607,6 +29606,7 @@
</span><span class="cx">                                 BCAA486F14A052530088FAC4 /* PlatformEventFactoryMac.mm in Sources */,
</span><span class="cx">                                 F544F78815CFB2A800AF33A8 /* PlatformLocale.cpp in Sources */,
</span><span class="cx">                                 070E091B1875EF71003A1D3C /* PlatformMediaSession.cpp in Sources */,
</span><ins>+                                CDAE8C091746B95700532D78 /* PlatformMediaSessionManager.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="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (185222 => 185223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2015-06-04 22:20:05 UTC (rev 185222)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2015-06-04 22:37:25 UTC (rev 185223)
</span><span class="lines">@@ -65,10 +65,10 @@
</span><span class="cx"> #include &quot;MediaPlayer.h&quot;
</span><span class="cx"> #include &quot;MediaQueryEvaluator.h&quot;
</span><span class="cx"> #include &quot;MediaResourceLoader.h&quot;
</span><del>-#include &quot;MediaSessionManager.h&quot;
</del><span class="cx"> #include &quot;NetworkingContext.h&quot;
</span><span class="cx"> #include &quot;PageGroup.h&quot;
</span><span class="cx"> #include &quot;PageThrottler.h&quot;
</span><ins>+#include &quot;PlatformMediaSessionManager.h&quot;
</ins><span class="cx"> #include &quot;ProgressTracker.h&quot;
</span><span class="cx"> #include &quot;RenderLayerCompositor.h&quot;
</span><span class="cx"> #include &quot;RenderVideo.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlMediaElementSessioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/MediaElementSession.cpp (185222 => 185223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/MediaElementSession.cpp        2015-06-04 22:20:05 UTC (rev 185222)
+++ trunk/Source/WebCore/html/MediaElementSession.cpp        2015-06-04 22:37:25 UTC (rev 185223)
</span><span class="lines">@@ -38,8 +38,8 @@
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;HTMLVideoElement.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><del>-#include &quot;MediaSessionManager.h&quot;
</del><span class="cx"> #include &quot;Page.h&quot;
</span><ins>+#include &quot;PlatformMediaSessionManager.h&quot;
</ins><span class="cx"> #include &quot;ScriptController.h&quot;
</span><span class="cx"> #include &quot;SourceBuffer.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -203,7 +203,7 @@
</span><span class="cx"> {
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     // FIXME: consolidate Mac and iOS implementations
</span><del>-    m_hasPlaybackTargets = MediaSessionManager::sharedManager().hasWirelessTargetsAvailable();
</del><ins>+    m_hasPlaybackTargets = PlatformMediaSessionManager::sharedManager().hasWirelessTargetsAvailable();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     LOG(Media, &quot;MediaElementSession::hasWirelessPlaybackTargets - returning %s&quot;, m_hasPlaybackTargets ? &quot;TRUE&quot; : &quot;FALSE&quot;);
</span><span class="lines">@@ -268,7 +268,7 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     UNUSED_PARAM(element);
</span><span class="cx">     m_hasPlaybackTargetAvailabilityListeners = hasListeners;
</span><del>-    MediaSessionManager::sharedManager().configureWireLessTargetMonitoring();
</del><ins>+    PlatformMediaSessionManager::sharedManager().configureWireLessTargetMonitoring();
</ins><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(hasListeners);
</span><span class="cx">     element.document().playbackTargetPickerClientStateDidChange(*this, element.mediaState());
</span><span class="lines">@@ -328,13 +328,13 @@
</span><span class="cx"> 
</span><span class="cx"> MediaPlayer::Preload MediaElementSession::effectivePreloadForElement(const HTMLMediaElement&amp; element) const
</span><span class="cx"> {
</span><del>-    MediaSessionManager::SessionRestrictions restrictions = MediaSessionManager::sharedManager().restrictions(mediaType());
</del><ins>+    PlatformMediaSessionManager::SessionRestrictions restrictions = PlatformMediaSessionManager::sharedManager().restrictions(mediaType());
</ins><span class="cx">     MediaPlayer::Preload preload = element.preloadValue();
</span><span class="cx"> 
</span><del>-    if ((restrictions &amp; MediaSessionManager::MetadataPreloadingNotPermitted) == MediaSessionManager::MetadataPreloadingNotPermitted)
</del><ins>+    if ((restrictions &amp; PlatformMediaSessionManager::MetadataPreloadingNotPermitted) == PlatformMediaSessionManager::MetadataPreloadingNotPermitted)
</ins><span class="cx">         return MediaPlayer::None;
</span><span class="cx"> 
</span><del>-    if ((restrictions &amp; MediaSessionManager::AutoPreloadingNotPermitted) == MediaSessionManager::AutoPreloadingNotPermitted) {
</del><ins>+    if ((restrictions &amp; PlatformMediaSessionManager::AutoPreloadingNotPermitted) == PlatformMediaSessionManager::AutoPreloadingNotPermitted) {
</ins><span class="cx">         if (preload &gt; MediaPlayer::MetaData)
</span><span class="cx">             return MediaPlayer::MetaData;
</span><span class="cx">     }
</span><span class="lines">@@ -344,7 +344,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool MediaElementSession::requiresFullscreenForVideoPlayback(const HTMLMediaElement&amp; element) const
</span><span class="cx"> {
</span><del>-    if (!MediaSessionManager::sharedManager().sessionRestrictsInlineVideoPlayback(*this))
</del><ins>+    if (!PlatformMediaSessionManager::sharedManager().sessionRestrictsInlineVideoPlayback(*this))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     Settings* settings = element.document().settings();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioMediaSessionManagercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/audio/MediaSessionManager.cpp (185222 => 185223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/MediaSessionManager.cpp        2015-06-04 22:20:05 UTC (rev 185222)
+++ trunk/Source/WebCore/platform/audio/MediaSessionManager.cpp        2015-06-04 22:37:25 UTC (rev 185223)
</span><span class="lines">@@ -1,334 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013-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 &quot;config.h&quot;
-#include &quot;MediaSessionManager.h&quot;
-
-#if ENABLE(VIDEO)
-
-#include &quot;AudioSession.h&quot;
-#include &quot;Logging.h&quot;
-#include &quot;NotImplemented.h&quot;
-#include &quot;PlatformMediaSession.h&quot;
-
-namespace WebCore {
-
-#if !PLATFORM(IOS)
-MediaSessionManager&amp; MediaSessionManager::sharedManager()
-{
-    DEPRECATED_DEFINE_STATIC_LOCAL(MediaSessionManager, manager, ());
-    return manager;
-}
-#endif
-
-MediaSessionManager::MediaSessionManager()
-    : m_systemSleepListener(SystemSleepListener::create(*this))
-{
-    resetRestrictions();
-}
-
-void MediaSessionManager::resetRestrictions()
-{
-    m_restrictions[PlatformMediaSession::Video] = NoRestrictions;
-    m_restrictions[PlatformMediaSession::Audio] = NoRestrictions;
-    m_restrictions[PlatformMediaSession::WebAudio] = NoRestrictions;
-}
-
-bool MediaSessionManager::has(PlatformMediaSession::MediaType type) const
-{
-    ASSERT(type &gt;= PlatformMediaSession::None &amp;&amp; type &lt;= PlatformMediaSession::WebAudio);
-
-    for (auto* session : m_sessions) {
-        if (session-&gt;mediaType() == type)
-            return true;
-    }
-
-    return false;
-}
-
-bool MediaSessionManager::activeAudioSessionRequired() const
-{
-    for (auto* session : m_sessions) {
-        if (session-&gt;mediaType() != PlatformMediaSession::None &amp;&amp; session-&gt;state() == PlatformMediaSession::State::Playing)
-            return true;
-    }
-    
-    return false;
-}
-
-int MediaSessionManager::count(PlatformMediaSession::MediaType type) const
-{
-    ASSERT(type &gt;= PlatformMediaSession::None &amp;&amp; type &lt;= PlatformMediaSession::WebAudio);
-
-    int count = 0;
-    for (auto* session : m_sessions) {
-        if (session-&gt;mediaType() == type)
-            ++count;
-    }
-
-    return count;
-}
-
-void MediaSessionManager::beginInterruption(PlatformMediaSession::InterruptionType type)
-{
-    LOG(Media, &quot;MediaSessionManager::beginInterruption&quot;);
-
-    m_interrupted = true;
-    Vector&lt;PlatformMediaSession*&gt; sessions = m_sessions;
-    for (auto* session : sessions)
-        session-&gt;beginInterruption(type);
-    updateSessionState();
-}
-
-void MediaSessionManager::endInterruption(PlatformMediaSession::EndInterruptionFlags flags)
-{
-    LOG(Media, &quot;MediaSessionManager::endInterruption&quot;);
-
-    m_interrupted = false;
-    Vector&lt;PlatformMediaSession*&gt; sessions = m_sessions;
-    for (auto* session : sessions)
-        session-&gt;endInterruption(flags);
-}
-
-void MediaSessionManager::addSession(PlatformMediaSession&amp; session)
-{
-    LOG(Media, &quot;MediaSessionManager::addSession - %p&quot;, &amp;session);
-    
-    m_sessions.append(&amp;session);
-    if (m_interrupted)
-        session.setState(PlatformMediaSession::Interrupted);
-
-    if (!m_remoteCommandListener)
-        m_remoteCommandListener = RemoteCommandListener::create(*this);
-
-    if (!m_audioHardwareListener)
-        m_audioHardwareListener = AudioHardwareListener::create(*this);
-
-    updateSessionState();
-}
-
-void MediaSessionManager::removeSession(PlatformMediaSession&amp; session)
-{
-    LOG(Media, &quot;MediaSessionManager::removeSession - %p&quot;, &amp;session);
-    
-    size_t index = m_sessions.find(&amp;session);
-    ASSERT(index != notFound);
-    if (index == notFound)
-        return;
-    
-    m_sessions.remove(index);
-
-    if (m_sessions.isEmpty()) {
-        m_remoteCommandListener = nullptr;
-        m_audioHardwareListener = nullptr;
-    }
-
-    updateSessionState();
-}
-
-void MediaSessionManager::addRestriction(PlatformMediaSession::MediaType type, SessionRestrictions restriction)
-{
-    ASSERT(type &gt; PlatformMediaSession::None &amp;&amp; type &lt;= PlatformMediaSession::WebAudio);
-    m_restrictions[type] |= restriction;
-}
-
-void MediaSessionManager::removeRestriction(PlatformMediaSession::MediaType type, SessionRestrictions restriction)
-{
-    ASSERT(type &gt; PlatformMediaSession::None &amp;&amp; type &lt;= PlatformMediaSession::WebAudio);
-    m_restrictions[type] &amp;= ~restriction;
-}
-
-MediaSessionManager::SessionRestrictions MediaSessionManager::restrictions(PlatformMediaSession::MediaType type)
-{
-    ASSERT(type &gt; PlatformMediaSession::None &amp;&amp; type &lt;= PlatformMediaSession::WebAudio);
-    return m_restrictions[type];
-}
-
-bool MediaSessionManager::sessionWillBeginPlayback(PlatformMediaSession&amp; session)
-{
-    LOG(Media, &quot;MediaSessionManager::sessionWillBeginPlayback - %p&quot;, &amp;session);
-    
-    setCurrentSession(session);
-
-    PlatformMediaSession::MediaType sessionType = session.mediaType();
-    SessionRestrictions restrictions = m_restrictions[sessionType];
-    if (session.state() == PlatformMediaSession::Interrupted &amp;&amp; restrictions &amp; InterruptedPlaybackNotPermitted)
-        return false;
-
-#if USE(AUDIO_SESSION)
-    if (activeAudioSessionRequired() &amp;&amp; !AudioSession::sharedSession().tryToSetActive(true))
-        return false;
-#endif
-
-    if (m_interrupted)
-        endInterruption(PlatformMediaSession::NoFlags);
-
-    Vector&lt;PlatformMediaSession*&gt; sessions = m_sessions;
-    for (auto* oneSession : sessions) {
-        if (oneSession == &amp;session)
-            continue;
-        if (oneSession-&gt;mediaType() == sessionType &amp;&amp; restrictions &amp; ConcurrentPlaybackNotPermitted)
-            oneSession-&gt;pauseSession();
-    }
-
-    updateSessionState();
-    return true;
-}
-    
-void MediaSessionManager::sessionWillEndPlayback(PlatformMediaSession&amp; session)
-{
-    LOG(Media, &quot;MediaSessionManager::sessionWillEndPlayback - %p&quot;, &amp;session);
-    
-    if (m_sessions.size() &lt; 2)
-        return;
-    
-    size_t pausingSessionIndex = notFound;
-    size_t lastPlayingSessionIndex = notFound;
-    for (size_t i = 0; i &lt; m_sessions.size(); ++i) {
-        PlatformMediaSession* oneSession = m_sessions[i];
-        
-        if (oneSession == &amp;session) {
-            pausingSessionIndex = i;
-            continue;
-        }
-        if (oneSession-&gt;state() == PlatformMediaSession::Playing) {
-            lastPlayingSessionIndex = i;
-            continue;
-        }
-        if (oneSession-&gt;state() != PlatformMediaSession::Playing)
-            break;
-    }
-    if (lastPlayingSessionIndex == notFound || pausingSessionIndex == notFound)
-        return;
-    
-    if (pausingSessionIndex &gt; lastPlayingSessionIndex)
-        return;
-    
-    m_sessions.remove(pausingSessionIndex);
-    m_sessions.insert(lastPlayingSessionIndex, &amp;session);
-    
-    LOG(Media, &quot;MediaSessionManager::sessionWillEndPlayback - session moved from index %zu to %zu&quot;, pausingSessionIndex, lastPlayingSessionIndex);
-}
-
-void MediaSessionManager::setCurrentSession(PlatformMediaSession&amp; session)
-{
-    LOG(Media, &quot;MediaSessionManager::setCurrentSession - %p&quot;, &amp;session);
-    
-    if (m_sessions.size() &lt; 2)
-        return;
-    
-    size_t index = m_sessions.find(&amp;session);
-    ASSERT(index != notFound);
-    if (!index || index == notFound)
-        return;
-
-    m_sessions.remove(index);
-    m_sessions.insert(0, &amp;session);
-    
-    LOG(Media, &quot;MediaSessionManager::setCurrentSession - session moved from index %zu to 0&quot;, index);
-}
-    
-PlatformMediaSession* MediaSessionManager::currentSession()
-{
-    if (!m_sessions.size())
-        return nullptr;
-
-    return m_sessions[0];
-}
-    
-bool MediaSessionManager::sessionRestrictsInlineVideoPlayback(const PlatformMediaSession&amp; session) const
-{
-    PlatformMediaSession::MediaType sessionType = session.presentationType();
-    if (sessionType != PlatformMediaSession::Video)
-        return false;
-
-    return m_restrictions[sessionType] &amp; InlineVideoPlaybackRestricted;
-}
-
-bool MediaSessionManager::sessionCanLoadMedia(const PlatformMediaSession&amp; session) const
-{
-    return session.state() == PlatformMediaSession::Playing || !session.isHidden() || session.isPlayingToWirelessPlaybackTarget();
-}
-
-void MediaSessionManager::applicationWillEnterBackground() const
-{
-    LOG(Media, &quot;MediaSessionManager::applicationWillEnterBackground&quot;);
-    Vector&lt;PlatformMediaSession*&gt; sessions = m_sessions;
-    for (auto* session : sessions) {
-        if (m_restrictions[session-&gt;mediaType()] &amp; BackgroundProcessPlaybackRestricted)
-            session-&gt;beginInterruption(PlatformMediaSession::EnteringBackground);
-    }
-}
-
-void MediaSessionManager::applicationWillEnterForeground() const
-{
-    LOG(Media, &quot;MediaSessionManager::applicationWillEnterForeground&quot;);
-    Vector&lt;PlatformMediaSession*&gt; sessions = m_sessions;
-    for (auto* session : sessions) {
-        if (m_restrictions[session-&gt;mediaType()] &amp; BackgroundProcessPlaybackRestricted)
-            session-&gt;endInterruption(PlatformMediaSession::MayResumePlaying);
-    }
-}
-
-#if !PLATFORM(COCOA)
-void MediaSessionManager::updateSessionState()
-{
-}
-#endif
-
-void MediaSessionManager::didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType command)
-{
-    PlatformMediaSession* activeSession = currentSession();
-    if (!activeSession || !activeSession-&gt;canReceiveRemoteControlCommands())
-        return;
-    activeSession-&gt;didReceiveRemoteControlCommand(command);
-}
-
-void MediaSessionManager::systemWillSleep()
-{
-    if (m_interrupted)
-        return;
-
-    for (auto session : m_sessions)
-        session-&gt;beginInterruption(PlatformMediaSession::SystemSleep);
-}
-
-void MediaSessionManager::systemDidWake()
-{
-    if (m_interrupted)
-        return;
-
-    for (auto session : m_sessions)
-        session-&gt;endInterruption(PlatformMediaSession::MayResumePlaying);
-}
-
-void MediaSessionManager::audioOutputDeviceChanged()
-{
-    updateSessionState();
-}
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioMediaSessionManagerh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/audio/MediaSessionManager.h (185222 => 185223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/MediaSessionManager.h        2015-06-04 22:20:05 UTC (rev 185222)
+++ trunk/Source/WebCore/platform/audio/MediaSessionManager.h        2015-06-04 22:37:25 UTC (rev 185223)
</span><span class="lines">@@ -1,133 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013-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 MediaSessionManager_h
-#define MediaSessionManager_h
-
-#include &quot;AudioHardwareListener.h&quot;
-#include &quot;PlatformMediaSession.h&quot;
-#include &quot;RemoteCommandListener.h&quot;
-#include &quot;Settings.h&quot;
-#include &quot;SystemSleepListener.h&quot;
-#include &lt;map&gt;
-#include &lt;wtf/Vector.h&gt;
-
-namespace WebCore {
-
-class HTMLMediaElement;
-class PlatformMediaSession;
-class RemoteCommandListener;
-
-class MediaSessionManager : private RemoteCommandListenerClient, private SystemSleepListener::Client, private AudioHardwareListener::Client {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    WEBCORE_EXPORT static MediaSessionManager&amp; sharedManager();
-    virtual ~MediaSessionManager() { }
-
-    bool has(PlatformMediaSession::MediaType) const;
-    int count(PlatformMediaSession::MediaType) const;
-    bool activeAudioSessionRequired() const;
-
-    WEBCORE_EXPORT void beginInterruption(PlatformMediaSession::InterruptionType);
-    WEBCORE_EXPORT void endInterruption(PlatformMediaSession::EndInterruptionFlags);
-
-    WEBCORE_EXPORT void applicationWillEnterForeground() const;
-    WEBCORE_EXPORT void applicationWillEnterBackground() const;
-
-    enum SessionRestrictionFlags {
-        NoRestrictions = 0,
-        ConcurrentPlaybackNotPermitted = 1 &lt;&lt; 0,
-        InlineVideoPlaybackRestricted = 1 &lt;&lt; 1,
-        MetadataPreloadingNotPermitted = 1 &lt;&lt; 2,
-        AutoPreloadingNotPermitted = 1 &lt;&lt; 3,
-        BackgroundProcessPlaybackRestricted = 1 &lt;&lt; 4,
-        BackgroundTabPlaybackRestricted = 1 &lt;&lt; 5,
-        InterruptedPlaybackNotPermitted = 1 &lt;&lt; 6,
-    };
-    typedef unsigned SessionRestrictions;
-
-    WEBCORE_EXPORT void addRestriction(PlatformMediaSession::MediaType, SessionRestrictions);
-    WEBCORE_EXPORT void removeRestriction(PlatformMediaSession::MediaType, SessionRestrictions);
-    WEBCORE_EXPORT SessionRestrictions restrictions(PlatformMediaSession::MediaType);
-    virtual void resetRestrictions();
-
-    virtual bool sessionWillBeginPlayback(PlatformMediaSession&amp;);
-    virtual void sessionWillEndPlayback(PlatformMediaSession&amp;);
-
-    bool sessionRestrictsInlineVideoPlayback(const PlatformMediaSession&amp;) const;
-
-    virtual bool sessionCanLoadMedia(const PlatformMediaSession&amp;) const;
-
-#if PLATFORM(IOS)
-    virtual void configureWireLessTargetMonitoring() { }
-    virtual bool hasWirelessTargetsAvailable() { return false; }
-#endif
-
-    void setCurrentSession(PlatformMediaSession&amp;);
-    PlatformMediaSession* currentSession();
-
-protected:
-    friend class PlatformMediaSession;
-    explicit MediaSessionManager();
-
-    void addSession(PlatformMediaSession&amp;);
-    void removeSession(PlatformMediaSession&amp;);
-
-    Vector&lt;PlatformMediaSession*&gt; sessions() { return m_sessions; }
-
-private:
-    friend class Internals;
-
-    void updateSessionState();
-
-    // RemoteCommandListenerClient
-    WEBCORE_EXPORT virtual void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) override;
-
-    // AudioHardwareListenerClient
-    virtual void audioHardwareDidBecomeActive() override { }
-    virtual void audioHardwareDidBecomeInactive() override { }
-    virtual void audioOutputDeviceChanged() override;
-
-    // SystemSleepListener
-    virtual void systemWillSleep() override;
-    virtual void systemDidWake() override;
-
-    SessionRestrictions m_restrictions[PlatformMediaSession::WebAudio + 1];
-    Vector&lt;PlatformMediaSession*&gt; m_sessions;
-    std::unique_ptr&lt;RemoteCommandListener&gt; m_remoteCommandListener;
-    std::unique_ptr&lt;SystemSleepListener&gt; m_systemSleepListener;
-    RefPtr&lt;AudioHardwareListener&gt; m_audioHardwareListener;
-
-#if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
-    RefPtr&lt;MediaPlaybackTarget&gt; m_playbackTarget;
-    bool m_canPlayToTarget { false };
-#endif
-
-    bool m_interrupted { false };
-};
-
-}
-
-#endif // MediaSessionManager_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioPlatformMediaSessioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/PlatformMediaSession.cpp (185222 => 185223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/PlatformMediaSession.cpp        2015-06-04 22:20:05 UTC (rev 185222)
+++ trunk/Source/WebCore/platform/audio/PlatformMediaSession.cpp        2015-06-04 22:37:25 UTC (rev 185223)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> #include &quot;HTMLMediaElement.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;MediaPlayer.h&quot;
</span><del>-#include &quot;MediaSessionManager.h&quot;
</del><ins>+#include &quot;PlatformMediaSessionManager.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -65,12 +65,12 @@
</span><span class="cx">     , m_notifyingClient(false)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_client.mediaType() &gt;= None &amp;&amp; m_client.mediaType() &lt;= WebAudio);
</span><del>-    MediaSessionManager::sharedManager().addSession(*this);
</del><ins>+    PlatformMediaSessionManager::sharedManager().addSession(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PlatformMediaSession::~PlatformMediaSession()
</span><span class="cx"> {
</span><del>-    MediaSessionManager::sharedManager().removeSession(*this);
</del><ins>+    PlatformMediaSessionManager::sharedManager().removeSession(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformMediaSession::setState(State state)
</span><span class="lines">@@ -118,7 +118,7 @@
</span><span class="cx">     if (m_notifyingClient)
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><del>-    if (!MediaSessionManager::sharedManager().sessionWillBeginPlayback(*this)) {
</del><ins>+    if (!PlatformMediaSessionManager::sharedManager().sessionWillBeginPlayback(*this)) {
</ins><span class="cx">         if (state() == Interrupted)
</span><span class="cx">             m_stateToRestore = Playing;
</span><span class="cx">         return false;
</span><span class="lines">@@ -142,7 +142,7 @@
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     setState(Paused);
</span><del>-    MediaSessionManager::sharedManager().sessionWillEndPlayback(*this);
</del><ins>+    PlatformMediaSessionManager::sharedManager().sessionWillEndPlayback(*this);
</ins><span class="cx">     if (!m_clientDataBufferingTimer.isActive())
</span><span class="cx">         m_clientDataBufferingTimer.startOneShot(kClientDataBufferingTimerThrottleDelay);
</span><span class="cx">     return true;
</span><span class="lines">@@ -204,8 +204,8 @@
</span><span class="cx">     if (m_state != Playing || !m_client.elementIsHidden())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    MediaSessionManager::SessionRestrictions restrictions = MediaSessionManager::sharedManager().restrictions(mediaType());
-    if ((restrictions &amp; MediaSessionManager::BackgroundTabPlaybackRestricted) == MediaSessionManager::BackgroundTabPlaybackRestricted)
</del><ins>+    PlatformMediaSessionManager::SessionRestrictions restrictions = PlatformMediaSessionManager::sharedManager().restrictions(mediaType());
+    if ((restrictions &amp; PlatformMediaSessionManager::BackgroundTabPlaybackRestricted) == PlatformMediaSessionManager::BackgroundTabPlaybackRestricted)
</ins><span class="cx">         pauseSession();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -214,7 +214,7 @@
</span><span class="cx">     if (m_clientDataBufferingTimer.isActive())
</span><span class="cx">         m_clientDataBufferingTimer.stop();
</span><span class="cx"> 
</span><del>-    m_client.setShouldBufferData(MediaSessionManager::sharedManager().sessionCanLoadMedia(*this));
</del><ins>+    m_client.setShouldBufferData(PlatformMediaSessionManager::sharedManager().sessionCanLoadMedia(*this));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool PlatformMediaSession::isHidden() const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioPlatformMediaSessionManagercppfromrev185221trunkSourceWebCoreplatformaudioMediaSessionManagercpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp (from rev 185221, trunk/Source/WebCore/platform/audio/MediaSessionManager.cpp) (0 => 185223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp        2015-06-04 22:37:25 UTC (rev 185223)
</span><span class="lines">@@ -0,0 +1,334 @@
</span><ins>+/*
+ * Copyright (C) 2013-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 &quot;config.h&quot;
+#include &quot;PlatformMediaSessionManager.h&quot;
+
+#if ENABLE(VIDEO)
+
+#include &quot;AudioSession.h&quot;
+#include &quot;Logging.h&quot;
+#include &quot;NotImplemented.h&quot;
+#include &quot;PlatformMediaSession.h&quot;
+
+namespace WebCore {
+
+#if !PLATFORM(IOS)
+PlatformMediaSessionManager&amp; PlatformMediaSessionManager::sharedManager()
+{
+    DEPRECATED_DEFINE_STATIC_LOCAL(PlatformMediaSessionManager, manager, ());
+    return manager;
+}
+#endif
+
+PlatformMediaSessionManager::PlatformMediaSessionManager()
+    : m_systemSleepListener(SystemSleepListener::create(*this))
+{
+    resetRestrictions();
+}
+
+void PlatformMediaSessionManager::resetRestrictions()
+{
+    m_restrictions[PlatformMediaSession::Video] = NoRestrictions;
+    m_restrictions[PlatformMediaSession::Audio] = NoRestrictions;
+    m_restrictions[PlatformMediaSession::WebAudio] = NoRestrictions;
+}
+
+bool PlatformMediaSessionManager::has(PlatformMediaSession::MediaType type) const
+{
+    ASSERT(type &gt;= PlatformMediaSession::None &amp;&amp; type &lt;= PlatformMediaSession::WebAudio);
+
+    for (auto* session : m_sessions) {
+        if (session-&gt;mediaType() == type)
+            return true;
+    }
+
+    return false;
+}
+
+bool PlatformMediaSessionManager::activeAudioSessionRequired() const
+{
+    for (auto* session : m_sessions) {
+        if (session-&gt;mediaType() != PlatformMediaSession::None &amp;&amp; session-&gt;state() == PlatformMediaSession::State::Playing)
+            return true;
+    }
+    
+    return false;
+}
+
+int PlatformMediaSessionManager::count(PlatformMediaSession::MediaType type) const
+{
+    ASSERT(type &gt;= PlatformMediaSession::None &amp;&amp; type &lt;= PlatformMediaSession::WebAudio);
+
+    int count = 0;
+    for (auto* session : m_sessions) {
+        if (session-&gt;mediaType() == type)
+            ++count;
+    }
+
+    return count;
+}
+
+void PlatformMediaSessionManager::beginInterruption(PlatformMediaSession::InterruptionType type)
+{
+    LOG(Media, &quot;PlatformMediaSessionManager::beginInterruption&quot;);
+
+    m_interrupted = true;
+    Vector&lt;PlatformMediaSession*&gt; sessions = m_sessions;
+    for (auto* session : sessions)
+        session-&gt;beginInterruption(type);
+    updateSessionState();
+}
+
+void PlatformMediaSessionManager::endInterruption(PlatformMediaSession::EndInterruptionFlags flags)
+{
+    LOG(Media, &quot;PlatformMediaSessionManager::endInterruption&quot;);
+
+    m_interrupted = false;
+    Vector&lt;PlatformMediaSession*&gt; sessions = m_sessions;
+    for (auto* session : sessions)
+        session-&gt;endInterruption(flags);
+}
+
+void PlatformMediaSessionManager::addSession(PlatformMediaSession&amp; session)
+{
+    LOG(Media, &quot;PlatformMediaSessionManager::addSession - %p&quot;, &amp;session);
+    
+    m_sessions.append(&amp;session);
+    if (m_interrupted)
+        session.setState(PlatformMediaSession::Interrupted);
+
+    if (!m_remoteCommandListener)
+        m_remoteCommandListener = RemoteCommandListener::create(*this);
+
+    if (!m_audioHardwareListener)
+        m_audioHardwareListener = AudioHardwareListener::create(*this);
+
+    updateSessionState();
+}
+
+void PlatformMediaSessionManager::removeSession(PlatformMediaSession&amp; session)
+{
+    LOG(Media, &quot;PlatformMediaSessionManager::removeSession - %p&quot;, &amp;session);
+    
+    size_t index = m_sessions.find(&amp;session);
+    ASSERT(index != notFound);
+    if (index == notFound)
+        return;
+    
+    m_sessions.remove(index);
+
+    if (m_sessions.isEmpty()) {
+        m_remoteCommandListener = nullptr;
+        m_audioHardwareListener = nullptr;
+    }
+
+    updateSessionState();
+}
+
+void PlatformMediaSessionManager::addRestriction(PlatformMediaSession::MediaType type, SessionRestrictions restriction)
+{
+    ASSERT(type &gt; PlatformMediaSession::None &amp;&amp; type &lt;= PlatformMediaSession::WebAudio);
+    m_restrictions[type] |= restriction;
+}
+
+void PlatformMediaSessionManager::removeRestriction(PlatformMediaSession::MediaType type, SessionRestrictions restriction)
+{
+    ASSERT(type &gt; PlatformMediaSession::None &amp;&amp; type &lt;= PlatformMediaSession::WebAudio);
+    m_restrictions[type] &amp;= ~restriction;
+}
+
+PlatformMediaSessionManager::SessionRestrictions PlatformMediaSessionManager::restrictions(PlatformMediaSession::MediaType type)
+{
+    ASSERT(type &gt; PlatformMediaSession::None &amp;&amp; type &lt;= PlatformMediaSession::WebAudio);
+    return m_restrictions[type];
+}
+
+bool PlatformMediaSessionManager::sessionWillBeginPlayback(PlatformMediaSession&amp; session)
+{
+    LOG(Media, &quot;PlatformMediaSessionManager::sessionWillBeginPlayback - %p&quot;, &amp;session);
+    
+    setCurrentSession(session);
+
+    PlatformMediaSession::MediaType sessionType = session.mediaType();
+    SessionRestrictions restrictions = m_restrictions[sessionType];
+    if (session.state() == PlatformMediaSession::Interrupted &amp;&amp; restrictions &amp; InterruptedPlaybackNotPermitted)
+        return false;
+
+#if USE(AUDIO_SESSION)
+    if (activeAudioSessionRequired() &amp;&amp; !AudioSession::sharedSession().tryToSetActive(true))
+        return false;
+#endif
+
+    if (m_interrupted)
+        endInterruption(PlatformMediaSession::NoFlags);
+
+    Vector&lt;PlatformMediaSession*&gt; sessions = m_sessions;
+    for (auto* oneSession : sessions) {
+        if (oneSession == &amp;session)
+            continue;
+        if (oneSession-&gt;mediaType() == sessionType &amp;&amp; restrictions &amp; ConcurrentPlaybackNotPermitted)
+            oneSession-&gt;pauseSession();
+    }
+
+    updateSessionState();
+    return true;
+}
+    
+void PlatformMediaSessionManager::sessionWillEndPlayback(PlatformMediaSession&amp; session)
+{
+    LOG(Media, &quot;PlatformMediaSessionManager::sessionWillEndPlayback - %p&quot;, &amp;session);
+    
+    if (m_sessions.size() &lt; 2)
+        return;
+    
+    size_t pausingSessionIndex = notFound;
+    size_t lastPlayingSessionIndex = notFound;
+    for (size_t i = 0; i &lt; m_sessions.size(); ++i) {
+        PlatformMediaSession* oneSession = m_sessions[i];
+        
+        if (oneSession == &amp;session) {
+            pausingSessionIndex = i;
+            continue;
+        }
+        if (oneSession-&gt;state() == PlatformMediaSession::Playing) {
+            lastPlayingSessionIndex = i;
+            continue;
+        }
+        if (oneSession-&gt;state() != PlatformMediaSession::Playing)
+            break;
+    }
+    if (lastPlayingSessionIndex == notFound || pausingSessionIndex == notFound)
+        return;
+    
+    if (pausingSessionIndex &gt; lastPlayingSessionIndex)
+        return;
+    
+    m_sessions.remove(pausingSessionIndex);
+    m_sessions.insert(lastPlayingSessionIndex, &amp;session);
+    
+    LOG(Media, &quot;PlatformMediaSessionManager::sessionWillEndPlayback - session moved from index %zu to %zu&quot;, pausingSessionIndex, lastPlayingSessionIndex);
+}
+
+void PlatformMediaSessionManager::setCurrentSession(PlatformMediaSession&amp; session)
+{
+    LOG(Media, &quot;PlatformMediaSessionManager::setCurrentSession - %p&quot;, &amp;session);
+    
+    if (m_sessions.size() &lt; 2)
+        return;
+    
+    size_t index = m_sessions.find(&amp;session);
+    ASSERT(index != notFound);
+    if (!index || index == notFound)
+        return;
+
+    m_sessions.remove(index);
+    m_sessions.insert(0, &amp;session);
+    
+    LOG(Media, &quot;PlatformMediaSessionManager::setCurrentSession - session moved from index %zu to 0&quot;, index);
+}
+    
+PlatformMediaSession* PlatformMediaSessionManager::currentSession()
+{
+    if (!m_sessions.size())
+        return nullptr;
+
+    return m_sessions[0];
+}
+    
+bool PlatformMediaSessionManager::sessionRestrictsInlineVideoPlayback(const PlatformMediaSession&amp; session) const
+{
+    PlatformMediaSession::MediaType sessionType = session.presentationType();
+    if (sessionType != PlatformMediaSession::Video)
+        return false;
+
+    return m_restrictions[sessionType] &amp; InlineVideoPlaybackRestricted;
+}
+
+bool PlatformMediaSessionManager::sessionCanLoadMedia(const PlatformMediaSession&amp; session) const
+{
+    return session.state() == PlatformMediaSession::Playing || !session.isHidden() || session.isPlayingToWirelessPlaybackTarget();
+}
+
+void PlatformMediaSessionManager::applicationWillEnterBackground() const
+{
+    LOG(Media, &quot;PlatformMediaSessionManager::applicationWillEnterBackground&quot;);
+    Vector&lt;PlatformMediaSession*&gt; sessions = m_sessions;
+    for (auto* session : sessions) {
+        if (m_restrictions[session-&gt;mediaType()] &amp; BackgroundProcessPlaybackRestricted)
+            session-&gt;beginInterruption(PlatformMediaSession::EnteringBackground);
+    }
+}
+
+void PlatformMediaSessionManager::applicationWillEnterForeground() const
+{
+    LOG(Media, &quot;PlatformMediaSessionManager::applicationWillEnterForeground&quot;);
+    Vector&lt;PlatformMediaSession*&gt; sessions = m_sessions;
+    for (auto* session : sessions) {
+        if (m_restrictions[session-&gt;mediaType()] &amp; BackgroundProcessPlaybackRestricted)
+            session-&gt;endInterruption(PlatformMediaSession::MayResumePlaying);
+    }
+}
+
+#if !PLATFORM(COCOA)
+void PlatformMediaSessionManager::updateSessionState()
+{
+}
+#endif
+
+void PlatformMediaSessionManager::didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType command)
+{
+    PlatformMediaSession* activeSession = currentSession();
+    if (!activeSession || !activeSession-&gt;canReceiveRemoteControlCommands())
+        return;
+    activeSession-&gt;didReceiveRemoteControlCommand(command);
+}
+
+void PlatformMediaSessionManager::systemWillSleep()
+{
+    if (m_interrupted)
+        return;
+
+    for (auto session : m_sessions)
+        session-&gt;beginInterruption(PlatformMediaSession::SystemSleep);
+}
+
+void PlatformMediaSessionManager::systemDidWake()
+{
+    if (m_interrupted)
+        return;
+
+    for (auto session : m_sessions)
+        session-&gt;endInterruption(PlatformMediaSession::MayResumePlaying);
+}
+
+void PlatformMediaSessionManager::audioOutputDeviceChanged()
+{
+    updateSessionState();
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioPlatformMediaSessionManagerhfromrev185221trunkSourceWebCoreplatformaudioMediaSessionManagerh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.h (from rev 185221, trunk/Source/WebCore/platform/audio/MediaSessionManager.h) (0 => 185223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.h                                (rev 0)
+++ trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.h        2015-06-04 22:37:25 UTC (rev 185223)
</span><span class="lines">@@ -0,0 +1,133 @@
</span><ins>+/*
+ * Copyright (C) 2013-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 PlatformMediaSessionManager_h
+#define PlatformMediaSessionManager_h
+
+#include &quot;AudioHardwareListener.h&quot;
+#include &quot;PlatformMediaSession.h&quot;
+#include &quot;RemoteCommandListener.h&quot;
+#include &quot;Settings.h&quot;
+#include &quot;SystemSleepListener.h&quot;
+#include &lt;map&gt;
+#include &lt;wtf/Vector.h&gt;
+
+namespace WebCore {
+
+class HTMLMediaElement;
+class PlatformMediaSession;
+class RemoteCommandListener;
+
+class PlatformMediaSessionManager : private RemoteCommandListenerClient, private SystemSleepListener::Client, private AudioHardwareListener::Client {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    WEBCORE_EXPORT static PlatformMediaSessionManager&amp; sharedManager();
+    virtual ~PlatformMediaSessionManager() { }
+
+    bool has(PlatformMediaSession::MediaType) const;
+    int count(PlatformMediaSession::MediaType) const;
+    bool activeAudioSessionRequired() const;
+
+    WEBCORE_EXPORT void beginInterruption(PlatformMediaSession::InterruptionType);
+    WEBCORE_EXPORT void endInterruption(PlatformMediaSession::EndInterruptionFlags);
+
+    WEBCORE_EXPORT void applicationWillEnterForeground() const;
+    WEBCORE_EXPORT void applicationWillEnterBackground() const;
+
+    enum SessionRestrictionFlags {
+        NoRestrictions = 0,
+        ConcurrentPlaybackNotPermitted = 1 &lt;&lt; 0,
+        InlineVideoPlaybackRestricted = 1 &lt;&lt; 1,
+        MetadataPreloadingNotPermitted = 1 &lt;&lt; 2,
+        AutoPreloadingNotPermitted = 1 &lt;&lt; 3,
+        BackgroundProcessPlaybackRestricted = 1 &lt;&lt; 4,
+        BackgroundTabPlaybackRestricted = 1 &lt;&lt; 5,
+        InterruptedPlaybackNotPermitted = 1 &lt;&lt; 6,
+    };
+    typedef unsigned SessionRestrictions;
+
+    WEBCORE_EXPORT void addRestriction(PlatformMediaSession::MediaType, SessionRestrictions);
+    WEBCORE_EXPORT void removeRestriction(PlatformMediaSession::MediaType, SessionRestrictions);
+    WEBCORE_EXPORT SessionRestrictions restrictions(PlatformMediaSession::MediaType);
+    virtual void resetRestrictions();
+
+    virtual bool sessionWillBeginPlayback(PlatformMediaSession&amp;);
+    virtual void sessionWillEndPlayback(PlatformMediaSession&amp;);
+
+    bool sessionRestrictsInlineVideoPlayback(const PlatformMediaSession&amp;) const;
+
+    virtual bool sessionCanLoadMedia(const PlatformMediaSession&amp;) const;
+
+#if PLATFORM(IOS)
+    virtual void configureWireLessTargetMonitoring() { }
+    virtual bool hasWirelessTargetsAvailable() { return false; }
+#endif
+
+    void setCurrentSession(PlatformMediaSession&amp;);
+    PlatformMediaSession* currentSession();
+
+protected:
+    friend class PlatformMediaSession;
+    explicit PlatformMediaSessionManager();
+
+    void addSession(PlatformMediaSession&amp;);
+    void removeSession(PlatformMediaSession&amp;);
+
+    Vector&lt;PlatformMediaSession*&gt; sessions() { return m_sessions; }
+
+private:
+    friend class Internals;
+
+    void updateSessionState();
+
+    // RemoteCommandListenerClient
+    WEBCORE_EXPORT virtual void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) override;
+
+    // AudioHardwareListenerClient
+    virtual void audioHardwareDidBecomeActive() override { }
+    virtual void audioHardwareDidBecomeInactive() override { }
+    virtual void audioOutputDeviceChanged() override;
+
+    // SystemSleepListener
+    virtual void systemWillSleep() override;
+    virtual void systemDidWake() override;
+
+    SessionRestrictions m_restrictions[PlatformMediaSession::WebAudio + 1];
+    Vector&lt;PlatformMediaSession*&gt; m_sessions;
+    std::unique_ptr&lt;RemoteCommandListener&gt; m_remoteCommandListener;
+    std::unique_ptr&lt;SystemSleepListener&gt; m_systemSleepListener;
+    RefPtr&lt;AudioHardwareListener&gt; m_audioHardwareListener;
+
+#if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
+    RefPtr&lt;MediaPlaybackTarget&gt; m_playbackTarget;
+    bool m_canPlayToTarget { false };
+#endif
+
+    bool m_interrupted { false };
+};
+
+}
+
+#endif // PlatformMediaSessionManager_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioiosMediaSessionManagerIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h (185222 => 185223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h        2015-06-04 22:20:05 UTC (rev 185222)
+++ trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h        2015-06-04 22:37:25 UTC (rev 185223)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> 
</span><del>-#include &quot;MediaSessionManager.h&quot;
</del><ins>+#include &quot;PlatformMediaSessionManager.h&quot;
</ins><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> OBJC_CLASS WebMediaSessionHelper;
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class MediaSessionManageriOS : public MediaSessionManager {
</del><ins>+class MediaSessionManageriOS : public PlatformMediaSessionManager {
</ins><span class="cx"> public:
</span><span class="cx">     virtual ~MediaSessionManageriOS();
</span><span class="cx"> 
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx">     virtual bool hasWirelessTargetsAvailable() override;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    friend class MediaSessionManager;
</del><ins>+    friend class PlatformMediaSessionManager;
</ins><span class="cx"> 
</span><span class="cx">     MediaSessionManageriOS();
</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 (185222 => 185223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm        2015-06-04 22:20:05 UTC (rev 185222)
+++ trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm        2015-06-04 22:37:25 UTC (rev 185223)
</span><span class="lines">@@ -110,14 +110,14 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-MediaSessionManager&amp; MediaSessionManager::sharedManager()
</del><ins>+PlatformMediaSessionManager&amp; PlatformMediaSessionManager::sharedManager()
</ins><span class="cx"> {
</span><span class="cx">     DEPRECATED_DEFINE_STATIC_LOCAL(MediaSessionManageriOS, manager, ());
</span><span class="cx">     return manager;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> MediaSessionManageriOS::MediaSessionManageriOS()
</span><del>-    :MediaSessionManager()
</del><ins>+    : PlatformMediaSessionManager()
</ins><span class="cx">     , m_objcObserver(adoptNS([[WebMediaSessionHelper alloc] initWithCallback:this]))
</span><span class="cx"> {
</span><span class="cx">     resetRestrictions();
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx"> 
</span><span class="cx">     LOG(Media, &quot;MediaSessionManageriOS::resetRestrictions&quot;);
</span><span class="cx"> 
</span><del>-    MediaSessionManager::resetRestrictions();
</del><ins>+    PlatformMediaSessionManager::resetRestrictions();
</ins><span class="cx"> 
</span><span class="cx">     static wkDeviceClass deviceClass = iosDeviceClass();
</span><span class="cx">     if (deviceClass == wkDeviceClassiPhone || deviceClass == wkDeviceClassiPod)
</span><span class="lines">@@ -188,7 +188,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool MediaSessionManageriOS::sessionWillBeginPlayback(PlatformMediaSession&amp; session)
</span><span class="cx"> {
</span><del>-    if (!MediaSessionManager::sessionWillBeginPlayback(session))
</del><ins>+    if (!PlatformMediaSessionManager::sessionWillBeginPlayback(session))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     updateNowPlayingInfo();
</span><span class="lines">@@ -197,7 +197,7 @@
</span><span class="cx">     
</span><span class="cx"> void MediaSessionManageriOS::sessionWillEndPlayback(PlatformMediaSession&amp; session)
</span><span class="cx"> {
</span><del>-    MediaSessionManager::sessionWillEndPlayback(session);
</del><ins>+    PlatformMediaSessionManager::sessionWillEndPlayback(session);
</ins><span class="cx">     updateNowPlayingInfo();
</span><span class="cx"> }
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudiomacAudioDestinationMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp (185222 => 185223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp        2015-06-04 22:20:05 UTC (rev 185222)
+++ trunk/Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp        2015-06-04 22:37:25 UTC (rev 185223)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx"> #include &quot;AudioSession.h&quot;
</span><span class="cx"> #include &quot;FloatConversion.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><del>-#include &quot;MediaSessionManager.h&quot;
</del><ins>+#include &quot;PlatformMediaSessionManager.h&quot;
</ins><span class="cx"> #include &quot;VectorMath.h&quot;
</span><span class="cx"> #include &lt;CoreAudio/AudioHardware.h&gt;
</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 (185222 => 185223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp        2015-06-04 22:20:05 UTC (rev 185222)
+++ trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp        2015-06-04 22:37:25 UTC (rev 185223)
</span><span class="lines">@@ -24,7 +24,7 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><del>-#include &quot;MediaSessionManager.h&quot;
</del><ins>+#include &quot;PlatformMediaSessionManager.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if USE(AUDIO_SESSION)
</span><span class="cx"> 
</span><span class="lines">@@ -37,9 +37,9 @@
</span><span class="cx"> static const size_t kWebAudioBufferSize = 128;
</span><span class="cx"> static const size_t kLowPowerVideoBufferSize = 4096;
</span><span class="cx"> 
</span><del>-void MediaSessionManager::updateSessionState()
</del><ins>+void PlatformMediaSessionManager::updateSessionState()
</ins><span class="cx"> {
</span><del>-    LOG(Media, &quot;MediaSessionManager::updateSessionState() - types: Video(%d), Audio(%d), WebAudio(%d)&quot;, count(PlatformMediaSession::Video), count(PlatformMediaSession::Audio), count(PlatformMediaSession::WebAudio));
</del><ins>+    LOG(Media, &quot;PlatformMediaSessionManager::updateSessionState() - types: Video(%d), Audio(%d), WebAudio(%d)&quot;, count(PlatformMediaSession::Video), count(PlatformMediaSession::Audio), count(PlatformMediaSession::WebAudio));
</ins><span class="cx"> 
</span><span class="cx">     if (has(PlatformMediaSession::WebAudio))
</span><span class="cx">         AudioSession::sharedSession().setPreferredBufferSize(kWebAudioBufferSize);
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (185222 => 185223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2015-06-04 22:20:05 UTC (rev 185222)
+++ trunk/Source/WebCore/testing/Internals.cpp        2015-06-04 22:37:25 UTC (rev 185223)
</span><span class="lines">@@ -79,7 +79,6 @@
</span><span class="cx"> #include &quot;MainFrame.h&quot;
</span><span class="cx"> #include &quot;MallocStatistics.h&quot;
</span><span class="cx"> #include &quot;MediaPlayer.h&quot;
</span><del>-#include &quot;MediaSessionManager.h&quot;
</del><span class="cx"> #include &quot;MemoryCache.h&quot;
</span><span class="cx"> #include &quot;MemoryInfo.h&quot;
</span><span class="cx"> #include &quot;MicroTask.h&quot;
</span><span class="lines">@@ -88,6 +87,7 @@
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;PageCache.h&quot;
</span><span class="cx"> #include &quot;PageOverlay.h&quot;
</span><ins>+#include &quot;PlatformMediaSessionManager.h&quot;
</ins><span class="cx"> #include &quot;PrintContext.h&quot;
</span><span class="cx"> #include &quot;PseudoElement.h&quot;
</span><span class="cx"> #include &quot;Range.h&quot;
</span><span class="lines">@@ -322,7 +322,7 @@
</span><span class="cx">     page-&gt;mainFrame().loader().clearTestingOverrides();
</span><span class="cx">     ApplicationCacheStorage::singleton().setDefaultOriginQuota(ApplicationCacheStorage::noQuota());
</span><span class="cx"> #if ENABLE(VIDEO)
</span><del>-    MediaSessionManager::sharedManager().resetRestrictions();
</del><ins>+    PlatformMediaSessionManager::sharedManager().resetRestrictions();
</ins><span class="cx"> #endif
</span><span class="cx"> #if HAVE(ACCESSIBILITY)
</span><span class="cx">     AXObjectCache::setEnhancedUserInterfaceAccessibility(false);
</span><span class="lines">@@ -2591,7 +2591,7 @@
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx"> void Internals::beginMediaSessionInterruption()
</span><span class="cx"> {
</span><del>-    MediaSessionManager::sharedManager().beginInterruption(PlatformMediaSession::SystemInterruption);
</del><ins>+    PlatformMediaSessionManager::sharedManager().beginInterruption(PlatformMediaSession::SystemInterruption);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Internals::endMediaSessionInterruption(const String&amp; flagsString)
</span><span class="lines">@@ -2601,17 +2601,17 @@
</span><span class="cx">     if (equalIgnoringCase(flagsString, &quot;MayResumePlaying&quot;))
</span><span class="cx">         flags = PlatformMediaSession::MayResumePlaying;
</span><span class="cx">     
</span><del>-    MediaSessionManager::sharedManager().endInterruption(flags);
</del><ins>+    PlatformMediaSessionManager::sharedManager().endInterruption(flags);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Internals::applicationWillEnterForeground() const
</span><span class="cx"> {
</span><del>-    MediaSessionManager::sharedManager().applicationWillEnterForeground();
</del><ins>+    PlatformMediaSessionManager::sharedManager().applicationWillEnterForeground();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Internals::applicationWillEnterBackground() const
</span><span class="cx"> {
</span><del>-    MediaSessionManager::sharedManager().applicationWillEnterBackground();
</del><ins>+    PlatformMediaSessionManager::sharedManager().applicationWillEnterBackground();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Internals::setMediaSessionRestrictions(const String&amp; mediaTypeString, const String&amp; restrictionsString, ExceptionCode&amp; ec)
</span><span class="lines">@@ -2628,30 +2628,30 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    MediaSessionManager::SessionRestrictions restrictions = MediaSessionManager::sharedManager().restrictions(mediaType);
-    MediaSessionManager::sharedManager().removeRestriction(mediaType, restrictions);
</del><ins>+    PlatformMediaSessionManager::SessionRestrictions restrictions = PlatformMediaSessionManager::sharedManager().restrictions(mediaType);
+    PlatformMediaSessionManager::sharedManager().removeRestriction(mediaType, restrictions);
</ins><span class="cx"> 
</span><del>-    restrictions = MediaSessionManager::NoRestrictions;
</del><ins>+    restrictions = PlatformMediaSessionManager::NoRestrictions;
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;String&gt; restrictionsArray;
</span><span class="cx">     restrictionsString.split(',', false, restrictionsArray);
</span><span class="cx">     for (auto&amp; restrictionString : restrictionsArray) {
</span><span class="cx">         if (equalIgnoringCase(restrictionString, &quot;ConcurrentPlaybackNotPermitted&quot;))
</span><del>-            restrictions |= MediaSessionManager::ConcurrentPlaybackNotPermitted;
</del><ins>+            restrictions |= PlatformMediaSessionManager::ConcurrentPlaybackNotPermitted;
</ins><span class="cx">         if (equalIgnoringCase(restrictionString, &quot;InlineVideoPlaybackRestricted&quot;))
</span><del>-            restrictions |= MediaSessionManager::InlineVideoPlaybackRestricted;
</del><ins>+            restrictions |= PlatformMediaSessionManager::InlineVideoPlaybackRestricted;
</ins><span class="cx">         if (equalIgnoringCase(restrictionString, &quot;MetadataPreloadingNotPermitted&quot;))
</span><del>-            restrictions |= MediaSessionManager::MetadataPreloadingNotPermitted;
</del><ins>+            restrictions |= PlatformMediaSessionManager::MetadataPreloadingNotPermitted;
</ins><span class="cx">         if (equalIgnoringCase(restrictionString, &quot;AutoPreloadingNotPermitted&quot;))
</span><del>-            restrictions |= MediaSessionManager::AutoPreloadingNotPermitted;
</del><ins>+            restrictions |= PlatformMediaSessionManager::AutoPreloadingNotPermitted;
</ins><span class="cx">         if (equalIgnoringCase(restrictionString, &quot;BackgroundProcessPlaybackRestricted&quot;))
</span><del>-            restrictions |= MediaSessionManager::BackgroundProcessPlaybackRestricted;
</del><ins>+            restrictions |= PlatformMediaSessionManager::BackgroundProcessPlaybackRestricted;
</ins><span class="cx">         if (equalIgnoringCase(restrictionString, &quot;BackgroundTabPlaybackRestricted&quot;))
</span><del>-            restrictions |= MediaSessionManager::BackgroundTabPlaybackRestricted;
</del><ins>+            restrictions |= PlatformMediaSessionManager::BackgroundTabPlaybackRestricted;
</ins><span class="cx">         if (equalIgnoringCase(restrictionString, &quot;InterruptedPlaybackNotPermitted&quot;))
</span><del>-            restrictions |= MediaSessionManager::InterruptedPlaybackNotPermitted;
</del><ins>+            restrictions |= PlatformMediaSessionManager::InterruptedPlaybackNotPermitted;
</ins><span class="cx">     }
</span><del>-    MediaSessionManager::sharedManager().addRestriction(mediaType, restrictions);
</del><ins>+    PlatformMediaSessionManager::sharedManager().addRestriction(mediaType, restrictions);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Internals::setMediaElementRestrictions(HTMLMediaElement* element, const String&amp; restrictionsString, ExceptionCode&amp; ec)
</span><span class="lines">@@ -2718,7 +2718,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    MediaSessionManager::sharedManager().didReceiveRemoteControlCommand(command);
</del><ins>+    PlatformMediaSessionManager::sharedManager().didReceiveRemoteControlCommand(command);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool Internals::elementIsBlockingDisplaySleep(Element* element) const
</span><span class="lines">@@ -2759,14 +2759,14 @@
</span><span class="cx"> void Internals::simulateSystemSleep() const
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(VIDEO)
</span><del>-    MediaSessionManager::sharedManager().systemWillSleep();
</del><ins>+    PlatformMediaSessionManager::sharedManager().systemWillSleep();
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Internals::simulateSystemWake() const
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(VIDEO)
</span><del>-    MediaSessionManager::sharedManager().systemDidWake();
</del><ins>+    PlatformMediaSessionManager::sharedManager().systemDidWake();
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>