<!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>[161000] 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/161000">161000</a></dd>
<dt>Author</dt> <dd>eric.carlson@apple.com</dd>
<dt>Date</dt> <dd>2013-12-23 10:24:06 -0800 (Mon, 23 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>AudioSessionManager should be MediaSessionManager
https://bugs.webkit.org/show_bug.cgi?id=126087

Reviewed by Jer Noble.

No new tests, no change in functionality.

* WebCore.xcodeproj/project.pbxproj: Change file names.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement): MediaSessionManagerToken::create() takes a client
    interface instead of the media type.
* html/HTMLMediaElement.h:

* platform/audio/AudioSessionListener.h: Include &lt;wtf/Noncopyable.h&gt;.

AudioSessionManager.* -&gt; MediaSessionManager.*
* platform/audio/AudioSessionManager.cpp: Removed.
* platform/audio/AudioSessionManager.h: Removed.
* platform/audio/MediaSessionManager.cpp: Copied from Source/WebCore/platform/audio/AudioSessionManager.cpp.
(MediaSessionManagerToken::create):
(MediaSessionManagerToken::MediaSessionManagerToken):
(MediaSessionManagerToken::~MediaSessionManagerToken):
(MediaSessionManager::sharedManager):
(MediaSessionManager::MediaSessionManager):
(MediaSessionManager::has):
(MediaSessionManager::count):
(MediaSessionManager::addToken):
(MediaSessionManager::removeToken):
(MediaSessionManager::updateSessionState):
* platform/audio/MediaSessionManager.h: Copied from Source/WebCore/platform/audio/AudioSessionManager.h.

* platform/audio/mac/AudioDestinationMac.cpp:
(WebCore::AudioDestinationMac::AudioDestinationMac): MediaSessionManagerToken::create() takes a
    client interface instead of the media type.
* platform/audio/mac/AudioDestinationMac.h:

* platform/audio/mac/AudioSessionMac.cpp:
* platform/audio/mac/AudioSessionManagerMac.cpp: Removed.
* platform/audio/mac/MediaSessionManagerMac.cpp: Copied from Source/WebCore/platform/audio/mac/AudioSessionManagerMac.cpp.
(MediaSessionManager::updateSessionState):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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="#trunkSourceWebCorehtmlHTMLMediaElementh">trunk/Source/WebCore/html/HTMLMediaElement.h</a></li>
<li><a href="#trunkSourceWebCoreplatformaudioAudioSessionListenerh">trunk/Source/WebCore/platform/audio/AudioSessionListener.h</a></li>
<li><a href="#trunkSourceWebCoreplatformaudiomacAudioDestinationMaccpp">trunk/Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformaudiomacAudioDestinationMach">trunk/Source/WebCore/platform/audio/mac/AudioDestinationMac.h</a></li>
</ul>

