<!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>[202642] trunk/Source</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/202642">202642</a></dd>
<dt>Author</dt> <dd>jer.noble@apple.com</dd>
<dt>Date</dt> <dd>2016-06-29 12:29:07 -0700 (Wed, 29 Jun 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Adopt MediaRemote.
https://bugs.webkit.org/show_bug.cgi?id=159250

Reviewed by Eric Carlson.

Source/WebCore:

Adopt MediaRemote and use the framework to implement MediaSessionManageMac
and RemoteCommandListenerMac.

* WebCore.xcodeproj/project.pbxproj:
* platform/RemoteCommandListener.cpp:
* platform/audio/PlatformMediaSessionManager.cpp:
* platform/audio/cocoa/MediaSessionManagerCocoa.cpp: Renamed from Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp.
(PlatformMediaSessionManager::updateSessionState):
* platform/audio/mac/MediaSessionManagerMac.h: Added.
* platform/audio/mac/MediaSessionManagerMac.mm: Added.
(WebCore::PlatformMediaSessionManager::sharedManager):
(WebCore::PlatformMediaSessionManager::sharedManagerIfExists):
(WebCore::MediaSessionManagerMac::MediaSessionManagerMac):
(WebCore::MediaSessionManagerMac::~MediaSessionManagerMac):
(WebCore::MediaSessionManagerMac::sessionWillBeginPlayback):
(WebCore::MediaSessionManagerMac::removeSession):
(WebCore::MediaSessionManagerMac::sessionWillEndPlayback):
(WebCore::MediaSessionManagerMac::clientCharacteristicsChanged):
(WebCore::MediaSessionManagerMac::nowPlayingEligibleSession):
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
* platform/cocoa/SoftLinking.h:
* platform/mac/MediaRemoteSoftLink.cpp: Added.
* platform/mac/MediaRemoteSoftLink.h: Added.
* platform/mac/RemoteCommandListenerMac.h: Added.
(WebCore::RemoteCommandListenerMac::createWeakPtr):
* platform/mac/RemoteCommandListenerMac.mm: Added.
(WebCore::RemoteCommandListener::create):
(WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac):
(WebCore::RemoteCommandListenerMac::~RemoteCommandListenerMac):
* platform/spi/mac/MediaRemoteSPI.h: Added.

Source/WebKit2:

Add a sandbox exception allowing access to the mediaremoted XPC service.

* WebProcess/com.apple.WebProcess.sb.in:

Source/WTF:

Add USE_MEDIAREMOTE.

* wtf/Platform.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfPlatformh">trunk/Source/WTF/wtf/Platform.h</a></li>
<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="#trunkSourceWebCoreplatformRemoteCommandListenercpp">trunk/Source/WebCore/platform/RemoteCommandListener.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformaudioPlatformMediaSessionManagercpp">trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformcocoaSoftLinkingh">trunk/Source/WebCore/platform/cocoa/SoftLinking.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcesscomappleWebProcesssbin">trunk/Source/WebKit2/WebProcess/com.apple.WebProcess.sb.in</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/Source/WebCore/platform/audio/cocoa/</li>
<li><a href="#trunkSourceWebCoreplatformaudiococoaMediaSessionManagerCocoacpp">trunk/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformaudiomacMediaSessionManagerMach">trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.h</a></li>
<li><a href="#trunkSourceWebCoreplatformaudiomacMediaSessionManagerMacmm">trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacMediaRemoteSoftLinkcpp">trunk/Source/WebCore/platform/mac/MediaRemoteSoftLink.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmacMediaRemoteSoftLinkh">trunk/Source/WebCore/platform/mac/MediaRemoteSoftLink.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacRemoteCommandListenerMach">trunk/Source/WebCore/platform/mac/RemoteCommandListenerMac.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacRemoteCommandListenerMacmm">trunk/Source/WebCore/platform/mac/RemoteCommandListenerMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformspimacMediaRemoteSPIh">trunk/Source/WebCore/platform/spi/mac/MediaRemoteSPI.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformaudiomacMediaSessionManagerMaccpp">trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (202641 => 202642)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2016-06-29 19:22:59 UTC (rev 202641)
+++ trunk/Source/WTF/ChangeLog        2016-06-29 19:29:07 UTC (rev 202642)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-06-29  Jer Noble  &lt;jer.noble@apple.com&gt;
+
+        Adopt MediaRemote.
+        https://bugs.webkit.org/show_bug.cgi?id=159250
+
+        Reviewed by Eric Carlson.
+
+        Add USE_MEDIAREMOTE.
+
+        * wtf/Platform.h:
+
</ins><span class="cx"> 2016-06-28  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r202580.
</span></span></pre></div>
<a id="trunkSourceWTFwtfPlatformh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Platform.h (202641 => 202642)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Platform.h        2016-06-29 19:22:59 UTC (rev 202641)
+++ trunk/Source/WTF/wtf/Platform.h        2016-06-29 19:29:07 UTC (rev 202642)
</span><span class="lines">@@ -1212,4 +1212,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
+#define USE_MEDIAREMOTE 1
+#endif
+
</ins><span class="cx"> #endif /* WTF_Platform_h */
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (202641 => 202642)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-06-29 19:22:59 UTC (rev 202641)
+++ trunk/Source/WebCore/ChangeLog        2016-06-29 19:29:07 UTC (rev 202642)
</span><span class="lines">@@ -1,5 +1,43 @@
</span><span class="cx"> 2016-06-29  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Adopt MediaRemote.
+        https://bugs.webkit.org/show_bug.cgi?id=159250
+
+        Reviewed by Eric Carlson.
+
+        Adopt MediaRemote and use the framework to implement MediaSessionManageMac
+        and RemoteCommandListenerMac.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/RemoteCommandListener.cpp:
+        * platform/audio/PlatformMediaSessionManager.cpp:
+        * platform/audio/cocoa/MediaSessionManagerCocoa.cpp: Renamed from Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp.
+        (PlatformMediaSessionManager::updateSessionState):
+        * platform/audio/mac/MediaSessionManagerMac.h: Added.
+        * platform/audio/mac/MediaSessionManagerMac.mm: Added.
+        (WebCore::PlatformMediaSessionManager::sharedManager):
+        (WebCore::PlatformMediaSessionManager::sharedManagerIfExists):
+        (WebCore::MediaSessionManagerMac::MediaSessionManagerMac):
+        (WebCore::MediaSessionManagerMac::~MediaSessionManagerMac):
+        (WebCore::MediaSessionManagerMac::sessionWillBeginPlayback):
+        (WebCore::MediaSessionManagerMac::removeSession):
+        (WebCore::MediaSessionManagerMac::sessionWillEndPlayback):
+        (WebCore::MediaSessionManagerMac::clientCharacteristicsChanged):
+        (WebCore::MediaSessionManagerMac::nowPlayingEligibleSession):
+        (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
+        * platform/cocoa/SoftLinking.h:
+        * platform/mac/MediaRemoteSoftLink.cpp: Added.
+        * platform/mac/MediaRemoteSoftLink.h: Added.
+        * platform/mac/RemoteCommandListenerMac.h: Added.
+        (WebCore::RemoteCommandListenerMac::createWeakPtr):
+        * platform/mac/RemoteCommandListenerMac.mm: Added.
+        (WebCore::RemoteCommandListener::create):
+        (WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac):
+        (WebCore::RemoteCommandListenerMac::~RemoteCommandListenerMac):
+        * platform/spi/mac/MediaRemoteSPI.h: Added.
+
+2016-06-29  Jer Noble  &lt;jer.noble@apple.com&gt;
+
</ins><span class="cx">         Cannot clear a MediaSource SourceBuffer in Safari 9 and WebKit nightly
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=159230
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (202641 => 202642)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-06-29 19:22:59 UTC (rev 202641)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-06-29 19:29:07 UTC (rev 202642)
</span><span class="lines">@@ -319,7 +319,7 @@
</span><span class="cx">                 07E3DFD11A9E786500764CA8 /* MediaPlaybackTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 07E3DFD01A9E786500764CA8 /* MediaPlaybackTarget.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 07E9E12E18F5E2760011A3A4 /* InbandMetadataTextTrackPrivateAVF.h in Headers */ = {isa = PBXBuildFile; fileRef = 07E9E12D18F5E2760011A3A4 /* InbandMetadataTextTrackPrivateAVF.h */; };
</span><span class="cx">                 07E9E13018F62B370011A3A4 /* InbandMetadataTextTrackPrivateAVF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07E9E12F18F62B370011A3A4 /* InbandMetadataTextTrackPrivateAVF.cpp */; };
</span><del>-                07EDC3EE1AACB75D00983EB5 /* MediaSessionManagerMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07EDC3ED1AACB75D00983EB5 /* MediaSessionManagerMac.cpp */; };
</del><ins>+                07EDC3EE1AACB75D00983EB5 /* MediaSessionManagerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07EDC3ED1AACB75D00983EB5 /* MediaSessionManagerMac.mm */; };
</ins><span class="cx">                 07EE76EB1BE96DB000F89133 /* MockRealtimeVideoSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07EE76E91BE96DB000F89133 /* MockRealtimeVideoSource.cpp */; };
</span><span class="cx">                 07EE76EC1BE96DB000F89133 /* MockRealtimeVideoSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 07EE76EA1BE96DB000F89133 /* MockRealtimeVideoSource.h */; };
</span><span class="cx">                 07EE76EF1BEA619800F89133 /* MockRealtimeVideoSourceMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 07EE76ED1BEA619800F89133 /* MockRealtimeVideoSourceMac.h */; };
</span><span class="lines">@@ -6127,6 +6127,7 @@
</span><span class="cx">                 CD641EB41818F5ED00EE4C41 /* SourceBufferPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = CD641EB21818F5ED00EE4C41 /* SourceBufferPrivate.h */; };
</span><span class="cx">                 CD641EBF1819B36000EE4C41 /* MediaTimeAVFoundation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD641EBD1819B35900EE4C41 /* MediaTimeAVFoundation.cpp */; };
</span><span class="cx">                 CD641EC01819B36000EE4C41 /* MediaTimeAVFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = CD641EBE1819B35900EE4C41 /* MediaTimeAVFoundation.h */; };
</span><ins>+                CD669D681D23364B004D1866 /* MediaSessionManagerCocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD669D661D232DFF004D1866 /* MediaSessionManagerCocoa.cpp */; };
</ins><span class="cx">                 CD7D33431C7A123F00041293 /* PixelBufferConformerCV.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD7D33411C7A123F00041293 /* PixelBufferConformerCV.cpp */; };
</span><span class="cx">                 CD7D33441C7A123F00041293 /* PixelBufferConformerCV.h in Headers */ = {isa = PBXBuildFile; fileRef = CD7D33421C7A123F00041293 /* PixelBufferConformerCV.h */; };
</span><span class="cx">                 CD7D33471C7A16BF00041293 /* CoreVideoSoftLink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD7D33451C7A16BF00041293 /* CoreVideoSoftLink.cpp */; };
</span><span class="lines">@@ -6142,6 +6143,11 @@
</span><span class="cx">                 CD8203111395ACE700F956C6 /* WebWindowAnimation.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD82030F1395ACE700F956C6 /* WebWindowAnimation.mm */; };
</span><span class="cx">                 CD8A7BBB197735FE00CBD643 /* AudioSourceProviderAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD8A7BB9197735FE00CBD643 /* AudioSourceProviderAVFObjC.mm */; };
</span><span class="cx">                 CD8A7BBC197735FE00CBD643 /* AudioSourceProviderAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8A7BBA197735FE00CBD643 /* AudioSourceProviderAVFObjC.h */; };
</span><ins>+                CD8ACA881D237AA200ECC59E /* RemoteCommandListenerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD8ACA861D237AA200ECC59E /* RemoteCommandListenerMac.mm */; };
+                CD8ACA891D237AA200ECC59E /* RemoteCommandListenerMac.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8ACA871D237AA200ECC59E /* RemoteCommandListenerMac.h */; };
+                CD8ACA8B1D23946400ECC59E /* MediaRemoteSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8ACA8A1D23946400ECC59E /* MediaRemoteSPI.h */; };
+                CD8ACA8E1D23971900ECC59E /* MediaRemoteSoftLink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD8ACA8C1D23971900ECC59E /* MediaRemoteSoftLink.cpp */; };
+                CD8ACA8F1D23971900ECC59E /* MediaRemoteSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8ACA8D1D23971900ECC59E /* MediaRemoteSoftLink.h */; };
</ins><span class="cx">                 CD8B5A42180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD8B5A40180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.mm */; };
</span><span class="cx">                 CD8B5A43180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8B5A41180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.h */; };
</span><span class="cx">                 CD8B5A46180DFF4E008B8E65 /* VideoTrackMediaSource.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8B5A45180DFF4E008B8E65 /* VideoTrackMediaSource.h */; };
</span><span class="lines">@@ -7786,7 +7792,7 @@
</span><span class="cx">                 07E3DFD01A9E786500764CA8 /* MediaPlaybackTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlaybackTarget.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 07E9E12D18F5E2760011A3A4 /* InbandMetadataTextTrackPrivateAVF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InbandMetadataTextTrackPrivateAVF.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 07E9E12F18F62B370011A3A4 /* InbandMetadataTextTrackPrivateAVF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InbandMetadataTextTrackPrivateAVF.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                07EDC3ED1AACB75D00983EB5 /* MediaSessionManagerMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaSessionManagerMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                07EDC3ED1AACB75D00983EB5 /* MediaSessionManagerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MediaSessionManagerMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 07EE76E91BE96DB000F89133 /* MockRealtimeVideoSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MockRealtimeVideoSource.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 07EE76EA1BE96DB000F89133 /* MockRealtimeVideoSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MockRealtimeVideoSource.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 07EE76ED1BEA619800F89133 /* MockRealtimeVideoSourceMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MockRealtimeVideoSourceMac.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -14185,6 +14191,8 @@
</span><span class="cx">                 CD641EBD1819B35900EE4C41 /* MediaTimeAVFoundation.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MediaTimeAVFoundation.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD641EBE1819B35900EE4C41 /* MediaTimeAVFoundation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaTimeAVFoundation.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD641EC7181ED60100EE4C41 /* MediaSample.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaSample.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                CD669D661D232DFF004D1866 /* MediaSessionManagerCocoa.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MediaSessionManagerCocoa.cpp; path = cocoa/MediaSessionManagerCocoa.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CD669D671D232E10004D1866 /* MediaSessionManagerMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSessionManagerMac.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CD7D33411C7A123F00041293 /* PixelBufferConformerCV.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PixelBufferConformerCV.cpp; path = ../cv/PixelBufferConformerCV.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD7D33421C7A123F00041293 /* PixelBufferConformerCV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PixelBufferConformerCV.h; path = ../cv/PixelBufferConformerCV.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD7D33451C7A16BF00041293 /* CoreVideoSoftLink.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CoreVideoSoftLink.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -14201,6 +14209,11 @@
</span><span class="cx">                 CD82030F1395ACE700F956C6 /* WebWindowAnimation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebWindowAnimation.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD8A7BB9197735FE00CBD643 /* AudioSourceProviderAVFObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AudioSourceProviderAVFObjC.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD8A7BBA197735FE00CBD643 /* AudioSourceProviderAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioSourceProviderAVFObjC.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                CD8ACA861D237AA200ECC59E /* RemoteCommandListenerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteCommandListenerMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CD8ACA871D237AA200ECC59E /* RemoteCommandListenerMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteCommandListenerMac.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CD8ACA8A1D23946400ECC59E /* MediaRemoteSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaRemoteSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CD8ACA8C1D23971900ECC59E /* MediaRemoteSoftLink.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaRemoteSoftLink.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CD8ACA8D1D23971900ECC59E /* MediaRemoteSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaRemoteSoftLink.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CD8B5A40180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = VideoTrackPrivateMediaSourceAVFObjC.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD8B5A41180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoTrackPrivateMediaSourceAVFObjC.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD8B5A44180DD8D6008B8E65 /* VideoTrackMediaSource.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = VideoTrackMediaSource.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -18072,6 +18085,8 @@
</span><span class="cx">                                 06E81ED60AB5D5E900C87837 /* LocalCurrentGraphicsContext.h */,
</span><span class="cx">                                 06E81EEB0AB5DA9700C87837 /* LocalCurrentGraphicsContext.mm */,
</span><span class="cx">                                 1402645D0AFDC19B005919E2 /* LoggingMac.mm */,
</span><ins>+                                CD8ACA8C1D23971900ECC59E /* MediaRemoteSoftLink.cpp */,
+                                CD8ACA8D1D23971900ECC59E /* MediaRemoteSoftLink.h */,
</ins><span class="cx">                                 93500F3113FDE3BE0099EC24 /* NSScrollerImpDetails.h */,
</span><span class="cx">                                 52F52E1014A0134F00ACC397 /* NSScrollerImpDetails.mm */,
</span><span class="cx">                                 4B2709810AF2E5E00065127F /* PasteboardMac.mm */,
</span><span class="lines">@@ -18087,6 +18102,8 @@
</span><span class="cx">                                 4634592B1AC2271000ECB71C /* PowerObserverMac.cpp */,
</span><span class="cx">                                 46DBB64E1AB8C96F00D9A813 /* PowerObserverMac.h */,
</span><span class="cx">                                 0081FEFE16B0A2B6008AAA7A /* PublicSuffixMac.mm */,
</span><ins>+                                CD8ACA861D237AA200ECC59E /* RemoteCommandListenerMac.mm */,
+                                CD8ACA871D237AA200ECC59E /* RemoteCommandListenerMac.h */,
</ins><span class="cx">                                 BCAE1FA512939DB7004CB026 /* ScrollAnimatorMac.h */,
</span><span class="cx">                                 BC51156D12B1749C00C96754 /* ScrollAnimatorMac.mm */,
</span><span class="cx">                                 BC8B853C0E7C7F1100AB6984 /* ScrollbarThemeMac.h */,
</span><span class="lines">@@ -19231,6 +19248,7 @@
</span><span class="cx">                                 07F0B97B1AC5DB4600E535D9 /* AVFoundationSPI.h */,
</span><span class="cx">                                 2D59F1BE1A0044C6001F3D29 /* DataDetectorsSPI.h */,
</span><span class="cx">                                 2D413F601A187A3F0041A521 /* LookupSPI.h */,
</span><ins>+                                CD8ACA8A1D23946400ECC59E /* MediaRemoteSPI.h */,
</ins><span class="cx">                                 2D77AC261BF2B9860072470A /* NSAccessibilitySPI.h */,
</span><span class="cx">                                 2D77AC271BF2B9860072470A /* NSApplicationSPI.h */,
</span><span class="cx">                                 2DB9C4A91B3231F40070F27F /* NSEventSPI.h */,
</span><span class="lines">@@ -23342,6 +23360,14 @@
</span><span class="cx">                         name = MediaSource;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><ins>+                CD669D651D232DF4004D1866 /* cocoa */ = {
+                        isa = PBXGroup;
+                        children = (
+                                CD669D661D232DFF004D1866 /* MediaSessionManagerCocoa.cpp */,
+                        );
+                        name = cocoa;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx">                 CD9A37F517C7D93600C5FA7A /* mediacontrols */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -25042,6 +25068,7 @@
</span><span class="cx">                 FD31604012B026A300C1A359 /* audio */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                CD669D651D232DF4004D1866 /* cocoa */,
</ins><span class="cx">                                 CD0EEE0D14743E48003EAFA2 /* ios */,
</span><span class="cx">                                 FD3160B012B0270700C1A359 /* mac */,
</span><span class="cx">                                 FD31604412B026F700C1A359 /* AudioArray.h */,
</span><span class="lines">@@ -25144,7 +25171,8 @@
</span><span class="cx">                                 CDC734121977896C0046BFC5 /* CARingBuffer.cpp */,
</span><span class="cx">                                 CDC734131977896C0046BFC5 /* CARingBuffer.h */,
</span><span class="cx">                                 FD3160BA12B0272A00C1A359 /* FFTFrameMac.cpp */,
</span><del>-                                07EDC3ED1AACB75D00983EB5 /* MediaSessionManagerMac.cpp */,
</del><ins>+                                07EDC3ED1AACB75D00983EB5 /* MediaSessionManagerMac.mm */,
+                                CD669D671D232E10004D1866 /* MediaSessionManagerMac.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = mac;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -26460,6 +26488,7 @@
</span><span class="cx">                                 93F199E508245E59001E9ABC /* HTMLCanvasElement.h in Headers */,
</span><span class="cx">                                 A8DF3FD0097FA0FC0052981B /* HTMLCollection.h in Headers */,
</span><span class="cx">                                 977B3865122883E900B81FF8 /* HTMLConstructionSite.h in Headers */,
</span><ins>+                                CD8ACA8F1D23971900ECC59E /* MediaRemoteSoftLink.h in Headers */,
</ins><span class="cx">                                 7C3E510A18DF8F3500C112F7 /* HTMLConverter.h in Headers */,
</span><span class="cx">                                 83120C711C56F3FB001CB112 /* HTMLDataElement.h in Headers */,
</span><span class="cx">                                 F5C041DB0FFCA7CE00839D4A /* HTMLDataListElement.h in Headers */,
</span><span class="lines">@@ -27078,6 +27107,7 @@
</span><span class="cx">                                 9BDA64D81B975CF2009C4387 /* JSShadowRoot.h in Headers */,
</span><span class="cx">                                 CD9DE17B17AAC75B00EA386D /* JSSourceBuffer.h in Headers */,
</span><span class="cx">                                 CD9DE17D17AAC75B00EA386D /* JSSourceBufferList.h in Headers */,
</span><ins>+                                CD8ACA8B1D23946400ECC59E /* MediaRemoteSPI.h in Headers */,
</ins><span class="cx">                                 076306E117E16089005A7C4E /* JSSourceInfo.h in Headers */,
</span><span class="cx">                                 AA7FEEAD16A4E74B004C0C33 /* JSSpeechSynthesis.h in Headers */,
</span><span class="cx">                                 AA2A5AD216A4860A00976A25 /* JSSpeechSynthesisEvent.h in Headers */,
</span><span class="lines">@@ -28800,6 +28830,7 @@
</span><span class="cx">                                 CDC979F51C498C0900DB50D4 /* WebCoreNSErrorExtras.h in Headers */,
</span><span class="cx">                                 934D9BA70B8C1175007B42A9 /* WebCoreNSStringExtras.h in Headers */,
</span><span class="cx">                                 C5B4C24D1509236C00A6EF37 /* WebCoreNSURLExtras.h in Headers */,
</span><ins>+                                CD8ACA891D237AA200ECC59E /* RemoteCommandListenerMac.h in Headers */,
</ins><span class="cx">                                 CD225C0C1C46FBF400140761 /* WebCoreNSURLSession.h in Headers */,
</span><span class="cx">                                 DD05FE0D0B8BA3C6009ACDFE /* WebCoreObjCExtras.h in Headers */,
</span><span class="cx">                                 EDEC98030AED7E170059137F /* WebCorePrefix.h in Headers */,
</span><span class="lines">@@ -29652,6 +29683,7 @@
</span><span class="cx">                                 BC772B3D0C4EA91E0083285F /* CSSParser.cpp in Sources */,
</span><span class="cx">                                 BC02A5400E099C5A004B6D2B /* CSSParserValues.cpp in Sources */,
</span><span class="cx">                                 977B3862122883E900B81FF8 /* CSSPreloadScanner.cpp in Sources */,
</span><ins>+                                CD669D681D23364B004D1866 /* MediaSessionManagerCocoa.cpp in Sources */,
</ins><span class="cx">                                 A80E6D050A1989CA007FB8C5 /* CSSPrimitiveValue.cpp in Sources */,
</span><span class="cx">                                 A80E6CF70A1989CA007FB8C5 /* CSSProperty.cpp in Sources */,
</span><span class="cx">                                 78D02BC5154A18DF00B62D05 /* CSSPropertyAnimation.cpp in Sources */,
</span><span class="lines">@@ -31286,7 +31318,7 @@
</span><span class="cx">                                 C96F5EC61B5872260091EA9D /* MediaSessionInterruptionProviderMac.mm in Sources */,
</span><span class="cx">                                 C90F65551B2253B1002163A1 /* MediaSessionManager.cpp in Sources */,
</span><span class="cx">                                 07638A9A1884487200E15A1B /* MediaSessionManagerIOS.mm in Sources */,
</span><del>-                                07EDC3EE1AACB75D00983EB5 /* MediaSessionManagerMac.cpp in Sources */,
</del><ins>+                                07EDC3EE1AACB75D00983EB5 /* MediaSessionManagerMac.mm in Sources */,
</ins><span class="cx">                                 CD3A495E17A9D01B00274E42 /* MediaSource.cpp in Sources */,
</span><span class="cx">                                 CDC8B5A6180474F70016E685 /* MediaSourcePrivateAVFObjC.mm in Sources */,
</span><span class="cx">                                 CD61FE671794AADB004101EB /* MediaSourceRegistry.cpp in Sources */,
</span><span class="lines">@@ -31390,6 +31422,7 @@
</span><span class="cx">                                 1A569D130D7E2B82007C3983 /* objc_class.mm in Sources */,
</span><span class="cx">                                 1A569D160D7E2B82007C3983 /* objc_instance.mm in Sources */,
</span><span class="cx">                                 1A569D180D7E2B82007C3983 /* objc_runtime.mm in Sources */,
</span><ins>+                                CD8ACA881D237AA200ECC59E /* RemoteCommandListenerMac.mm in Sources */,
</ins><span class="cx">                                 1A569D1A0D7E2B82007C3983 /* objc_utility.mm in Sources */,
</span><span class="cx">                                 1CF6BDFB0E9BB26A0025E1CD /* ObjCEventListener.mm in Sources */,
</span><span class="cx">                                 1CF6BE140E9BB4670025E1CD /* ObjCNodeFilterCondition.mm in Sources */,
</span><span class="lines">@@ -32199,6 +32232,7 @@
</span><span class="cx">                                 7AA3A699194A64E7001CBD24 /* TileController.cpp in Sources */,
</span><span class="cx">                                 1F72BF0A187FD4490009BCB3 /* TileControllerMemoryHandlerIOS.cpp in Sources */,
</span><span class="cx">                                 7AA3A6A3194B5C22001CBD24 /* TileCoverageMap.cpp in Sources */,
</span><ins>+                                CD8ACA8E1D23971900ECC59E /* MediaRemoteSoftLink.cpp in Sources */,
</ins><span class="cx">                                 7AA3A69B194A64E7001CBD24 /* TileGrid.cpp in Sources */,
</span><span class="cx">                                 498770F21242C535002226BA /* TilingData.cpp in Sources */,
</span><span class="cx">                                 F55B3DDB1251F12D003EF269 /* TimeInputType.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformRemoteCommandListenercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/RemoteCommandListener.cpp (202641 => 202642)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/RemoteCommandListener.cpp        2016-06-29 19:22:59 UTC (rev 202641)
+++ trunk/Source/WebCore/platform/RemoteCommandListener.cpp        2016-06-29 19:29:07 UTC (rev 202642)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-#if !PLATFORM(IOS)
</del><ins>+#if !PLATFORM(IOS) &amp;&amp; !PLATFORM(MAC)
</ins><span class="cx"> std::unique_ptr&lt;RemoteCommandListener&gt; RemoteCommandListener::create(RemoteCommandListenerClient&amp; client)
</span><span class="cx"> {
</span><span class="cx">     return std::make_unique&lt;RemoteCommandListener&gt;(client);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioPlatformMediaSessionManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp (202641 => 202642)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp        2016-06-29 19:22:59 UTC (rev 202641)
+++ trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp        2016-06-29 19:29:07 UTC (rev 202642)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-#if !PLATFORM(IOS)
</del><ins>+#if !PLATFORM(IOS) &amp;&amp; !PLATFORM(MAC)
</ins><span class="cx"> static PlatformMediaSessionManager* platformMediaSessionManager = nullptr;
</span><span class="cx"> 
</span><span class="cx"> PlatformMediaSessionManager&amp; PlatformMediaSessionManager::sharedManager()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudiococoaMediaSessionManagerCocoacppfromrev202641trunkSourceWebCoreplatformaudiomacMediaSessionManagerMaccpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.cpp (from rev 202641, trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp) (0 => 202642)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.cpp        2016-06-29 19:29:07 UTC (rev 202642)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+/*
+ * Copyright (C) 2013-2014 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 USE(AUDIO_SESSION)
+
+#include &quot;AudioSession.h&quot;
+#include &quot;Logging.h&quot;
+#include &quot;Settings.h&quot;
+
+using namespace WebCore;
+
+static const size_t kWebAudioBufferSize = 128;
+static const size_t kLowPowerVideoBufferSize = 4096;
+
+void PlatformMediaSessionManager::updateSessionState()
+{
+    LOG(Media, &quot;PlatformMediaSessionManager::updateSessionState() - types: Video(%d), Audio(%d), WebAudio(%d)&quot;, count(PlatformMediaSession::Video), count(PlatformMediaSession::Audio), count(PlatformMediaSession::WebAudio));
+
+    if (has(PlatformMediaSession::WebAudio))
+        AudioSession::sharedSession().setPreferredBufferSize(kWebAudioBufferSize);
+    else if ((has(PlatformMediaSession::Video) || has(PlatformMediaSession::Audio)) &amp;&amp; Settings::lowPowerVideoAudioBufferSizeEnabled()) {
+        // FIXME: &lt;http://webkit.org/b/116725&gt; Figure out why enabling the code below
+        // causes media LayoutTests to fail on 10.8.
+
+        size_t bufferSize;
+        if (m_audioHardwareListener &amp;&amp; m_audioHardwareListener-&gt;outputDeviceSupportsLowPowerMode())
+            bufferSize = kLowPowerVideoBufferSize;
+        else
+            bufferSize = kWebAudioBufferSize;
+
+        AudioSession::sharedSession().setPreferredBufferSize(bufferSize);
+    }
+
+#if PLATFORM(IOS)
+    if (!Settings::shouldManageAudioSessionCategory())
+        return;
+
+    if (has(PlatformMediaSession::Video) || has(PlatformMediaSession::Audio)) {
+        if (canProduceAudio())
+            AudioSession::sharedSession().setCategory(AudioSession::MediaPlayback);
+        else
+            AudioSession::sharedSession().setCategory(AudioSession::AmbientSound);
+    } else if (has(PlatformMediaSession::WebAudio))
+        AudioSession::sharedSession().setCategory(AudioSession::AmbientSound);
+#endif
+}
+
+#endif // USE(AUDIO_SESSION)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformaudiomacMediaSessionManagerMaccpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp (202641 => 202642)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp        2016-06-29 19:22:59 UTC (rev 202641)
+++ trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp        2016-06-29 19:29:07 UTC (rev 202642)
</span><span class="lines">@@ -1,74 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013-2014 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 USE(AUDIO_SESSION)
-
-#include &quot;AudioSession.h&quot;
-#include &quot;Logging.h&quot;
-#include &quot;Settings.h&quot;
-
-using namespace WebCore;
-
-static const size_t kWebAudioBufferSize = 128;
-static const size_t kLowPowerVideoBufferSize = 4096;
-
-void PlatformMediaSessionManager::updateSessionState()
-{
-    LOG(Media, &quot;PlatformMediaSessionManager::updateSessionState() - types: Video(%d), Audio(%d), WebAudio(%d)&quot;, count(PlatformMediaSession::Video), count(PlatformMediaSession::Audio), count(PlatformMediaSession::WebAudio));
-
-    if (has(PlatformMediaSession::WebAudio))
-        AudioSession::sharedSession().setPreferredBufferSize(kWebAudioBufferSize);
-    else if ((has(PlatformMediaSession::Video) || has(PlatformMediaSession::Audio)) &amp;&amp; Settings::lowPowerVideoAudioBufferSizeEnabled()) {
-        // FIXME: &lt;http://webkit.org/b/116725&gt; Figure out why enabling the code below
-        // causes media LayoutTests to fail on 10.8.
-
-        size_t bufferSize;
-        if (m_audioHardwareListener &amp;&amp; m_audioHardwareListener-&gt;outputDeviceSupportsLowPowerMode())
-            bufferSize = kLowPowerVideoBufferSize;
-        else
-            bufferSize = kWebAudioBufferSize;
-
-        AudioSession::sharedSession().setPreferredBufferSize(bufferSize);
-    }
-
-#if PLATFORM(IOS)
-    if (!Settings::shouldManageAudioSessionCategory())
-        return;
-
-    if (has(PlatformMediaSession::Video) || has(PlatformMediaSession::Audio)) {
-        if (canProduceAudio())
-            AudioSession::sharedSession().setCategory(AudioSession::MediaPlayback);
-        else
-            AudioSession::sharedSession().setCategory(AudioSession::AmbientSound);
-    }
-    else if (has(PlatformMediaSession::WebAudio))
-        AudioSession::sharedSession().setCategory(AudioSession::AmbientSound);
-#endif
-}
-
-#endif // USE(AUDIO_SESSION)
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformaudiomacMediaSessionManagerMach"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.h (0 => 202642)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.h                                (rev 0)
+++ trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.h        2016-06-29 19:29:07 UTC (rev 202642)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+/*
+ * Copyright (C) 2016 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.
+ */
+
+#pragma once
+
+#if PLATFORM(MAC)
+
+#include &quot;PlatformMediaSessionManager.h&quot;
+#include &lt;wtf/RetainPtr.h&gt;
+
+namespace WebCore {
+
+class MediaSessionManagerMac : public PlatformMediaSessionManager {
+public:
+    virtual ~MediaSessionManagerMac();
+
+private:
+    friend class PlatformMediaSessionManager;
+
+    MediaSessionManagerMac();
+
+    void removeSession(PlatformMediaSession&amp;) override;
+
+    bool sessionWillBeginPlayback(PlatformMediaSession&amp;) override;
+    void sessionWillEndPlayback(PlatformMediaSession&amp;) override;
+    void clientCharacteristicsChanged(PlatformMediaSession&amp;) override;
+
+    void updateNowPlayingInfo();
+
+    PlatformMediaSession* nowPlayingEligibleSession();
+
+    double m_reportedRate { 0 };
+    double m_reportedDuration { 0 };
+    String m_reportedTitle;
+    bool m_nowPlayingActive { false };
+    bool m_isInBackground { false };
+};
+
+} // namespace WebCore
+
+#endif // PLATFORM(MAC)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformaudiomacMediaSessionManagerMacmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm (0 => 202642)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm        2016-06-29 19:29:07 UTC (rev 202642)
</span><span class="lines">@@ -0,0 +1,181 @@
</span><ins>+/*
+ * Copyright (C) 2016 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.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;MediaSessionManagerMac.h&quot;
+
+#if PLATFORM(MAC)
+
+#import &quot;Logging.h&quot;
+#import &quot;MediaPlayer.h&quot;
+#import &quot;PlatformMediaSession.h&quot;
+
+#import &quot;MediaRemoteSoftLink.h&quot;
+
+using namespace WebCore;
+
+namespace WebCore {
+
+static MediaSessionManagerMac* platformMediaSessionManager = nullptr;
+
+PlatformMediaSessionManager&amp; PlatformMediaSessionManager::sharedManager()
+{
+    if (!platformMediaSessionManager)
+        platformMediaSessionManager = new MediaSessionManagerMac;
+    return *platformMediaSessionManager;
+}
+
+PlatformMediaSessionManager* PlatformMediaSessionManager::sharedManagerIfExists()
+{
+    return platformMediaSessionManager;
+}
+
+MediaSessionManagerMac::MediaSessionManagerMac()
+    : PlatformMediaSessionManager()
+{
+    resetRestrictions();
+}
+
+MediaSessionManagerMac::~MediaSessionManagerMac()
+{
+}
+
+bool MediaSessionManagerMac::sessionWillBeginPlayback(PlatformMediaSession&amp; session)
+{
+    if (!PlatformMediaSessionManager::sessionWillBeginPlayback(session))
+        return false;
+
+    LOG(Media, &quot;MediaSessionManagerMac::sessionWillBeginPlayback&quot;);
+    updateNowPlayingInfo();
+    return true;
+}
+
+void MediaSessionManagerMac::removeSession(PlatformMediaSession&amp; session)
+{
+    PlatformMediaSessionManager::removeSession(session);
+    LOG(Media, &quot;MediaSessionManagerMac::removeSession&quot;);
+    updateNowPlayingInfo();
+}
+
+void MediaSessionManagerMac::sessionWillEndPlayback(PlatformMediaSession&amp; session)
+{
+    PlatformMediaSessionManager::sessionWillEndPlayback(session);
+    LOG(Media, &quot;MediaSessionManagerMac::sessionWillEndPlayback&quot;);
+    updateNowPlayingInfo();
+}
+
+void MediaSessionManagerMac::clientCharacteristicsChanged(PlatformMediaSession&amp;)
+{
+    LOG(Media, &quot;MediaSessionManagerMac::clientCharacteristicsChanged&quot;);
+    updateNowPlayingInfo();
+}
+
+PlatformMediaSession* MediaSessionManagerMac::nowPlayingEligibleSession()
+{
+    for (auto session : sessions()) {
+        PlatformMediaSession::MediaType type = session-&gt;mediaType();
+        if (type != PlatformMediaSession::Video &amp;&amp; type != PlatformMediaSession::Audio)
+            continue;
+
+        if (session-&gt;characteristics() &amp; PlatformMediaSession::HasAudio)
+            return session;
+    }
+
+    return nullptr;
+}
+
+void MediaSessionManagerMac::updateNowPlayingInfo()
+{
+#if USE(MEDIAREMOTE)
+    if (!isMediaRemoteFrameworkAvailable())
+        return;
+
+    if (!MRMediaRemoteSetCanBeNowPlayingApplication(true)) {
+        LOG(Media, &quot;MediaSessionManagerMac::updateNowPlayingInfo - MRMediaRemoteSetCanBeNowPlayingApplication(true) failed&quot;);
+        return;
+    }
+
+    const PlatformMediaSession* currentSession = this-&gt;nowPlayingEligibleSession();
+
+    LOG(Media, &quot;MediaSessionManagerMac::updateNowPlayingInfo - currentSession = %p&quot;, currentSession);
+
+    if (!currentSession) {
+        if (m_nowPlayingActive) {
+            LOG(Media, &quot;MediaSessionManagerMac::updateNowPlayingInfo - clearing now playing info&quot;);
+            MRMediaRemoteSetNowPlayingInfo(nullptr);
+            m_nowPlayingActive = false;
+            MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin(MRMediaRemoteGetLocalOrigin(), kMRPlaybackStateStopped, dispatch_get_main_queue(), ^(MRMediaRemoteError error) {
+                LOG(Media, &quot;MediaSessionManagerMac::updateNowPlayingInfo - MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin(stopped) failed with error %ud&quot;, error);
+            });
+        }
+
+        return;
+    }
+
+    String title = currentSession-&gt;title();
+    double duration = currentSession-&gt;duration();
+    double rate = currentSession-&gt;state() == PlatformMediaSession::Playing ? 1 : 0;
+    if (m_reportedTitle == title &amp;&amp; m_reportedRate == rate &amp;&amp; m_reportedDuration == duration) {
+        LOG(Media, &quot;MediaSessionManagerMac::updateNowPlayingInfo - nothing new to show&quot;);
+        return;
+    }
+
+    m_reportedRate = rate;
+    m_reportedDuration = duration;
+    m_reportedTitle = title;
+
+    auto info = adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 4, &amp;kCFTypeDictionaryKeyCallBacks, &amp;kCFTypeDictionaryValueCallBacks));
+
+    if (!title.isEmpty())
+        CFDictionarySetValue(info.get(), kMRMediaRemoteNowPlayingInfoTitle, title.createCFString().get());
+
+    if (std::isfinite(duration) &amp;&amp; duration != MediaPlayer::invalidTime()) {
+        auto cfDuration = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberDoubleType, &amp;duration));
+        CFDictionarySetValue(info.get(), kMRMediaRemoteNowPlayingInfoDuration, cfDuration.get());
+    }
+
+    auto cfRate = CFNumberCreate(kCFAllocatorDefault, kCFNumberDoubleType, &amp;rate);
+    CFDictionarySetValue(info.get(), kMRMediaRemoteNowPlayingInfoPlaybackRate, cfRate);
+
+    double currentTime = currentSession-&gt;currentTime();
+    if (std::isfinite(currentTime) &amp;&amp; currentTime != MediaPlayer::invalidTime()) {
+        auto cfCurrentTime = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberDoubleType, &amp;currentTime));
+        CFDictionarySetValue(info.get(), kMRMediaRemoteNowPlayingInfoElapsedTime, cfCurrentTime.get());
+    }
+
+    LOG(Media, &quot;MediaSessionManagerMac::updateNowPlayingInfo - title = \&quot;%s\&quot;, rate = %f, duration = %f, now = %f&quot;,
+        title.utf8().data(), rate, duration, currentTime);
+
+    m_nowPlayingActive = true;
+    MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin(MRMediaRemoteGetLocalOrigin(), kMRPlaybackStatePlaying, dispatch_get_main_queue(), ^(MRMediaRemoteError error) {
+        LOG(Media, &quot;MediaSessionManagerMac::updateNowPlayingInfo - MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin(playing) failed with error %ud&quot;, error);
+    });
+    MRMediaRemoteSetNowPlayingInfo(info.get());
+#endif
+}
+
+} // namespace WebCore
+
+#endif // PLATFORM(MAC)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaSoftLinkingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cocoa/SoftLinking.h (202641 => 202642)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/SoftLinking.h        2016-06-29 19:22:59 UTC (rev 202641)
+++ trunk/Source/WebCore/platform/cocoa/SoftLinking.h        2016-06-29 19:29:07 UTC (rev 202642)
</span><span class="lines">@@ -325,6 +325,22 @@
</span><span class="cx">     } \
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#define SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE(functionNamespace, framework) \
+    namespace functionNamespace { \
+    void* framework##Library(bool isOptional = false); \
+    void* framework##Library(bool isOptional) \
+    { \
+        static void* frameworkLibrary; \
+        static dispatch_once_t once; \
+        dispatch_once(&amp;once, ^{ \
+            frameworkLibrary = dlopen(&quot;/System/Library/PrivateFrameworks/&quot; #framework &quot;.framework/&quot; #framework, RTLD_NOW); \
+            if (!isOptional) \
+                RELEASE_ASSERT_WITH_MESSAGE(frameworkLibrary, &quot;%s&quot;, dlerror()); \
+        }); \
+        return frameworkLibrary; \
+    } \
+    }
+
</ins><span class="cx"> #define SOFT_LINK_CLASS_FOR_HEADER(functionNamespace, framework, className) \
</span><span class="cx">     @class className; \
</span><span class="cx">     namespace functionNamespace { \
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacMediaRemoteSoftLinkcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/mac/MediaRemoteSoftLink.cpp (0 => 202642)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/MediaRemoteSoftLink.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/mac/MediaRemoteSoftLink.cpp        2016-06-29 19:29:07 UTC (rev 202642)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+/*
+ * Copyright (C) 2016 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;
+
+#if USE(MEDIAREMOTE)
+
+#include &quot;MediaRemoteSPI.h&quot;
+#include &quot;SoftLinking.h&quot;
+
+SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE(WebCore, MediaRemote)
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteGetLocalOrigin, MROriginRef, (), ())
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteAddAsyncCommandHandlerBlock, void*, (MRMediaRemoteAsyncCommandHandlerBlock block), (block))
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteRemoveCommandHandlerBlock, void, (void* observer), (observer))
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteSetSupportedCommands, void, (CFArrayRef commands, MROriginRef origin, dispatch_queue_t replyQ, void(^completion)(MRMediaRemoteError err)), (commands, origin, replyQ, completion))
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteCommandInfoCreate, MRMediaRemoteCommandInfoRef, (CFAllocatorRef allocator), (allocator));
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteCommandInfoSetCommand, void, (MRMediaRemoteCommandInfoRef commandInfo, MRMediaRemoteCommand command), (commandInfo, command))
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteCommandInfoSetEnabled, void, (MRMediaRemoteCommandInfoRef commandInfo, Boolean enabled), (commandInfo, enabled))
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteCommandInfoSetOptions, void, (MRMediaRemoteCommandInfoRef commandInfo, CFDictionaryRef options), (commandInfo, options))
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteSetCanBeNowPlayingApplication, Boolean, (Boolean flag), (flag))
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteSetNowPlayingInfo, void, (CFDictionaryRef info), (info))
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin, void, (MROriginRef origin, MRPlaybackState playbackState, dispatch_queue_t replyQ, void(^completion)(MRMediaRemoteError)), (origin, playbackState, replyQ, completion))
+SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoTitle, CFStringRef);
+SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoDuration, CFStringRef);
+SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoElapsedTime, CFStringRef);
+SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoPlaybackRate, CFStringRef);
+
+#endif // USE(MEDIAREMOTE)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmacMediaRemoteSoftLinkh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/mac/MediaRemoteSoftLink.h (0 => 202642)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/MediaRemoteSoftLink.h                                (rev 0)
+++ trunk/Source/WebCore/platform/mac/MediaRemoteSoftLink.h        2016-06-29 19:29:07 UTC (rev 202642)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+/*
+ * Copyright (C) 2016 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.
+ */
+
+#pragma once
+
+#if USE(MEDIAREMOTE)
+
+#include &quot;MediaRemoteSPI.h&quot;
+#include &quot;SoftLinking.h&quot;
+
+SOFT_LINK_FRAMEWORK_FOR_HEADER(WebCore, MediaRemote)
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteGetLocalOrigin, MROriginRef, (), ())
+#define MRMediaRemoteGetLocalOrigin softLink_MediaRemote_MRMediaRemoteGetLocalOrigin
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteAddAsyncCommandHandlerBlock, void*, (MRMediaRemoteAsyncCommandHandlerBlock block), (block))
+#define MRMediaRemoteAddAsyncCommandHandlerBlock softLink_MediaRemote_MRMediaRemoteAddAsyncCommandHandlerBlock
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteRemoveCommandHandlerBlock, void, (void* observer), (observer))
+#define MRMediaRemoteRemoveCommandHandlerBlock softLink_MediaRemote_MRMediaRemoteRemoveCommandHandlerBlock
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteSetSupportedCommands, void, (CFArrayRef commands, MROriginRef origin, dispatch_queue_t replyQ, void(^completion)(MRMediaRemoteError err)), (commands, origin, replyQ, completion))
+#define MRMediaRemoteSetSupportedCommands softLink_MediaRemote_MRMediaRemoteSetSupportedCommands
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteCommandInfoCreate, MRMediaRemoteCommandInfoRef, (CFAllocatorRef allocator), (allocator));
+#define MRMediaRemoteCommandInfoCreate softLink_MediaRemote_MRMediaRemoteCommandInfoCreate
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteCommandInfoSetCommand, void, (MRMediaRemoteCommandInfoRef commandInfo, MRMediaRemoteCommand command), (commandInfo, command))
+#define MRMediaRemoteCommandInfoSetCommand softLink_MediaRemote_MRMediaRemoteCommandInfoSetCommand
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteCommandInfoSetEnabled, void, (MRMediaRemoteCommandInfoRef commandInfo, Boolean enabled), (commandInfo, enabled))
+#define MRMediaRemoteCommandInfoSetEnabled softLink_MediaRemote_MRMediaRemoteCommandInfoSetEnabled
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteCommandInfoSetOptions, void, (MRMediaRemoteCommandInfoRef commandInfo, CFDictionaryRef options), (commandInfo, options))
+#define MRMediaRemoteCommandInfoSetOptions softLink_MediaRemote_MRMediaRemoteCommandInfoSetOptions
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteSetCanBeNowPlayingApplication, Boolean, (Boolean flag), (flag))
+#define MRMediaRemoteSetCanBeNowPlayingApplication softLink_MediaRemote_MRMediaRemoteSetCanBeNowPlayingApplication
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteSetNowPlayingInfo, void, (CFDictionaryRef info), (info))
+#define MRMediaRemoteSetNowPlayingInfo softLink_MediaRemote_MRMediaRemoteSetNowPlayingInfo
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin, void, (MROriginRef origin, MRPlaybackState playbackState, dispatch_queue_t replyQ, void(^completion)(MRMediaRemoteError)), (origin, playbackState, replyQ, completion))
+#define MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin softLink_MediaRemote_MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin
+SOFT_LINK_CONSTANT_FOR_HEADER(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoTitle, CFStringRef);
+#define kMRMediaRemoteNowPlayingInfoTitle get_MediaRemote_kMRMediaRemoteNowPlayingInfoTitle()
+SOFT_LINK_CONSTANT_FOR_HEADER(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoDuration, CFStringRef);
+#define kMRMediaRemoteNowPlayingInfoDuration get_MediaRemote_kMRMediaRemoteNowPlayingInfoDuration()
+SOFT_LINK_CONSTANT_FOR_HEADER(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoElapsedTime, CFStringRef);
+#define kMRMediaRemoteNowPlayingInfoElapsedTime get_MediaRemote_kMRMediaRemoteNowPlayingInfoElapsedTime()
+SOFT_LINK_CONSTANT_FOR_HEADER(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoPlaybackRate, CFStringRef);
+#define kMRMediaRemoteNowPlayingInfoPlaybackRate get_MediaRemote_kMRMediaRemoteNowPlayingInfoPlaybackRate()
+
+#endif // USE(MEDIAREMOTE)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmacRemoteCommandListenerMach"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/mac/RemoteCommandListenerMac.h (0 => 202642)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/RemoteCommandListenerMac.h                                (rev 0)
+++ trunk/Source/WebCore/platform/mac/RemoteCommandListenerMac.h        2016-06-29 19:29:07 UTC (rev 202642)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+/*
+ * Copyright (C) 2016 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.
+ */
+
+#pragma once
+
+#include &quot;RemoteCommandListener.h&quot;
+
+#if PLATFORM(MAC)
+
+#include &lt;wtf/RetainPtr.h&gt;
+#include &lt;wtf/WeakPtr.h&gt;
+
+namespace WebCore {
+
+class RemoteCommandListenerMac : public RemoteCommandListener {
+public:
+    RemoteCommandListenerMac(RemoteCommandListenerClient&amp;);
+    virtual ~RemoteCommandListenerMac();
+
+protected:
+    WeakPtr&lt;RemoteCommandListenerMac&gt; createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
+
+    WeakPtrFactory&lt;RemoteCommandListenerMac&gt; m_weakPtrFactory { this };
+    void* m_commandHandler { nullptr };
+};
+    
+}
+
+#endif // PLATFORM(MAC)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmacRemoteCommandListenerMacmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/mac/RemoteCommandListenerMac.mm (0 => 202642)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/RemoteCommandListenerMac.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/mac/RemoteCommandListenerMac.mm        2016-06-29 19:29:07 UTC (rev 202642)
</span><span class="lines">@@ -0,0 +1,121 @@
</span><ins>+/*
+ * Copyright (C) 2016 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;RemoteCommandListenerMac.h&quot;
+
+#if PLATFORM(MAC)
+
+#import &quot;Logging.h&quot;
+#import &lt;wtf/MainThread.h&gt;
+
+#import &quot;MediaRemoteSoftLink.h&quot;
+
+namespace WebCore {
+
+std::unique_ptr&lt;RemoteCommandListener&gt; RemoteCommandListener::create(RemoteCommandListenerClient&amp; client)
+{
+    return std::make_unique&lt;RemoteCommandListenerMac&gt;(client);
+}
+
+RemoteCommandListenerMac::RemoteCommandListenerMac(RemoteCommandListenerClient&amp; client)
+    : RemoteCommandListener(client)
+{
+#if USE(MEDIAREMOTE)
+    if (!isMediaRemoteFrameworkAvailable())
+        return;
+
+    static const MRMediaRemoteCommand supportedCommands[] = {
+        MRMediaRemoteCommandPlay,
+        MRMediaRemoteCommandPause,
+        MRMediaRemoteCommandTogglePlayPause,
+        MRMediaRemoteCommandBeginFastForward,
+        MRMediaRemoteCommandEndFastForward,
+        MRMediaRemoteCommandBeginRewind,
+        MRMediaRemoteCommandEndRewind,
+    };
+
+    auto commandInfoArray = adoptCF(CFArrayCreateMutable(kCFAllocatorDefault, sizeof(supportedCommands) / sizeof(MRMediaRemoteCommand), &amp;kCFTypeArrayCallBacks));
+
+    for (auto command : supportedCommands) {
+        auto commandInfo = adoptCF(MRMediaRemoteCommandInfoCreate(kCFAllocatorDefault));
+        MRMediaRemoteCommandInfoSetCommand(commandInfo.get(), command);
+        MRMediaRemoteCommandInfoSetEnabled(commandInfo.get(), true);
+        CFArrayAppendValue(commandInfoArray.get(), commandInfo.get());
+    }
+
+    MRMediaRemoteSetSupportedCommands(commandInfoArray.get(), MRMediaRemoteGetLocalOrigin(), nullptr, nullptr);
+
+    auto weakThis = createWeakPtr();
+    m_commandHandler = MRMediaRemoteAddAsyncCommandHandlerBlock(^(MRMediaRemoteCommand command, CFDictionaryRef options, void(^completion)(CFArrayRef)) {
+        UNUSED_PARAM(options);
+
+        PlatformMediaSession::RemoteControlCommandType platformCommand { PlatformMediaSession::NoCommand };
+
+        switch (command) {
+        case MRMediaRemoteCommandPlay:
+            platformCommand = PlatformMediaSession::PlayCommand;
+            break;
+        case MRMediaRemoteCommandPause:
+            platformCommand = PlatformMediaSession::PauseCommand;
+            break;
+        case MRMediaRemoteCommandTogglePlayPause:
+            platformCommand = PlatformMediaSession::TogglePlayPauseCommand;
+            break;
+        case MRMediaRemoteCommandBeginFastForward:
+            platformCommand = PlatformMediaSession::BeginSeekingForwardCommand;
+            break;
+        case MRMediaRemoteCommandEndFastForward:
+            platformCommand = PlatformMediaSession::EndSeekingForwardCommand;
+            break;
+        case MRMediaRemoteCommandBeginRewind:
+            platformCommand = PlatformMediaSession::BeginSeekingBackwardCommand;
+            break;
+        case MRMediaRemoteCommandEndRewind:
+            platformCommand = PlatformMediaSession::EndSeekingBackwardCommand;
+            break;
+        default:
+            ASSERT_NOT_REACHED();
+        };
+
+        if (!weakThis)
+            return;
+        weakThis-&gt;m_client.didReceiveRemoteControlCommand(platformCommand);
+        completion(static_cast&lt;CFArrayRef&gt;(@[@0]));
+    });
+#endif // USE(MEDIAREMOTE)
+}
+
+RemoteCommandListenerMac::~RemoteCommandListenerMac()
+{
+#if USE(MEDIAREMOTE)
+    if (m_commandHandler)
+        MRMediaRemoteRemoveCommandHandlerBlock(m_commandHandler);
+#endif
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformspimacMediaRemoteSPIh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/spi/mac/MediaRemoteSPI.h (0 => 202642)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/mac/MediaRemoteSPI.h                                (rev 0)
+++ trunk/Source/WebCore/platform/spi/mac/MediaRemoteSPI.h        2016-06-29 19:29:07 UTC (rev 202642)
</span><span class="lines">@@ -0,0 +1,112 @@
</span><ins>+/*
+ * Copyright (C) 2016 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.
+ */
+
+#pragma once
+
+#if USE(MEDIAREMOTE)
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#include &lt;MediaRemote/MediaRemote.h&gt;
+
+#else
+
+enum {
+    MRMediaRemoteCommandPlay,
+    MRMediaRemoteCommandPause,
+    MRMediaRemoteCommandTogglePlayPause,
+    MRMediaRemoteCommandStop,
+    MRMediaRemoteCommandNextTrack,
+    MRMediaRemoteCommandPreviousTrack,
+    MRMediaRemoteCommandAdvanceShuffleMode,
+    MRMediaRemoteCommandAdvanceRepeatMode,
+    MRMediaRemoteCommandBeginFastForward,
+    MRMediaRemoteCommandEndFastForward,
+    MRMediaRemoteCommandBeginRewind,
+    MRMediaRemoteCommandEndRewind,
+    MRMediaRemoteCommandRewind15Seconds,
+    MRMediaRemoteCommandFastForward15Seconds,
+    MRMediaRemoteCommandRewind30Seconds,
+    MRMediaRemoteCommandFastForward30Seconds,
+    MRMediaRemoteCommandToggleRecord,
+    MRMediaRemoteCommandSkipForward,
+    MRMediaRemoteCommandSkipBackward,
+    MRMediaRemoteCommandChangePlaybackRate,
+    MRMediaRemoteCommandRateTrack,
+    MRMediaRemoteCommandLikeTrack,
+    MRMediaRemoteCommandDislikeTrack,
+    MRMediaRemoteCommandBookmarkTrack,
+    MRMediaRemoteCommandSeekToPlaybackPosition,
+    MRMediaRemoteCommandChangeRepeatMode,
+    MRMediaRemoteCommandChangeShuffleMode,
+    MRMediaRemoteCommandEnableLanguageOption,
+    MRMediaRemoteCommandDisableLanguageOption
+};
+typedef uint32_t MRMediaRemoteCommand;
+
+enum {
+    kMRPlaybackStateUnknown = 0,
+    kMRPlaybackStatePlaying,
+    kMRPlaybackStatePaused,
+    kMRPlaybackStateStopped,
+    kMRPlaybackStateInterrupted
+};
+typedef uint32_t MRPlaybackState;
+
+typedef uint32_t MRMediaRemoteError;
+typedef struct _MROrigin *MROriginRef;
+typedef struct _MRMediaRemoteCommandInfo *MRMediaRemoteCommandInfoRef;
+typedef void(^MRMediaRemoteAsyncCommandHandlerBlock)(MRMediaRemoteCommand command, CFDictionaryRef options, void(^completion)(CFArrayRef));
+
+WTF_EXTERN_C_BEGIN
+
+#pragma mark - MRRemoteControl
+
+void* MRMediaRemoteAddAsyncCommandHandlerBlock(MRMediaRemoteAsyncCommandHandlerBlock);
+void MRMediaRemoteRemoveCommandHandlerBlock(void *observer);
+void MRMediaRemoteSetSupportedCommands(CFArrayRef commands, MROriginRef, dispatch_queue_t replyQ, void(^completion)(MRMediaRemoteError err));
+
+#pragma mark - MROrigin
+
+MROriginRef MRMediaRemoteGetLocalOrigin();
+
+#pragma mark - MRCommandInfo
+
+MRMediaRemoteCommandInfoRef MRMediaRemoteCommandInfoCreate(CFAllocatorRef);
+void MRMediaRemoteCommandInfoSetCommand(MRMediaRemoteCommandInfoRef, MRMediaRemoteCommand);
+void MRMediaRemoteCommandInfoSetEnabled(MRMediaRemoteCommandInfoRef, Boolean);
+void MRMediaRemoteCommandInfoSetOptions(MRMediaRemoteCommandInfoRef, CFDictionaryRef);
+
+#pragma mark - MRNowPlaying
+
+Boolean MRMediaRemoteSetCanBeNowPlayingApplication(Boolean);
+void MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin(MROriginRef, MRPlaybackState, dispatch_queue_t replyQ, void(^completion)(MRMediaRemoteError));
+void MRMediaRemoteSetNowPlayingInfo(CFDictionaryRef);
+
+WTF_EXTERN_C_END
+
+#endif // USE(APPLE_INTERNAL_SDK)
+
+#endif // USE(MEDIAREMOTE)
</ins></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (202641 => 202642)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-06-29 19:22:59 UTC (rev 202641)
+++ trunk/Source/WebKit2/ChangeLog        2016-06-29 19:29:07 UTC (rev 202642)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-06-29  Jer Noble  &lt;jer.noble@apple.com&gt;
+
+        Adopt MediaRemote.
+        https://bugs.webkit.org/show_bug.cgi?id=159250
+
+        Reviewed by Eric Carlson.
+
+        Add a sandbox exception allowing access to the mediaremoted XPC service.
+
+        * WebProcess/com.apple.WebProcess.sb.in:
+
</ins><span class="cx"> 2016-06-29  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         WKWebView should ask WKNavigationDelegate about bad ssl certificates
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcesscomappleWebProcesssbin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/com.apple.WebProcess.sb.in (202641 => 202642)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/com.apple.WebProcess.sb.in        2016-06-29 19:22:59 UTC (rev 202641)
+++ trunk/Source/WebKit2/WebProcess/com.apple.WebProcess.sb.in        2016-06-29 19:29:07 UTC (rev 202642)
</span><span class="lines">@@ -200,6 +200,9 @@
</span><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100
</span><span class="cx">        (global-name &quot;com.apple.nesessionmanager.flow-divert-token&quot;)
</span><span class="cx"> #endif
</span><ins>+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
+       (global-name &quot;com.apple.mediaremoted.xpc&quot;)
+#endif
</ins><span class="cx"> )
</span><span class="cx"> 
</span><span class="cx"> ;; Security framework
</span></span></pre>
</div>
</div>

</body>
</html>