<h3>Added 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>
<li><a href="#trunkSourceWebCoreplatformaudiomacMediaSessionManagerMaccpp">trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformaudioAudioSessionManagercpp">trunk/Source/WebCore/platform/audio/AudioSessionManager.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformaudioAudioSessionManagerh">trunk/Source/WebCore/platform/audio/AudioSessionManager.h</a></li>
<li><a href="#trunkSourceWebCoreplatformaudiomacAudioSessionManagerMaccpp">trunk/Source/WebCore/platform/audio/mac/AudioSessionManagerMac.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (160999 => 161000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-23 18:09:02 UTC (rev 160999)
+++ trunk/Source/WebCore/ChangeLog        2013-12-23 18:24:06 UTC (rev 161000)
</span><span class="lines">@@ -1,3 +1,47 @@
</span><ins>+2013-12-23  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+        AudioSessionManager should be MediaSessionManager
+        https://bugs.webkit.org/show_bug.cgi?id=126087
+
+        Reviewed by Jer Noble.
+
+        No new tests, no change in functionality.
+
+        * WebCore.xcodeproj/project.pbxproj: Change file names.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::HTMLMediaElement): MediaSessionManagerToken::create() takes a client
+            interface instead of the media type.
+        * html/HTMLMediaElement.h:
+
+        * platform/audio/AudioSessionListener.h: Include &lt;wtf/Noncopyable.h&gt;.
+        
+        AudioSessionManager.* -&gt; MediaSessionManager.*
+        * platform/audio/AudioSessionManager.cpp: Removed.
+        * platform/audio/AudioSessionManager.h: Removed.
+        * platform/audio/MediaSessionManager.cpp: Copied from Source/WebCore/platform/audio/AudioSessionManager.cpp.
+        (MediaSessionManagerToken::create):
+        (MediaSessionManagerToken::MediaSessionManagerToken):
+        (MediaSessionManagerToken::~MediaSessionManagerToken):
+        (MediaSessionManager::sharedManager):
+        (MediaSessionManager::MediaSessionManager):
+        (MediaSessionManager::has):
+        (MediaSessionManager::count):
+        (MediaSessionManager::addToken):
+        (MediaSessionManager::removeToken):
+        (MediaSessionManager::updateSessionState):
+        * platform/audio/MediaSessionManager.h: Copied from Source/WebCore/platform/audio/AudioSessionManager.h.
+
+        * platform/audio/mac/AudioDestinationMac.cpp:
+        (WebCore::AudioDestinationMac::AudioDestinationMac): MediaSessionManagerToken::create() takes a
+            client interface instead of the media type.
+        * platform/audio/mac/AudioDestinationMac.h:
+
+        * platform/audio/mac/AudioSessionMac.cpp:
+        * platform/audio/mac/AudioSessionManagerMac.cpp: Removed.
+        * platform/audio/mac/MediaSessionManagerMac.cpp: Copied from Source/WebCore/platform/audio/mac/AudioSessionManagerMac.cpp.
+        (MediaSessionManager::updateSessionState):
+
</ins><span class="cx"> 2013-12-23  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         webkit gtk 2.2.3 stable tarball compilation error
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (160999 => 161000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-12-23 18:09:02 UTC (rev 160999)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-12-23 18:24:06 UTC (rev 161000)
</span><span class="lines">@@ -331,6 +331,7 @@
</span><span class="cx">                 07DC5FD417D3EEE90099F890 /* JSRTCStatsResponseCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07DC5FD317D3EEE90099F890 /* JSRTCStatsResponseCustom.cpp */; };
</span><span class="cx">                 07E116B11489C9A100EC5ACE /* JSTextTrackCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07E116B01489C9A100EC5ACE /* JSTextTrackCustom.cpp */; };
</span><span class="cx">                 07E117071489EBEB00EC5ACE /* JSTextTrackCueCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07E117061489EBEB00EC5ACE /* JSTextTrackCueCustom.cpp */; };
</span><ins>+                07F944161864D046005D31CB /* MediaSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = CDAE8C081746B95700532D78 /* MediaSessionManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 07FFDE68181AED420072D409 /* MediaStreamTrackPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07FFDE66181AED420072D409 /* MediaStreamTrackPrivate.cpp */; };
</span><span class="cx">                 07FFDE69181AED420072D409 /* MediaStreamTrackPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 07FFDE67181AED420072D409 /* MediaStreamTrackPrivate.h */; };
</span><span class="cx">                 0806E57A12893045007CED32 /* SVGMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = 0806E57912893045007CED32 /* SVGMatrix.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -5364,7 +5365,7 @@
</span><span class="cx">                 CD5393D4175E018600C07123 /* JSMemoryInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = CD5393D2175E018600C07123 /* JSMemoryInfo.h */; };
</span><span class="cx">                 CD54A762180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD54A760180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.cpp */; };
</span><span class="cx">                 CD54A763180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CD54A761180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.h */; };
</span><del>-                CD54DE4717468B6F005E5B36 /* AudioSessionManagerMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD54DE4517468B6F005E5B36 /* AudioSessionManagerMac.cpp */; };
</del><ins>+                CD54DE4717468B6F005E5B36 /* MediaSessionManagerMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD54DE4517468B6F005E5B36 /* MediaSessionManagerMac.cpp */; };
</ins><span class="cx">                 CD54DE4B17469C6D005E5B36 /* AudioSessionMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD54DE4917469C6D005E5B36 /* AudioSessionMac.cpp */; };
</span><span class="cx">                 CD61FE671794AADB004101EB /* MediaSourceRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1A942E115B5CE2200D525D1 /* MediaSourceRegistry.cpp */; };
</span><span class="cx">                 CD61FE681794AADB004101EB /* MediaSourceRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = B1A942E215B5CE2200D525D1 /* MediaSourceRegistry.h */; };
</span><span class="lines">@@ -5413,7 +5414,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 /* AudioSessionManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDAE8C071746B95700532D78 /* AudioSessionManager.cpp */; };
</del><ins>+                CDAE8C091746B95700532D78 /* MediaSessionManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDAE8C071746B95700532D78 /* MediaSessionManager.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">                 CDC26B40160A8CC60026757B /* MockCDM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDC26B3C160A62B00026757B /* MockCDM.cpp */; };
</span><span class="lines">@@ -12481,7 +12482,7 @@
</span><span class="cx">                 CD54A75E180F535000B076C9 /* MediaSourcePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSourcePrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD54A760180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AudioTrackPrivateMediaSourceAVFObjC.cpp; path = objc/AudioTrackPrivateMediaSourceAVFObjC.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD54A761180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AudioTrackPrivateMediaSourceAVFObjC.h; path = objc/AudioTrackPrivateMediaSourceAVFObjC.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                CD54DE4517468B6F005E5B36 /* AudioSessionManagerMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioSessionManagerMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                CD54DE4517468B6F005E5B36 /* MediaSessionManagerMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaSessionManagerMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CD54DE4917469C6D005E5B36 /* AudioSessionMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioSessionMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD641EB11818F5ED00EE4C41 /* MediaSourcePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSourcePrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD641EB21818F5ED00EE4C41 /* SourceBufferPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceBufferPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -12553,8 +12554,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 /* AudioSessionManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioSessionManager.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                CDAE8C081746B95700532D78 /* AudioSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioSessionManager.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                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;; };
</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">@@ -21983,8 +21984,8 @@
</span><span class="cx">                                 CDA79823170A258300D45C55 /* AudioSession.cpp */,
</span><span class="cx">                                 CDA79821170A22DC00D45C55 /* AudioSession.h */,
</span><span class="cx">                                 CDA79822170A24F400D45C55 /* AudioSessionListener.h */,
</span><del>-                                CDAE8C071746B95700532D78 /* AudioSessionManager.cpp */,
-                                CDAE8C081746B95700532D78 /* AudioSessionManager.h */,
</del><ins>+                                CDAE8C071746B95700532D78 /* MediaSessionManager.cpp */,
+                                CDAE8C081746B95700532D78 /* MediaSessionManager.h */,
</ins><span class="cx">                                 FD31605312B026F700C1A359 /* AudioSourceProvider.h */,
</span><span class="cx">                                 FD62F52D145898D80094B0ED /* AudioSourceProviderClient.h */,
</span><span class="cx">                                 FD31605412B026F700C1A359 /* AudioUtilities.cpp */,
</span><span class="lines">@@ -22055,7 +22056,7 @@
</span><span class="cx">                                 FD3160B812B0272A00C1A359 /* AudioFileReaderMac.cpp */,
</span><span class="cx">                                 FD3160B912B0272A00C1A359 /* AudioFileReaderMac.h */,
</span><span class="cx">                                 CD54DE4917469C6D005E5B36 /* AudioSessionMac.cpp */,
</span><del>-                                CD54DE4517468B6F005E5B36 /* AudioSessionManagerMac.cpp */,
</del><ins>+                                CD54DE4517468B6F005E5B36 /* MediaSessionManagerMac.cpp */,
</ins><span class="cx">                                 FD3160BA12B0272A00C1A359 /* FFTFrameMac.cpp */,
</span><span class="cx">                         );
</span><span class="cx">                         path = mac;
</span><span class="lines">@@ -23871,6 +23872,7 @@
</span><span class="cx">                                 B2FA3D4F0AB75A6F000E5AC4 /* JSSVGAnimatedString.h in Headers */,
</span><span class="cx">                                 B2FA3D510AB75A6F000E5AC4 /* JSSVGAnimatedTransformList.h in Headers */,
</span><span class="cx">                                 076306E117E16089005A7C4E /* JSSourceInfo.h in Headers */,
</span><ins>+                                07F944161864D046005D31CB /* MediaSessionManager.h in Headers */,
</ins><span class="cx">                                 B2FA3D530AB75A6F000E5AC4 /* JSSVGAnimateElement.h in Headers */,
</span><span class="cx">                                 4496E39E1398136C003EE32A /* JSSVGAnimateMotionElement.h in Headers */,
</span><span class="cx">                                 B2FA3D550AB75A6F000E5AC4 /* JSSVGAnimateTransformElement.h in Headers */,
</span><span class="lines">@@ -25850,8 +25852,8 @@
</span><span class="cx">                                 CDA79824170A258300D45C55 /* AudioSession.cpp in Sources */,
</span><span class="cx">                                 CDA79827170A279100D45C55 /* AudioSessionIOS.mm in Sources */,
</span><span class="cx">                                 CD54DE4B17469C6D005E5B36 /* AudioSessionMac.cpp in Sources */,
</span><del>-                                CDAE8C091746B95700532D78 /* AudioSessionManager.cpp in Sources */,
-                                CD54DE4717468B6F005E5B36 /* AudioSessionManagerMac.cpp in Sources */,
</del><ins>+                                CDAE8C091746B95700532D78 /* MediaSessionManager.cpp in Sources */,
+                                CD54DE4717468B6F005E5B36 /* MediaSessionManagerMac.cpp in Sources */,
</ins><span class="cx">                                 FDB052DF1561A42C00B500D6 /* AudioSummingJunction.cpp in Sources */,
</span><span class="cx">                                 BE88E0D81715D2A200658D98 /* AudioTrack.cpp in Sources */,
</span><span class="cx">                                 BE88E0DB1715D2A200658D98 /* AudioTrackList.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (160999 => 161000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2013-12-23 18:09:02 UTC (rev 160999)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2013-12-23 18:24:06 UTC (rev 161000)
</span><span class="lines">@@ -138,7 +138,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if USE(AUDIO_SESSION)
</span><del>-#include &quot;AudioSessionManager.h&quot;
</del><ins>+#include &quot;MediaSessionManager.h&quot;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_CONTROLS_SCRIPT)
</span><span class="lines">@@ -342,7 +342,7 @@
</span><span class="cx">     , m_audioSourceNode(0)
</span><span class="cx"> #endif
</span><span class="cx"> #if USE(AUDIO_SESSION)
</span><del>-    , m_audioSessionManagerToken(AudioSessionManagerToken::create(tagName == videoTag ? AudioSessionManager::Video : AudioSessionManager::Audio))
</del><ins>+    , m_mediaSessionManagerToken(MediaSessionManagerToken::create(*this))
</ins><span class="cx"> #endif
</span><span class="cx">     , m_reportedExtraMemoryCost(0)
</span><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><span class="lines">@@ -5703,6 +5703,16 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if USE(AUDIO_SESSION)
+MediaSessionManager::MediaType HTMLMediaElement::mediaType() const
+{
+    if (hasTagName(HTMLNames::videoTag))
+        return MediaSessionManager::Video;
+
+    return MediaSessionManager::Audio;
</ins><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><ins>+}
+
</ins><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (160999 => 161000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.h        2013-12-23 18:09:02 UTC (rev 160999)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h        2013-12-23 18:24:06 UTC (rev 161000)
</span><span class="lines">@@ -53,11 +53,12 @@
</span><span class="cx"> #include &quot;MediaStream.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if USE(AUDIO_SESSION)
+#include &quot;MediaSessionManager.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-#if USE(AUDIO_SESSION)
-class AudioSessionManagerToken;
-#endif
</del><span class="cx"> #if ENABLE(WEB_AUDIO)
</span><span class="cx"> class AudioSourceProvider;
</span><span class="cx"> class MediaElementAudioSourceNode;
</span><span class="lines">@@ -113,6 +114,9 @@
</span><span class="cx"> #if USE(PLATFORM_TEXT_TRACK_MENU)
</span><span class="cx">     , public PlatformTextTrackMenuClient
</span><span class="cx"> #endif
</span><ins>+#if USE(AUDIO_SESSION)
+    , public MediaSessionManagerClient
+#endif
</ins><span class="cx"> {
</span><span class="cx"> public:
</span><span class="cx">     MediaPlayer* player() const { return m_player.get(); }
</span><span class="lines">@@ -691,6 +695,10 @@
</span><span class="cx">     bool ensureMediaControlsInjectedScript();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if USE(AUDIO_SESSION)
+    virtual MediaSessionManager::MediaType mediaType() const OVERRIDE;
+#endif
+
</ins><span class="cx">     Timer&lt;HTMLMediaElement&gt; m_loadTimer;
</span><span class="cx">     Timer&lt;HTMLMediaElement&gt; m_progressEventTimer;
</span><span class="cx">     Timer&lt;HTMLMediaElement&gt; m_playbackProgressTimer;
</span><span class="lines">@@ -846,7 +854,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if USE(AUDIO_SESSION)
</span><del>-    OwnPtr&lt;AudioSessionManagerToken&gt; m_audioSessionManagerToken;
</del><ins>+    std::unique_ptr&lt;MediaSessionManagerToken&gt; m_mediaSessionManagerToken;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;PageActivityAssertionToken&gt; m_activityToken;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioAudioSessionListenerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/AudioSessionListener.h (160999 => 161000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/AudioSessionListener.h        2013-12-23 18:09:02 UTC (rev 160999)
+++ trunk/Source/WebCore/platform/audio/AudioSessionListener.h        2013-12-23 18:24:06 UTC (rev 161000)
</span><span class="lines">@@ -28,6 +28,8 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(AUDIO_SESSION)
</span><span class="cx"> 
</span><ins>+#include &lt;wtf/Noncopyable.h&gt;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class AudioSessionListener {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioAudioSessionManagercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/audio/AudioSessionManager.cpp (160999 => 161000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/AudioSessionManager.cpp        2013-12-23 18:09:02 UTC (rev 160999)
+++ trunk/Source/WebCore/platform/audio/AudioSessionManager.cpp        2013-12-23 18:24:06 UTC (rev 161000)
</span><span class="lines">@@ -1,85 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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;AudioSessionManager.h&quot;
-
-#if USE(AUDIO_SESSION)
-
-using namespace WebCore;
-
-PassOwnPtr&lt;AudioSessionManagerToken&gt; AudioSessionManagerToken::create(AudioSessionManager::AudioType type)
-{
-    return adoptPtr(new AudioSessionManagerToken(type));
-}
-
-AudioSessionManagerToken::AudioSessionManagerToken(AudioSessionManager::AudioType type)
-    : m_type(type)
-{
-    AudioSessionManager::sharedManager().incrementCount(type);
-}
-
-AudioSessionManagerToken::~AudioSessionManagerToken()
-{
-    AudioSessionManager::sharedManager().decrementCount(m_type);
-}
-
-AudioSessionManager&amp; AudioSessionManager::sharedManager()
-{
-    DEFINE_STATIC_LOCAL(AudioSessionManager, manager, ());
-    return manager;
-}
-
-AudioSessionManager::AudioSessionManager()
-{
-}
-
-bool AudioSessionManager::has(AudioSessionManager::AudioType type)
-{
-    ASSERT(type &gt;= 0);
-    return m_typeCount.contains(type);
-}
-
-void AudioSessionManager::incrementCount(AudioSessionManager::AudioType type)
-{
-    ASSERT(type &gt;= 0);
-    m_typeCount.add(type);
-    updateSessionState();
-}
-
-void AudioSessionManager::decrementCount(AudioSessionManager::AudioType type)
-{
-    ASSERT(type &gt;= 0);
-    m_typeCount.remove(type);
-    updateSessionState();
-}
-
-#if !PLATFORM(MAC)
-void AudioSessionManager::updateSessionState()
-{
-}
-#endif
-
-#endif // USE(AUDIO_SESSION)
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioAudioSessionManagerh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/audio/AudioSessionManager.h (160999 => 161000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/AudioSessionManager.h        2013-12-23 18:09:02 UTC (rev 160999)
+++ trunk/Source/WebCore/platform/audio/AudioSessionManager.h        2013-12-23 18:24:06 UTC (rev 161000)
</span><span class="lines">@@ -1,77 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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 AudioSessionManager_h
-#define AudioSessionManager_h
-
-#if USE(AUDIO_SESSION)
-
-#include &quot;AudioSession.h&quot;
-#include &lt;wtf/HashCountedSet.h&gt;
-#include &lt;wtf/PassOwnPtr.h&gt;
-
-namespace WebCore {
-
-class AudioSessionManager {
-public:
-    static AudioSessionManager&amp; sharedManager();
-
-    enum AudioType {
-        None,
-        Video,
-        Audio,
-        WebAudio,
-    };
-
-    bool has(AudioType);
-
-protected:
-    friend class AudioSessionManagerToken;
-    void incrementCount(AudioType);
-    void decrementCount(AudioType);
-    
-private:
-    AudioSessionManager();
-
-    void updateSessionState();
-
-    HashCountedSet&lt;size_t&gt; m_typeCount;
-};
-
-class AudioSessionManagerToken {
-public:
-    static PassOwnPtr&lt;AudioSessionManagerToken&gt; create(AudioSessionManager::AudioType);
-    ~AudioSessionManagerToken();
-
-private:
-    AudioSessionManagerToken(AudioSessionManager::AudioType);
-
-    AudioSessionManager::AudioType m_type;
-};
-}
-
-#endif // USE(AUDIO_SESSION)
-
-#endif // AudioSessionManager_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioMediaSessionManagercpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/audio/MediaSessionManager.cpp (0 => 161000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/MediaSessionManager.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/audio/MediaSessionManager.cpp        2013-12-23 18:24:06 UTC (rev 161000)
</span><span class="lines">@@ -0,0 +1,105 @@
</span><ins>+/*
+ * Copyright (C) 2013 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;
+
+using namespace WebCore;
+
+
+std::unique_ptr&lt;MediaSessionManagerToken&gt; MediaSessionManagerToken::create(MediaSessionManagerClient&amp; client)
+{
+    return std::make_unique&lt;MediaSessionManagerToken&gt;(client);
+}
+
+MediaSessionManagerToken::MediaSessionManagerToken(MediaSessionManagerClient&amp; client)
+    : m_client(client)
+{
+    m_type = m_client.mediaType();
+    MediaSessionManager::sharedManager().addToken(*this);
+}
+
+MediaSessionManagerToken::~MediaSessionManagerToken()
+{
+    MediaSessionManager::sharedManager().removeToken(*this);
+}
+
+MediaSessionManager&amp; MediaSessionManager::sharedManager()
+{
+    DEFINE_STATIC_LOCAL(MediaSessionManager, manager, ());
+    return manager;
+}
+
+MediaSessionManager::MediaSessionManager()
+{
+}
+
+bool MediaSessionManager::has(MediaSessionManager::MediaType type) const
+{
+    ASSERT(type &gt;= MediaSessionManager::None &amp;&amp; type &lt;= MediaSessionManager::WebAudio);
+
+    for (auto it = m_tokens.begin(), end = m_tokens.end(); it != end; ++it) {
+        if ((*it)-&gt;mediaType() == type)
+            return true;
+    }
+    
+    return false;
+}
+
+int MediaSessionManager::count(MediaSessionManager::MediaType type) const
+{
+    ASSERT(type &gt;= MediaSessionManager::None &amp;&amp; type &lt;= MediaSessionManager::WebAudio);
+    
+    int count = 0;
+    for (auto it = m_tokens.begin(), end = m_tokens.end(); it != end; ++it) {
+        if ((*it)-&gt;mediaType() == type)
+            ++count;
+    }
+    
+    return count;
+}
+
+void MediaSessionManager::addToken(MediaSessionManagerToken&amp; token)
+{
+    m_tokens.append(&amp;token);
+    updateSessionState();
+}
+
+void MediaSessionManager::removeToken(MediaSessionManagerToken&amp; token)
+{
+    size_t index = m_tokens.find(&amp;token);
+    ASSERT(index != notFound);
+    if (index == notFound)
+        return;
+
+    m_tokens.remove(index);
+    updateSessionState();
+}
+
+#if !PLATFORM(MAC)
+void MediaSessionManager::updateSessionState()
+{
+}
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioMediaSessionManagerhfromrev160999trunkSourceWebCoreplatformaudioAudioSessionManagerh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/audio/MediaSessionManager.h (from rev 160999, trunk/Source/WebCore/platform/audio/AudioSessionManager.h) (0 => 161000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/MediaSessionManager.h                                (rev 0)
+++ trunk/Source/WebCore/platform/audio/MediaSessionManager.h        2013-12-23 18:24:06 UTC (rev 161000)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+/*
+ * Copyright (C) 2013 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 &lt;wtf/PassOwnPtr.h&gt;
+#include &lt;wtf/Vector.h&gt;
+
+namespace WebCore {
+
+class MediaSessionManagerToken;
+
+class MediaSessionManager {
+public:
+    static MediaSessionManager&amp; sharedManager();
+
+    enum MediaType {
+        None,
+        Video,
+        Audio,
+        WebAudio,
+    };
+
+    bool has(MediaType) const;
+    int count(MediaType) const;
+
+protected:
+    friend class MediaSessionManagerToken;
+    void addToken(MediaSessionManagerToken&amp;);
+    void removeToken(MediaSessionManagerToken&amp;);
+
+private:
+    MediaSessionManager();
+
+    void updateSessionState();
+
+    Vector&lt;MediaSessionManagerToken*&gt; m_tokens;
+};
+
+class MediaSessionManagerClient {
+    WTF_MAKE_NONCOPYABLE(MediaSessionManagerClient);
+public:
+    MediaSessionManagerClient() { }
+
+    virtual MediaSessionManager::MediaType mediaType() const = 0;
+
+protected:
+    virtual ~MediaSessionManagerClient() { }
+};
+
+class MediaSessionManagerToken {
+public:
+    static std::unique_ptr&lt;MediaSessionManagerToken&gt; create(MediaSessionManagerClient&amp;);
+
+    MediaSessionManagerToken(MediaSessionManagerClient&amp;);
+    ~MediaSessionManagerToken();
+
+    MediaSessionManager::MediaType mediaType() const { return m_type; }
+
+private:
+
+    MediaSessionManagerClient&amp; m_client;
+    MediaSessionManager::MediaType m_type;
+};
+
+}
+
+#endif // MediaSessionManager_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformaudiomacAudioDestinationMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp (160999 => 161000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp        2013-12-23 18:09:02 UTC (rev 160999)
+++ trunk/Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp        2013-12-23 18:24:06 UTC (rev 161000)
</span><span class="lines">@@ -33,9 +33,10 @@
</span><span class="cx"> #include &quot;AudioDestinationMac.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;AudioIOCallback.h&quot;
</span><del>-#include &quot;AudioSessionManager.h&quot;
</del><ins>+#include &quot;AudioSession.h&quot;
</ins><span class="cx"> #include &quot;FloatConversion.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><ins>+#include &quot;MediaSessionManager.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 class="lines">@@ -82,7 +83,7 @@
</span><span class="cx">     , m_renderBus(AudioBus::create(2, kBufferSize, false))
</span><span class="cx">     , m_sampleRate(sampleRate)
</span><span class="cx">     , m_isPlaying(false)
</span><del>-    , m_audioSessionManagerToken(AudioSessionManagerToken::create(AudioSessionManager::WebAudio))
</del><ins>+    , m_mediaSessionManagerToken(MediaSessionManagerToken::create(*this))
</ins><span class="cx"> {
</span><span class="cx">     // Open and initialize DefaultOutputUnit
</span><span class="cx">     AudioComponent comp;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudiomacAudioDestinationMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/mac/AudioDestinationMac.h (160999 => 161000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/mac/AudioDestinationMac.h        2013-12-23 18:09:02 UTC (rev 160999)
+++ trunk/Source/WebCore/platform/audio/mac/AudioDestinationMac.h        2013-12-23 18:24:06 UTC (rev 161000)
</span><span class="lines">@@ -31,17 +31,16 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;AudioBus.h&quot;
</span><span class="cx"> #include &quot;AudioDestination.h&quot;
</span><ins>+#include &quot;MediaSessionManager.h&quot;
</ins><span class="cx"> #include &lt;AudioUnit/AudioUnit.h&gt;
</span><span class="cx"> #include &lt;wtf/OwnPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class AudioSessionManagerToken;
-
</del><span class="cx"> // An AudioDestination using CoreAudio's default output AudioUnit
</span><span class="cx"> 
</span><del>-class AudioDestinationMac : public AudioDestination {
</del><ins>+class AudioDestinationMac : public AudioDestination, public MediaSessionManagerClient {
</ins><span class="cx"> public:
</span><span class="cx">     AudioDestinationMac(AudioIOCallback&amp;, float sampleRate);
</span><span class="cx">     virtual ~AudioDestinationMac();
</span><span class="lines">@@ -60,6 +59,8 @@
</span><span class="cx"> 
</span><span class="cx">     OSStatus render(UInt32 numberOfFrames, AudioBufferList* ioData);
</span><span class="cx"> 
</span><ins>+    virtual MediaSessionManager::MediaType mediaType() const { return MediaSessionManager::WebAudio; }
+
</ins><span class="cx">     AudioUnit m_outputUnit;
</span><span class="cx">     AudioIOCallback&amp; m_callback;
</span><span class="cx">     RefPtr&lt;AudioBus&gt; m_renderBus;
</span><span class="lines">@@ -68,7 +69,7 @@
</span><span class="cx">     bool m_isPlaying;
</span><span class="cx"> 
</span><span class="cx"> #if USE(AUDIO_SESSION)
</span><del>-    OwnPtr&lt;AudioSessionManagerToken&gt; m_audioSessionManagerToken;
</del><ins>+    std::unique_ptr&lt;MediaSessionManagerToken&gt; m_mediaSessionManagerToken;
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudiomacAudioSessionManagerMaccpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/audio/mac/AudioSessionManagerMac.cpp (160999 => 161000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/mac/AudioSessionManagerMac.cpp        2013-12-23 18:09:02 UTC (rev 160999)
+++ trunk/Source/WebCore/platform/audio/mac/AudioSessionManagerMac.cpp        2013-12-23 18:24:06 UTC (rev 161000)
</span><span class="lines">@@ -1,56 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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;AudioSessionManager.h&quot;
-
-#if USE(AUDIO_SESSION) &amp;&amp; PLATFORM(MAC)
-
-#include &quot;Logging.h&quot;
-#include &quot;Settings.h&quot;
-
-using namespace WebCore;
-
-static const size_t kWebAudioBufferSize = 128;
-
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
-static const size_t kLowPowerVideoBufferSize = 4096;
-#endif
-
-void AudioSessionManager::updateSessionState()
-{
-    LOG(Media, &quot;AudioSessionManager::updateSessionState() - types: Video(%d), Audio(%d), WebAudio(%d)&quot;, m_typeCount.count(Video), m_typeCount.count(Audio), m_typeCount.count(WebAudio));
-
-    if (has(WebAudio))
-        AudioSession::sharedSession().setPreferredBufferSize(kWebAudioBufferSize);
-    // FIXME: &lt;http://webkit.org/b/116725&gt; Figure out why enabling the code below
-    // causes media LayoutTests to fail on 10.8.
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
-    else if ((has(Video) || has(Audio)) &amp;&amp; Settings::lowPowerVideoAudioBufferSizeEnabled())
-        AudioSession::sharedSession().setPreferredBufferSize(kLowPowerVideoBufferSize);
-#endif
-}
-
-#endif // USE(AUDIO_SESSION) &amp;&amp; PLATFORM(MAC)
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformaudiomacMediaSessionManagerMaccppfromrev160999trunkSourceWebCoreplatformaudiomacAudioSessionManagerMaccpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp (from rev 160999, trunk/Source/WebCore/platform/audio/mac/AudioSessionManagerMac.cpp) (0 => 161000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp        2013-12-23 18:24:06 UTC (rev 161000)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+/*
+ * Copyright (C) 2013 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 USE(AUDIO_SESSION) &amp;&amp; PLATFORM(MAC)
+
+#include &quot;AudioSession.h&quot;
+#include &quot;Logging.h&quot;
+#include &quot;Settings.h&quot;
+
+using namespace WebCore;
+
+static const size_t kWebAudioBufferSize = 128;
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
+static const size_t kLowPowerVideoBufferSize = 4096;
+#endif
+
+void MediaSessionManager::updateSessionState()
+{
+    LOG(Media, &quot;MediaSessionManager::updateSessionState() - types: Video(%d), Audio(%d), WebAudio(%d)&quot;, count(Video), count(Audio), count(WebAudio));
+
+    if (has(WebAudio))
+        AudioSession::sharedSession().setPreferredBufferSize(kWebAudioBufferSize);
+    // FIXME: &lt;http://webkit.org/b/116725&gt; Figure out why enabling the code below
+    // causes media LayoutTests to fail on 10.8.
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
+    else if ((has(Video) || has(Audio)) &amp;&amp; Settings::lowPowerVideoAudioBufferSizeEnabled())
+        AudioSession::sharedSession().setPreferredBufferSize(kLowPowerVideoBufferSize);
+#endif
+}
+
+#endif // USE(AUDIO_SESSION) &amp;&amp; PLATFORM(MAC)
</ins></span></pre>
</div>
</div>

</body>
</html>