<!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>[184966] 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/184966">184966</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-05-28 16:03:34 -0700 (Thu, 28 May 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Rename HTMLMediaSession to MediaElementSession to reserve &quot;media session&quot; for the Media Session API.
https://bugs.webkit.org/show_bug.cgi?id=145440

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

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::loadInternal):
(WebCore::HTMLMediaElement::loadResource):
(WebCore::HTMLMediaElement::suspend):
(WebCore::HTMLMediaElement::resume):
(WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
(WebCore::HTMLMediaElement::mediaState):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::mediaSession):
* html/MediaElementSession.cpp: Renamed from Source/WebCore/html/HTMLMediaSession.cpp.
(WebCore::restrictionName):
(WebCore::MediaElementSession::MediaElementSession):
(WebCore::MediaElementSession::registerWithDocument):
(WebCore::MediaElementSession::unregisterWithDocument):
(WebCore::MediaElementSession::addBehaviorRestriction):
(WebCore::MediaElementSession::removeBehaviorRestriction):
(WebCore::MediaElementSession::playbackPermitted):
(WebCore::MediaElementSession::dataLoadingPermitted):
(WebCore::MediaElementSession::fullscreenPermitted):
(WebCore::MediaElementSession::pageAllowsDataLoading):
(WebCore::MediaElementSession::pageAllowsPlaybackAfterResuming):
(WebCore::MediaElementSession::showPlaybackTargetPicker):
(WebCore::MediaElementSession::hasWirelessPlaybackTargets):
(WebCore::MediaElementSession::wirelessVideoPlaybackDisabled):
(WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
(WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
(WebCore::MediaElementSession::setPlaybackTarget):
(WebCore::MediaElementSession::targetAvailabilityChangedTimerFired):
(WebCore::MediaElementSession::externalOutputDeviceAvailableDidChange):
(WebCore::MediaElementSession::canPlayToWirelessPlaybackTarget):
(WebCore::MediaElementSession::isPlayingToWirelessPlaybackTarget):
(WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):
(WebCore::MediaElementSession::mediaStateDidChange):
(WebCore::MediaElementSession::effectivePreloadForElement):
(WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
(WebCore::MediaElementSession::mediaEngineUpdated):
(WebCore::MediaElementSession::allowsAlternateFullscreen):
(WebCore::MediaElementSession::maximumMediaSourceBufferSize):
* html/MediaElementSession.h: Renamed from Source/WebCore/html/HTMLMediaSession.h.
* testing/Internals.cpp:
(WebCore::Internals::setMediaElementRestrictions):
(WebCore::Internals::setAudioContextRestrictions):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementh">trunk/Source/WebCore/html/HTMLMediaElement.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorehtmlMediaElementSessioncpp">trunk/Source/WebCore/html/MediaElementSession.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlMediaElementSessionh">trunk/Source/WebCore/html/MediaElementSession.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaSessioncpp">trunk/Source/WebCore/html/HTMLMediaSession.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaSessionh">trunk/Source/WebCore/html/HTMLMediaSession.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (184965 => 184966)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-05-28 22:41:19 UTC (rev 184965)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-05-28 23:03:34 UTC (rev 184966)
</span><span class="lines">@@ -1636,7 +1636,6 @@
</span><span class="cx">     html/HTMLMapElement.cpp
</span><span class="cx">     html/HTMLMarqueeElement.cpp
</span><span class="cx">     html/HTMLMediaElement.cpp
</span><del>-    html/HTMLMediaSession.cpp
</del><span class="cx">     html/HTMLMenuElement.cpp
</span><span class="cx">     html/HTMLMetaElement.cpp
</span><span class="cx">     html/HTMLMeterElement.cpp
</span><span class="lines">@@ -1688,6 +1687,7 @@
</span><span class="cx">     html/LinkRelAttribute.cpp
</span><span class="cx">     html/MediaController.cpp
</span><span class="cx">     html/MediaDocument.cpp
</span><ins>+    html/MediaElementSession.cpp
</ins><span class="cx">     html/MediaFragmentURIParser.cpp
</span><span class="cx">     html/MonthInputType.cpp
</span><span class="cx">     html/NumberInputType.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (184965 => 184966)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-05-28 22:41:19 UTC (rev 184965)
+++ trunk/Source/WebCore/ChangeLog        2015-05-28 23:03:34 UTC (rev 184966)
</span><span class="lines">@@ -1,3 +1,58 @@
</span><ins>+2015-05-28  Matt Rajca  &lt;mrajca@apple.com&gt;
+
+        Rename HTMLMediaSession to MediaElementSession to reserve &quot;media session&quot; for the Media Session API.
+        https://bugs.webkit.org/show_bug.cgi?id=145440
+
+        Reviewed by Eric Carlson.
+
+        * CMakeLists.txt:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::HTMLMediaElement):
+        (WebCore::HTMLMediaElement::loadInternal):
+        (WebCore::HTMLMediaElement::loadResource):
+        (WebCore::HTMLMediaElement::suspend):
+        (WebCore::HTMLMediaElement::resume):
+        (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
+        (WebCore::HTMLMediaElement::mediaState):
+        * html/HTMLMediaElement.h:
+        (WebCore::HTMLMediaElement::mediaSession):
+        * html/MediaElementSession.cpp: Renamed from Source/WebCore/html/HTMLMediaSession.cpp.
+        (WebCore::restrictionName):
+        (WebCore::MediaElementSession::MediaElementSession):
+        (WebCore::MediaElementSession::registerWithDocument):
+        (WebCore::MediaElementSession::unregisterWithDocument):
+        (WebCore::MediaElementSession::addBehaviorRestriction):
+        (WebCore::MediaElementSession::removeBehaviorRestriction):
+        (WebCore::MediaElementSession::playbackPermitted):
+        (WebCore::MediaElementSession::dataLoadingPermitted):
+        (WebCore::MediaElementSession::fullscreenPermitted):
+        (WebCore::MediaElementSession::pageAllowsDataLoading):
+        (WebCore::MediaElementSession::pageAllowsPlaybackAfterResuming):
+        (WebCore::MediaElementSession::showPlaybackTargetPicker):
+        (WebCore::MediaElementSession::hasWirelessPlaybackTargets):
+        (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled):
+        (WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
+        (WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
+        (WebCore::MediaElementSession::setPlaybackTarget):
+        (WebCore::MediaElementSession::targetAvailabilityChangedTimerFired):
+        (WebCore::MediaElementSession::externalOutputDeviceAvailableDidChange):
+        (WebCore::MediaElementSession::canPlayToWirelessPlaybackTarget):
+        (WebCore::MediaElementSession::isPlayingToWirelessPlaybackTarget):
+        (WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):
+        (WebCore::MediaElementSession::mediaStateDidChange):
+        (WebCore::MediaElementSession::effectivePreloadForElement):
+        (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
+        (WebCore::MediaElementSession::mediaEngineUpdated):
+        (WebCore::MediaElementSession::allowsAlternateFullscreen):
+        (WebCore::MediaElementSession::maximumMediaSourceBufferSize):
+        * html/MediaElementSession.h: Renamed from Source/WebCore/html/HTMLMediaSession.h.
+        * testing/Internals.cpp:
+        (WebCore::Internals::setMediaElementRestrictions):
+        (WebCore::Internals::setAudioContextRestrictions):
+
</ins><span class="cx"> 2015-05-28  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Crash under ICU with ASAN during editing/selection/move-by-word-visually-crash-test-5.html
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (184965 => 184966)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-05-28 22:41:19 UTC (rev 184965)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-05-28 23:03:34 UTC (rev 184966)
</span><span class="lines">@@ -15098,7 +15098,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\DOMSettableTokenList.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\DOMTokenList.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\DOMURL.cpp&quot; /&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\html\HTMLMediaSession.cpp&quot; /&gt;
</del><ins>+    &lt;ClCompile Include=&quot;..\html\MediaElementSession.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\html\EmailInputType.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\PublicURLManager.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\fileapi\File.cpp&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (184965 => 184966)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-05-28 22:41:19 UTC (rev 184965)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-05-28 23:03:34 UTC (rev 184966)
</span><span class="lines">@@ -7030,7 +7030,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\Modules\gamepad\GamepadEvent.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;Modules\gamepad&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\html\HTMLMediaSession.cpp&quot;&gt;
</del><ins>+    &lt;ClCompile Include=&quot;..\html\MediaElementSession.cpp&quot;&gt;
</ins><span class="cx">       &lt;Filter&gt;html&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\HTTPHeaderNames.cpp&quot;&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (184965 => 184966)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-05-28 22:41:19 UTC (rev 184965)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-05-28 23:03:34 UTC (rev 184966)
</span><span class="lines">@@ -351,8 +351,8 @@
</span><span class="cx">                 07F876841AD580F900905849 /* MediaPlaybackTargetContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F876831AD4A94500905849 /* MediaPlaybackTargetContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 07F944161864D046005D31CB /* MediaSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = CDAE8C081746B95700532D78 /* MediaSessionManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 07FBDE2C18FED178001A7CFF /* JSDataCueCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07FBDE2B18FED178001A7CFF /* JSDataCueCustom.cpp */; };
</span><del>-                07FE99DC18807A7D00256648 /* HTMLMediaSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07FE99DA18807A7D00256648 /* HTMLMediaSession.cpp */; };
-                07FE99DD18807A7D00256648 /* HTMLMediaSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 07FE99DB18807A7D00256648 /* HTMLMediaSession.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><ins>+                07FE99DC18807A7D00256648 /* MediaElementSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07FE99DA18807A7D00256648 /* MediaElementSession.cpp */; };
+                07FE99DD18807A7D00256648 /* MediaElementSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 07FE99DB18807A7D00256648 /* MediaElementSession.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">@@ -7403,8 +7403,8 @@
</span><span class="cx">                 07F0B97B1AC5DB4600E535D9 /* AVFoundationSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AVFoundationSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 07F876831AD4A94500905849 /* MediaPlaybackTargetContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlaybackTargetContext.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 07FBDE2B18FED178001A7CFF /* JSDataCueCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDataCueCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                07FE99DA18807A7D00256648 /* HTMLMediaSession.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLMediaSession.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                07FE99DB18807A7D00256648 /* HTMLMediaSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLMediaSession.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                07FE99DA18807A7D00256648 /* MediaElementSession.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaElementSession.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                07FE99DB18807A7D00256648 /* MediaElementSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaElementSession.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 07FFDE66181AED420072D409 /* MediaStreamTrackPrivate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamTrackPrivate.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 07FFDE67181AED420072D409 /* MediaStreamTrackPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamTrackPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0806E57912893045007CED32 /* SVGMatrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGMatrix.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -18156,8 +18156,6 @@
</span><span class="cx">                                 E44613930CD6331000FADA75 /* HTMLMediaElement.h */,
</span><span class="cx">                                 E44613940CD6331000FADA75 /* HTMLMediaElement.idl */,
</span><span class="cx">                                 CD5209E51B0BD9E10077184E /* HTMLMediaElementEnums.h */,
</span><del>-                                07FE99DA18807A7D00256648 /* HTMLMediaSession.cpp */,
-                                07FE99DB18807A7D00256648 /* HTMLMediaSession.h */,
</del><span class="cx">                                 A8EA79EC0A1916DF00A8EF5F /* HTMLMenuElement.cpp */,
</span><span class="cx">                                 A8EA79E80A1916DF00A8EF5F /* HTMLMenuElement.h */,
</span><span class="cx">                                 1AE2AE430A1D269E00B42B25 /* HTMLMenuElement.idl */,
</span><span class="lines">@@ -18296,6 +18294,8 @@
</span><span class="cx">                                 CDF65CC9145B43A700C4C7AA /* MediaControllerInterface.h */,
</span><span class="cx">                                 97205AB31239291000B17380 /* MediaDocument.cpp */,
</span><span class="cx">                                 97205AB41239291000B17380 /* MediaDocument.h */,
</span><ins>+                                07FE99DA18807A7D00256648 /* MediaElementSession.cpp */,
+                                07FE99DB18807A7D00256648 /* MediaElementSession.h */,
</ins><span class="cx">                                 E446139B0CD6331000FADA75 /* MediaError.h */,
</span><span class="cx">                                 E446139C0CD6331000FADA75 /* MediaError.idl */,
</span><span class="cx">                                 07A6D1E91491137700051D0C /* MediaFragmentURIParser.cpp */,
</span><span class="lines">@@ -24895,7 +24895,6 @@
</span><span class="cx">                                 A8EA7CAB0A192B9C00A8EF5F /* HTMLMarqueeElement.h in Headers */,
</span><span class="cx">                                 E44613A50CD6331000FADA75 /* HTMLMediaElement.h in Headers */,
</span><span class="cx">                                 0779BF0E18453168000B6AE7 /* HTMLMediaElementMediaStream.h in Headers */,
</span><del>-                                07FE99DD18807A7D00256648 /* HTMLMediaSession.h in Headers */,
</del><span class="cx">                                 A8EA79F40A1916DF00A8EF5F /* HTMLMenuElement.h in Headers */,
</span><span class="cx">                                 2BE8E2C712A589EC00FAD550 /* HTMLMetaCharsetParser.h in Headers */,
</span><span class="cx">                                 A871DC240A15205700B12A68 /* HTMLMetaElement.h in Headers */,
</span><span class="lines">@@ -25774,6 +25773,7 @@
</span><span class="cx">                                 5EA725D31ACABD4700EAD17B /* MediaDevices.h in Headers */,
</span><span class="cx">                                 97205AB81239291000B17380 /* MediaDocument.h in Headers */,
</span><span class="cx">                                 FD6F252D13F5EF0E0065165F /* MediaElementAudioSourceNode.h in Headers */,
</span><ins>+                                07FE99DD18807A7D00256648 /* MediaElementSession.h in Headers */,
</ins><span class="cx">                                 E44613AD0CD6331000FADA75 /* MediaError.h in Headers */,
</span><span class="cx">                                 4E1959220A39DABA00220FE5 /* MediaFeatureNames.h in Headers */,
</span><span class="cx">                                 07A6D1EC1491137700051D0C /* MediaFragmentURIParser.h in Headers */,
</span><span class="lines">@@ -28402,7 +28402,6 @@
</span><span class="cx">                                 A8EA7CAC0A192B9C00A8EF5F /* HTMLMarqueeElement.cpp in Sources */,
</span><span class="cx">                                 E44613A40CD6331000FADA75 /* HTMLMediaElement.cpp in Sources */,
</span><span class="cx">                                 0779BF0D18453168000B6AE7 /* HTMLMediaElementMediaStream.cpp in Sources */,
</span><del>-                                07FE99DC18807A7D00256648 /* HTMLMediaSession.cpp in Sources */,
</del><span class="cx">                                 A8EA79F80A1916DF00A8EF5F /* HTMLMenuElement.cpp in Sources */,
</span><span class="cx">                                 2BE8E2C912A58A0100FAD550 /* HTMLMetaCharsetParser.cpp in Sources */,
</span><span class="cx">                                 A871DC270A15205700B12A68 /* HTMLMetaElement.cpp in Sources */,
</span><span class="lines">@@ -29355,6 +29354,7 @@
</span><span class="cx">                                 5EA725D21ACABD4700EAD17B /* MediaDevices.cpp in Sources */,
</span><span class="cx">                                 97205AB71239291000B17380 /* MediaDocument.cpp in Sources */,
</span><span class="cx">                                 FD6F252C13F5EF0E0065165F /* MediaElementAudioSourceNode.cpp in Sources */,
</span><ins>+                                07FE99DC18807A7D00256648 /* MediaElementSession.cpp in Sources */,
</ins><span class="cx">                                 4E1959210A39DABA00220FE5 /* MediaFeatureNames.cpp in Sources */,
</span><span class="cx">                                 07A6D1EB1491137700051D0C /* MediaFragmentURIParser.cpp in Sources */,
</span><span class="cx">                                 CDB859F7160D48A400E5B07F /* MediaKeyEvent.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (184965 => 184966)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2015-05-28 22:41:19 UTC (rev 184965)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2015-05-28 23:03:34 UTC (rev 184966)
</span><span class="lines">@@ -351,7 +351,7 @@
</span><span class="cx"> #if ENABLE(WEB_AUDIO)
</span><span class="cx">     , m_audioSourceNode(0)
</span><span class="cx"> #endif
</span><del>-    , m_mediaSession(std::make_unique&lt;HTMLMediaSession&gt;(*this))
</del><ins>+    , m_mediaSession(std::make_unique&lt;MediaElementSession&gt;(*this))
</ins><span class="cx">     , m_reportedExtraMemoryCost(0)
</span><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><span class="cx">     , m_mediaStreamSrcObject(nullptr)
</span><span class="lines">@@ -360,36 +360,36 @@
</span><span class="cx">     LOG(Media, &quot;HTMLMediaElement::HTMLMediaElement(%p)&quot;, this);
</span><span class="cx">     setHasCustomStyleResolveCallbacks();
</span><span class="cx"> 
</span><del>-    m_mediaSession-&gt;addBehaviorRestriction(HTMLMediaSession::RequireUserGestureForFullscreen);
-    m_mediaSession-&gt;addBehaviorRestriction(HTMLMediaSession::RequirePageConsentToLoadMedia);
</del><ins>+    m_mediaSession-&gt;addBehaviorRestriction(MediaElementSession::RequireUserGestureForFullscreen);
+    m_mediaSession-&gt;addBehaviorRestriction(MediaElementSession::RequirePageConsentToLoadMedia);
</ins><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET)
</span><del>-    m_mediaSession-&gt;addBehaviorRestriction(HTMLMediaSession::RequireUserGestureToAutoplayToExternalDevice);
</del><ins>+    m_mediaSession-&gt;addBehaviorRestriction(MediaElementSession::RequireUserGestureToAutoplayToExternalDevice);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     // FIXME: We should clean up and look to better merge the iOS and non-iOS code below.
</span><span class="cx">     Settings* settings = document.settings();
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">     if (settings &amp;&amp; settings-&gt;requiresUserGestureForMediaPlayback()) {
</span><del>-        m_mediaSession-&gt;addBehaviorRestriction(HTMLMediaSession::RequireUserGestureForRateChange);
-        m_mediaSession-&gt;addBehaviorRestriction(HTMLMediaSession::RequireUserGestureForLoad);
</del><ins>+        m_mediaSession-&gt;addBehaviorRestriction(MediaElementSession::RequireUserGestureForRateChange);
+        m_mediaSession-&gt;addBehaviorRestriction(MediaElementSession::RequireUserGestureForLoad);
</ins><span class="cx">     }
</span><span class="cx"> #else
</span><span class="cx">     m_sendProgressEvents = false;
</span><span class="cx">     if (!settings || settings-&gt;requiresUserGestureForMediaPlayback()) {
</span><span class="cx">         // Allow autoplay in a MediaDocument that is not in an iframe.
</span><span class="cx">         if (document.ownerElement() || !document.isMediaDocument())
</span><del>-            m_mediaSession-&gt;addBehaviorRestriction(HTMLMediaSession::RequireUserGestureForRateChange);
</del><ins>+            m_mediaSession-&gt;addBehaviorRestriction(MediaElementSession::RequireUserGestureForRateChange);
</ins><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET)
</span><del>-        m_mediaSession-&gt;addBehaviorRestriction(HTMLMediaSession::RequireUserGestureToShowPlaybackTargetPicker);
</del><ins>+        m_mediaSession-&gt;addBehaviorRestriction(MediaElementSession::RequireUserGestureToShowPlaybackTargetPicker);
</ins><span class="cx"> #endif
</span><span class="cx">     } else {
</span><span class="cx">         // Relax RequireUserGestureForFullscreen when requiresUserGestureForMediaPlayback is not set:
</span><del>-        m_mediaSession-&gt;removeBehaviorRestriction(HTMLMediaSession::RequireUserGestureForFullscreen);
</del><ins>+        m_mediaSession-&gt;removeBehaviorRestriction(MediaElementSession::RequireUserGestureForFullscreen);
</ins><span class="cx">     }
</span><span class="cx"> #endif // !PLATFORM(IOS)
</span><span class="cx"> 
</span><span class="cx">     if (settings &amp;&amp; settings-&gt;audioPlaybackRequiresUserGesture())
</span><del>-        m_mediaSession-&gt;addBehaviorRestriction(HTMLMediaSession::RequireUserGestureForAudioRateChange);
</del><ins>+        m_mediaSession-&gt;addBehaviorRestriction(MediaElementSession::RequireUserGestureForAudioRateChange);
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx">     if (document.page())
</span><span class="lines">@@ -1021,7 +1021,7 @@
</span><span class="cx">     // Once the page has allowed an element to load media, it is free to load at will. This allows a 
</span><span class="cx">     // playlist that starts in a foreground tab to continue automatically if the tab is subsequently 
</span><span class="cx">     // put into the background.
</span><del>-    m_mediaSession-&gt;removeBehaviorRestriction(HTMLMediaSession::RequirePageConsentToLoadMedia);
</del><ins>+    m_mediaSession-&gt;removeBehaviorRestriction(MediaElementSession::RequirePageConsentToLoadMedia);
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx">     if (hasMediaControls())
</span><span class="lines">@@ -1200,7 +1200,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><span class="cx">     if (MediaStreamRegistry::registry().lookup(url.string()))
</span><del>-        m_mediaSession-&gt;removeBehaviorRestriction(HTMLMediaSession::RequireUserGestureForRateChange);
</del><ins>+        m_mediaSession-&gt;removeBehaviorRestriction(MediaElementSession::RequireUserGestureForRateChange);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     if (m_sendProgressEvents) 
</span><span class="lines">@@ -4835,7 +4835,7 @@
</span><span class="cx">     {
</span><span class="cx">         case PageCache:
</span><span class="cx">             stop();
</span><del>-            m_mediaSession-&gt;addBehaviorRestriction(HTMLMediaSession::RequirePageConsentToResumeMedia);
</del><ins>+            m_mediaSession-&gt;addBehaviorRestriction(MediaElementSession::RequirePageConsentToResumeMedia);
</ins><span class="cx">             break;
</span><span class="cx">         case DocumentWillBePaused:
</span><span class="cx">         case JavaScriptDebuggerPaused:
</span><span class="lines">@@ -4857,7 +4857,7 @@
</span><span class="cx">     else
</span><span class="cx">         setPausedInternal(false);
</span><span class="cx"> 
</span><del>-    m_mediaSession-&gt;removeBehaviorRestriction(HTMLMediaSession::RequirePageConsentToResumeMedia);
</del><ins>+    m_mediaSession-&gt;removeBehaviorRestriction(MediaElementSession::RequirePageConsentToResumeMedia);
</ins><span class="cx"> 
</span><span class="cx">     if (m_error &amp;&amp; m_error-&gt;code() == MediaError::MEDIA_ERR_ABORTED) {
</span><span class="cx">         // Restart the load if it was aborted in the middle by moving the document to the page cache.
</span><span class="lines">@@ -5962,15 +5962,15 @@
</span><span class="cx"> 
</span><span class="cx"> void HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture()
</span><span class="cx"> {
</span><del>-    HTMLMediaSession::BehaviorRestrictions restrictionsToRemove = HTMLMediaSession::RequireUserGestureForLoad
</del><ins>+    MediaElementSession::BehaviorRestrictions restrictionsToRemove = MediaElementSession::RequireUserGestureForLoad
</ins><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET)
</span><del>-        | HTMLMediaSession::RequireUserGestureToShowPlaybackTargetPicker
-        | HTMLMediaSession::RequireUserGestureToAutoplayToExternalDevice
</del><ins>+        | MediaElementSession::RequireUserGestureToShowPlaybackTargetPicker
+        | MediaElementSession::RequireUserGestureToAutoplayToExternalDevice
</ins><span class="cx"> #endif
</span><del>-        | HTMLMediaSession::RequireUserGestureForLoad
-        | HTMLMediaSession::RequireUserGestureForRateChange
-        | HTMLMediaSession::RequireUserGestureForAudioRateChange
-        | HTMLMediaSession::RequireUserGestureForFullscreen;
</del><ins>+        | MediaElementSession::RequireUserGestureForLoad
+        | MediaElementSession::RequireUserGestureForRateChange
+        | MediaElementSession::RequireUserGestureForAudioRateChange
+        | MediaElementSession::RequireUserGestureForFullscreen;
</ins><span class="cx">     m_mediaSession-&gt;removeBehaviorRestriction(restrictionsToRemove);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -6295,7 +6295,7 @@
</span><span class="cx">     if (!m_mediaSession-&gt;wirelessVideoPlaybackDisabled(*this) &amp;&amp; m_hasPlaybackTargetAvailabilityListeners &amp;&amp; m_player-&gt;canPlayToWirelessPlaybackTarget())
</span><span class="cx">         state |= RequiresPlaybackTargetMonitoring;
</span><span class="cx"> 
</span><del>-    bool requireUserGesture = m_mediaSession-&gt;hasBehaviorRestriction(HTMLMediaSession::RequireUserGestureToAutoplayToExternalDevice);
</del><ins>+    bool requireUserGesture = m_mediaSession-&gt;hasBehaviorRestriction(MediaElementSession::RequireUserGestureToAutoplayToExternalDevice);
</ins><span class="cx">     if (hasActiveVideo &amp;&amp; (!requireUserGesture || (hasAudio &amp;&amp; !loop())))
</span><span class="cx">         state |= ExternalDeviceAutoPlayCandidate;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (184965 => 184966)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.h        2015-05-28 22:41:19 UTC (rev 184965)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h        2015-05-28 23:03:34 UTC (rev 184966)
</span><span class="lines">@@ -32,9 +32,9 @@
</span><span class="cx"> #include &quot;GenericEventQueue.h&quot;
</span><span class="cx"> #include &quot;GenericTaskQueue.h&quot;
</span><span class="cx"> #include &quot;HTMLMediaElementEnums.h&quot;
</span><del>-#include &quot;HTMLMediaSession.h&quot;
</del><span class="cx"> #include &quot;MediaCanStartListener.h&quot;
</span><span class="cx"> #include &quot;MediaControllerInterface.h&quot;
</span><ins>+#include &quot;MediaElementSession.h&quot;
</ins><span class="cx"> #include &quot;MediaProducer.h&quot;
</span><span class="cx"> #include &quot;PageThrottler.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -416,7 +416,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     MediaPlayerEnums::Preload preloadValue() const { return m_preload; }
</span><del>-    HTMLMediaSession&amp; mediaSession() const { return *m_mediaSession; }
</del><ins>+    MediaElementSession&amp; mediaSession() const { return *m_mediaSession; }
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_CONTROLS_SCRIPT)
</span><span class="cx">     void pageScaleFactorChanged();
</span><span class="lines">@@ -894,7 +894,7 @@
</span><span class="cx">     RefPtr&lt;PlatformTextTrackMenuInterface&gt; m_platformMenu;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    std::unique_ptr&lt;HTMLMediaSession&gt; m_mediaSession;
</del><ins>+    std::unique_ptr&lt;MediaElementSession&gt; m_mediaSession;
</ins><span class="cx">     PageActivityAssertionToken m_activityToken;
</span><span class="cx">     size_t m_reportedExtraMemoryCost;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaSessioncpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/html/HTMLMediaSession.cpp (184965 => 184966)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaSession.cpp        2015-05-28 22:41:19 UTC (rev 184965)
+++ trunk/Source/WebCore/html/HTMLMediaSession.cpp        2015-05-28 23:03:34 UTC (rev 184966)
</span><span class="lines">@@ -1,422 +0,0 @@
</span><del>-/*
- * Copyright (C) 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;
-
-#if ENABLE(VIDEO)
-
-#include &quot;HTMLMediaSession.h&quot;
-
-#include &quot;Chrome.h&quot;
-#include &quot;ChromeClient.h&quot;
-#include &quot;Document.h&quot;
-#include &quot;Frame.h&quot;
-#include &quot;FrameView.h&quot;
-#include &quot;HTMLMediaElement.h&quot;
-#include &quot;HTMLNames.h&quot;
-#include &quot;HTMLVideoElement.h&quot;
-#include &quot;Logging.h&quot;
-#include &quot;MediaSessionManager.h&quot;
-#include &quot;Page.h&quot;
-#include &quot;ScriptController.h&quot;
-#include &quot;SourceBuffer.h&quot;
-
-#if PLATFORM(IOS)
-#include &quot;AudioSession.h&quot;
-#include &quot;RuntimeApplicationChecksIOS.h&quot;
-#endif
-
-namespace WebCore {
-
-#if !LOG_DISABLED
-static String restrictionName(HTMLMediaSession::BehaviorRestrictions restriction)
-{
-    StringBuilder restrictionBuilder;
-#define CASE(restrictionType) \
-    if (restriction &amp; HTMLMediaSession::restrictionType) { \
-        if (!restrictionBuilder.isEmpty()) \
-            restrictionBuilder.append(&quot;, &quot;); \
-        restrictionBuilder.append(#restrictionType); \
-    } \
-
-    CASE(NoRestrictions);
-    CASE(RequireUserGestureForLoad);
-    CASE(RequireUserGestureForRateChange);
-    CASE(RequireUserGestureForAudioRateChange);
-    CASE(RequireUserGestureForFullscreen);
-    CASE(RequirePageConsentToLoadMedia);
-    CASE(RequirePageConsentToResumeMedia);
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
-    CASE(RequireUserGestureToShowPlaybackTargetPicker);
-    CASE(WirelessVideoPlaybackDisabled);
-#endif
-    CASE(RequireUserGestureForAudioRateChange);
-
-    return restrictionBuilder.toString();
-}
-#endif
-
-HTMLMediaSession::HTMLMediaSession(MediaSessionClient&amp; client)
-    : MediaSession(client)
-    , m_restrictions(NoRestrictions)
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
-    , m_targetAvailabilityChangedTimer(*this, &amp;HTMLMediaSession::targetAvailabilityChangedTimerFired)
-#endif
-{
-}
-
-void HTMLMediaSession::registerWithDocument(const HTMLMediaElement&amp; element)
-{
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
-    element.document().addPlaybackTargetPickerClient(*this);
-#else
-    UNUSED_PARAM(element);
-#endif
-}
-
-void HTMLMediaSession::unregisterWithDocument(const HTMLMediaElement&amp; element)
-{
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
-    element.document().removePlaybackTargetPickerClient(*this);
-#else
-    UNUSED_PARAM(element);
-#endif
-}
-
-void HTMLMediaSession::addBehaviorRestriction(BehaviorRestrictions restriction)
-{
-    LOG(Media, &quot;HTMLMediaSession::addBehaviorRestriction - adding %s&quot;, restrictionName(restriction).utf8().data());
-    m_restrictions |= restriction;
-}
-
-void HTMLMediaSession::removeBehaviorRestriction(BehaviorRestrictions restriction)
-{
-    LOG(Media, &quot;HTMLMediaSession::removeBehaviorRestriction - removing %s&quot;, restrictionName(restriction).utf8().data());
-    m_restrictions &amp;= ~restriction;
-}
-
-bool HTMLMediaSession::playbackPermitted(const HTMLMediaElement&amp; element) const
-{
-    if (m_restrictions &amp; RequireUserGestureForRateChange &amp;&amp; !ScriptController::processingUserGesture()) {
-        LOG(Media, &quot;HTMLMediaSession::playbackPermitted - returning FALSE&quot;);
-        return false;
-    }
-
-    if (m_restrictions &amp; RequireUserGestureForAudioRateChange &amp;&amp; element.hasAudio() &amp;&amp; !ScriptController::processingUserGesture()) {
-        LOG(Media, &quot;HTMLMediaSession::playbackPermitted - returning FALSE&quot;);
-        return false;
-    }
-
-    return true;
-}
-
-bool HTMLMediaSession::dataLoadingPermitted(const HTMLMediaElement&amp;) const
-{
-    if (m_restrictions &amp; RequireUserGestureForLoad &amp;&amp; !ScriptController::processingUserGesture()) {
-        LOG(Media, &quot;HTMLMediaSession::dataLoadingPermitted - returning FALSE&quot;);
-        return false;
-    }
-
-    return true;
-}
-
-bool HTMLMediaSession::fullscreenPermitted(const HTMLMediaElement&amp;) const
-{
-    if (m_restrictions &amp; RequireUserGestureForFullscreen &amp;&amp; !ScriptController::processingUserGesture()) {
-        LOG(Media, &quot;HTMLMediaSession::fullscreenPermitted - returning FALSE&quot;);
-        return false;
-    }
-
-    return true;
-}
-
-bool HTMLMediaSession::pageAllowsDataLoading(const HTMLMediaElement&amp; element) const
-{
-    Page* page = element.document().page();
-    if (m_restrictions &amp; RequirePageConsentToLoadMedia &amp;&amp; page &amp;&amp; !page-&gt;canStartMedia()) {
-        LOG(Media, &quot;HTMLMediaSession::pageAllowsDataLoading - returning FALSE&quot;);
-        return false;
-    }
-
-    return true;
-}
-
-bool HTMLMediaSession::pageAllowsPlaybackAfterResuming(const HTMLMediaElement&amp; element) const
-{
-    Page* page = element.document().page();
-    if (m_restrictions &amp; RequirePageConsentToResumeMedia &amp;&amp; page &amp;&amp; !page-&gt;canStartMedia()) {
-        LOG(Media, &quot;HTMLMediaSession::pageAllowsPlaybackAfterResuming - returning FALSE&quot;);
-        return false;
-    }
-
-    return true;
-}
-
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
-void HTMLMediaSession::showPlaybackTargetPicker(const HTMLMediaElement&amp; element)
-{
-    LOG(Media, &quot;HTMLMediaSession::showPlaybackTargetPicker&quot;);
-
-    if (m_restrictions &amp; RequireUserGestureToShowPlaybackTargetPicker &amp;&amp; !ScriptController::processingUserGesture()) {
-        LOG(Media, &quot;HTMLMediaSession::showPlaybackTargetPicker - returning early because of permissions&quot;);
-        return;
-    }
-
-    if (!element.document().page()) {
-        LOG(Media, &quot;HTMLMediaSession::showingPlaybackTargetPickerPermitted - returning early because page is NULL&quot;);
-        return;
-    }
-
-#if !PLATFORM(IOS)
-    if (!element.hasVideo()) {
-        LOG(Media, &quot;HTMLMediaSession::showPlaybackTargetPicker - returning early because element has no video&quot;);
-        return;
-    }
-#endif
-
-    element.document().showPlaybackTargetPicker(*this, is&lt;HTMLVideoElement&gt;(element));
-}
-
-bool HTMLMediaSession::hasWirelessPlaybackTargets(const HTMLMediaElement&amp;) const
-{
-#if PLATFORM(IOS)
-    // FIXME: consolidate Mac and iOS implementations
-    m_hasPlaybackTargets = MediaSessionManager::sharedManager().hasWirelessTargetsAvailable();
-#endif
-
-    LOG(Media, &quot;HTMLMediaSession::hasWirelessPlaybackTargets - returning %s&quot;, m_hasPlaybackTargets ? &quot;TRUE&quot; : &quot;FALSE&quot;);
-
-    return m_hasPlaybackTargets;
-}
-
-bool HTMLMediaSession::wirelessVideoPlaybackDisabled(const HTMLMediaElement&amp; element) const
-{
-    Settings* settings = element.document().settings();
-    if (!settings || !settings-&gt;allowsAirPlayForMediaPlayback()) {
-        LOG(Media, &quot;HTMLMediaSession::wirelessVideoPlaybackDisabled - returning TRUE because of settings&quot;);
-        return true;
-    }
-
-    if (element.fastHasAttribute(HTMLNames::webkitwirelessvideoplaybackdisabledAttr)) {
-        LOG(Media, &quot;HTMLMediaSession::wirelessVideoPlaybackDisabled - returning TRUE because of attribute&quot;);
-        return true;
-    }
-
-#if PLATFORM(IOS)
-    String legacyAirplayAttributeValue = element.fastGetAttribute(HTMLNames::webkitairplayAttr);
-    if (equalIgnoringCase(legacyAirplayAttributeValue, &quot;deny&quot;)) {
-        LOG(Media, &quot;HTMLMediaSession::wirelessVideoPlaybackDisabled - returning TRUE because of legacy attribute&quot;);
-        return true;
-    }
-    if (equalIgnoringCase(legacyAirplayAttributeValue, &quot;allow&quot;)) {
-        LOG(Media, &quot;HTMLMediaSession::wirelessVideoPlaybackDisabled - returning FALSE because of legacy attribute&quot;);
-        return false;
-    }
-#endif
-
-    MediaPlayer* player = element.player();
-    if (!player)
-        return true;
-
-    bool disabled = player-&gt;wirelessVideoPlaybackDisabled();
-    LOG(Media, &quot;HTMLMediaSession::wirelessVideoPlaybackDisabled - returning %s because media engine says so&quot;, disabled ? &quot;TRUE&quot; : &quot;FALSE&quot;);
-    
-    return disabled;
-}
-
-void HTMLMediaSession::setWirelessVideoPlaybackDisabled(const HTMLMediaElement&amp; element, bool disabled)
-{
-    if (disabled)
-        addBehaviorRestriction(WirelessVideoPlaybackDisabled);
-    else
-        removeBehaviorRestriction(WirelessVideoPlaybackDisabled);
-
-    MediaPlayer* player = element.player();
-    if (!player)
-        return;
-
-    LOG(Media, &quot;HTMLMediaSession::setWirelessVideoPlaybackDisabled - disabled %s&quot;, disabled ? &quot;TRUE&quot; : &quot;FALSE&quot;);
-    player-&gt;setWirelessVideoPlaybackDisabled(disabled);
-}
-
-void HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners(const HTMLMediaElement&amp; element, bool hasListeners)
-{
-    LOG(Media, &quot;HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners - hasListeners %s&quot;, hasListeners ? &quot;TRUE&quot; : &quot;FALSE&quot;);
-
-#if PLATFORM(IOS)
-    UNUSED_PARAM(element);
-    m_hasPlaybackTargetAvailabilityListeners = hasListeners;
-    MediaSessionManager::sharedManager().configureWireLessTargetMonitoring();
-#else
-    UNUSED_PARAM(hasListeners);
-    element.document().playbackTargetPickerClientStateDidChange(*this, element.mediaState());
-#endif
-}
-
-void HTMLMediaSession::setPlaybackTarget(Ref&lt;MediaPlaybackTarget&gt;&amp;&amp; device)
-{
-    m_playbackTarget = WTF::move(device);
-    client().setWirelessPlaybackTarget(*m_playbackTarget.copyRef());
-}
-
-void HTMLMediaSession::targetAvailabilityChangedTimerFired()
-{
-    client().wirelessRoutesAvailableDidChange();
-}
-
-void HTMLMediaSession::externalOutputDeviceAvailableDidChange(bool hasTargets)
-{
-    if (m_hasPlaybackTargets == hasTargets)
-        return;
-
-    LOG(Media, &quot;HTMLMediaSession::externalOutputDeviceAvailableDidChange(%p) - hasTargets %s&quot;, this, hasTargets ? &quot;TRUE&quot; : &quot;FALSE&quot;);
-
-    m_hasPlaybackTargets = hasTargets;
-    m_targetAvailabilityChangedTimer.startOneShot(0);
-}
-
-bool HTMLMediaSession::canPlayToWirelessPlaybackTarget() const
-{
-    if (!m_playbackTarget || !m_playbackTarget-&gt;hasActiveRoute())
-        return false;
-
-    return client().canPlayToWirelessPlaybackTarget();
-}
-
-bool HTMLMediaSession::isPlayingToWirelessPlaybackTarget() const
-{
-    if (!m_playbackTarget || !m_playbackTarget-&gt;hasActiveRoute())
-        return false;
-
-    return client().isPlayingToWirelessPlaybackTarget();
-}
-
-void HTMLMediaSession::setShouldPlayToPlaybackTarget(bool shouldPlay)
-{
-    LOG(Media, &quot;HTMLMediaSession::setShouldPlayToPlaybackTarget - shouldPlay %s&quot;, shouldPlay ? &quot;TRUE&quot; : &quot;FALSE&quot;);
-    m_shouldPlayToPlaybackTarget = shouldPlay;
-    client().setShouldPlayToPlaybackTarget(shouldPlay);
-}
-
-void HTMLMediaSession::mediaStateDidChange(const HTMLMediaElement&amp; element, MediaProducer::MediaStateFlags state)
-{
-    element.document().playbackTargetPickerClientStateDidChange(*this, state);
-}
-#endif
-
-MediaPlayer::Preload HTMLMediaSession::effectivePreloadForElement(const HTMLMediaElement&amp; element) const
-{
-    MediaSessionManager::SessionRestrictions restrictions = MediaSessionManager::sharedManager().restrictions(mediaType());
-    MediaPlayer::Preload preload = element.preloadValue();
-
-    if ((restrictions &amp; MediaSessionManager::MetadataPreloadingNotPermitted) == MediaSessionManager::MetadataPreloadingNotPermitted)
-        return MediaPlayer::None;
-
-    if ((restrictions &amp; MediaSessionManager::AutoPreloadingNotPermitted) == MediaSessionManager::AutoPreloadingNotPermitted) {
-        if (preload &gt; MediaPlayer::MetaData)
-            return MediaPlayer::MetaData;
-    }
-
-    return preload;
-}
-
-bool HTMLMediaSession::requiresFullscreenForVideoPlayback(const HTMLMediaElement&amp; element) const
-{
-    if (!MediaSessionManager::sharedManager().sessionRestrictsInlineVideoPlayback(*this))
-        return false;
-
-    Settings* settings = element.document().settings();
-    if (!settings || !settings-&gt;allowsInlineMediaPlayback())
-        return true;
-
-    if (element.fastHasAttribute(HTMLNames::webkit_playsinlineAttr))
-        return false;
-
-#if PLATFORM(IOS)
-    if (applicationIsDumpRenderTree())
-        return false;
-#endif
-
-    return true;
-}
-
-void HTMLMediaSession::mediaEngineUpdated(const HTMLMediaElement&amp; element)
-{
-    LOG(Media, &quot;HTMLMediaSession::mediaEngineUpdated&quot;);
-
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
-    if (m_restrictions &amp; WirelessVideoPlaybackDisabled)
-        setWirelessVideoPlaybackDisabled(element, true);
-    if (m_playbackTarget)
-        client().setWirelessPlaybackTarget(*m_playbackTarget.copyRef());
-    if (m_shouldPlayToPlaybackTarget)
-        client().setShouldPlayToPlaybackTarget(true);
-#else
-    UNUSED_PARAM(element);
-#endif
-    
-}
-
-bool HTMLMediaSession::allowsAlternateFullscreen(const HTMLMediaElement&amp; element) const
-{
-    Settings* settings = element.document().settings();
-    return settings &amp;&amp; settings-&gt;allowsAlternateFullscreen();
-}
-
-#if ENABLE(MEDIA_SOURCE)
-const unsigned fiveMinutesOf1080PVideo = 290 * 1024 * 1024; // 290 MB is approximately 5 minutes of 8Mbps (1080p) content.
-const unsigned fiveMinutesStereoAudio = 14 * 1024 * 1024; // 14 MB is approximately 5 minutes of 384kbps content.
-
-size_t HTMLMediaSession::maximumMediaSourceBufferSize(const SourceBuffer&amp; buffer) const
-{
-    // A good quality 1080p video uses 8,000 kbps and stereo audio uses 384 kbps, so assume 95% for video and 5% for audio.
-    const float bufferBudgetPercentageForVideo = .95;
-    const float bufferBudgetPercentageForAudio = .05;
-
-    size_t maximum;
-    Settings* settings = buffer.document().settings();
-    if (settings)
-        maximum = settings-&gt;maximumSourceBufferSize();
-    else
-        maximum = fiveMinutesOf1080PVideo + fiveMinutesStereoAudio;
-
-    // Allow a SourceBuffer to buffer as though it is audio-only even if it doesn't have any active tracks (yet).
-    size_t bufferSize = static_cast&lt;size_t&gt;(maximum * bufferBudgetPercentageForAudio);
-    if (buffer.hasVideo())
-        bufferSize += static_cast&lt;size_t&gt;(maximum * bufferBudgetPercentageForVideo);
-
-    // FIXME: we might want to modify this algorithm to:
-    // - decrease the maximum size for background tabs
-    // - decrease the maximum size allowed for inactive elements when a process has more than one
-    //   element, eg. so a page with many elements which are played one at a time doesn't keep
-    //   everything buffered after an element has finished playing.
-
-    return bufferSize;
-}
-#endif
-
-}
-
-#endif // ENABLE(VIDEO)
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaSessionh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/html/HTMLMediaSession.h (184965 => 184966)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaSession.h        2015-05-28 22:41:19 UTC (rev 184965)
+++ trunk/Source/WebCore/html/HTMLMediaSession.h        2015-05-28 23:03:34 UTC (rev 184966)
</span><span class="lines">@@ -1,134 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014-2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef HTMLMediaSession_h
-#define HTMLMediaSession_h
-
-#if ENABLE(VIDEO)
-
-#include &quot;MediaPlayer.h&quot;
-#include &quot;MediaSession.h&quot;
-#include &quot;Timer.h&quot;
-
-namespace WebCore {
-
-class Document;
-class HTMLMediaElement;
-class SourceBuffer;
-
-class HTMLMediaSession final : public MediaSession {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    explicit HTMLMediaSession(MediaSessionClient&amp;);
-    virtual ~HTMLMediaSession() { }
-
-    void registerWithDocument(const HTMLMediaElement&amp;);
-    void unregisterWithDocument(const HTMLMediaElement&amp;);
-
-    bool playbackPermitted(const HTMLMediaElement&amp;) const;
-    bool dataLoadingPermitted(const HTMLMediaElement&amp;) const;
-    bool fullscreenPermitted(const HTMLMediaElement&amp;) const;
-    bool pageAllowsDataLoading(const HTMLMediaElement&amp;) const;
-    bool pageAllowsPlaybackAfterResuming(const HTMLMediaElement&amp;) const;
-
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
-    void showPlaybackTargetPicker(const HTMLMediaElement&amp;);
-    bool hasWirelessPlaybackTargets(const HTMLMediaElement&amp;) const;
-
-    bool wirelessVideoPlaybackDisabled(const HTMLMediaElement&amp;) const;
-    void setWirelessVideoPlaybackDisabled(const HTMLMediaElement&amp;, bool);
-
-    void setHasPlaybackTargetAvailabilityListeners(const HTMLMediaElement&amp;, bool);
-
-    virtual bool canPlayToWirelessPlaybackTarget() const override;
-    virtual bool isPlayingToWirelessPlaybackTarget() const override;
-
-    void mediaStateDidChange(const HTMLMediaElement&amp;, MediaProducer::MediaStateFlags);
-#endif
-
-    bool requiresFullscreenForVideoPlayback(const HTMLMediaElement&amp;) const;
-    WEBCORE_EXPORT bool allowsAlternateFullscreen(const HTMLMediaElement&amp;) const;
-    MediaPlayer::Preload effectivePreloadForElement(const HTMLMediaElement&amp;) const;
-
-    void mediaEngineUpdated(const HTMLMediaElement&amp;);
-
-    // Restrictions to modify default behaviors.
-    enum BehaviorRestrictionFlags {
-        NoRestrictions = 0,
-        RequireUserGestureForLoad = 1 &lt;&lt; 0,
-        RequireUserGestureForRateChange = 1 &lt;&lt; 1,
-        RequireUserGestureForFullscreen = 1 &lt;&lt; 2,
-        RequirePageConsentToLoadMedia = 1 &lt;&lt; 3,
-        RequirePageConsentToResumeMedia = 1 &lt;&lt; 4,
-        RequireUserGestureForAudioRateChange = 1 &lt;&lt; 5,
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
-        RequireUserGestureToShowPlaybackTargetPicker = 1 &lt;&lt; 6,
-        WirelessVideoPlaybackDisabled =  1 &lt;&lt; 7,
-        RequireUserGestureToAutoplayToExternalDevice = 1 &lt;&lt; 8,
-#endif
-    };
-    typedef unsigned BehaviorRestrictions;
-
-    WEBCORE_EXPORT BehaviorRestrictions behaviorRestrictions() const { return m_restrictions; }
-    WEBCORE_EXPORT void addBehaviorRestriction(BehaviorRestrictions);
-    WEBCORE_EXPORT void removeBehaviorRestriction(BehaviorRestrictions);
-    bool hasBehaviorRestriction(BehaviorRestrictions restriction) const { return restriction &amp; m_restrictions; }
-
-#if ENABLE(MEDIA_SOURCE)
-    size_t maximumMediaSourceBufferSize(const SourceBuffer&amp;) const;
-#endif
-
-private:
-
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
-    void targetAvailabilityChangedTimerFired();
-
-    // MediaPlaybackTargetClient
-    virtual void setPlaybackTarget(Ref&lt;MediaPlaybackTarget&gt;&amp;&amp;) override;
-    virtual void externalOutputDeviceAvailableDidChange(bool) override;
-    virtual void setShouldPlayToPlaybackTarget(bool) override;
-#endif
-#if PLATFORM(IOS)
-    bool requiresPlaybackTargetRouteMonitoring() const override { return m_hasPlaybackTargetAvailabilityListeners; }
-#endif
-
-    BehaviorRestrictions m_restrictions;
-
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
-    mutable Timer m_targetAvailabilityChangedTimer;
-    RefPtr&lt;MediaPlaybackTarget&gt; m_playbackTarget;
-    bool m_shouldPlayToPlaybackTarget { false };
-    mutable bool m_hasPlaybackTargets { false };
-#endif
-#if PLATFORM(IOS)
-    bool m_hasPlaybackTargetAvailabilityListeners { false };
-#endif
-};
-
-}
-
-#endif // MediaSession_h
-
-#endif // ENABLE(VIDEO)
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlMediaElementSessioncppfromrev184965trunkSourceWebCorehtmlHTMLMediaSessioncpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/html/MediaElementSession.cpp (from rev 184965, trunk/Source/WebCore/html/HTMLMediaSession.cpp) (0 => 184966)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/MediaElementSession.cpp                                (rev 0)
+++ trunk/Source/WebCore/html/MediaElementSession.cpp        2015-05-28 23:03:34 UTC (rev 184966)
</span><span class="lines">@@ -0,0 +1,422 @@
</span><ins>+/*
+ * Copyright (C) 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;
+
+#if ENABLE(VIDEO)
+
+#include &quot;MediaElementSession.h&quot;
+
+#include &quot;Chrome.h&quot;
+#include &quot;ChromeClient.h&quot;
+#include &quot;Document.h&quot;
+#include &quot;Frame.h&quot;
+#include &quot;FrameView.h&quot;
+#include &quot;HTMLMediaElement.h&quot;
+#include &quot;HTMLNames.h&quot;
+#include &quot;HTMLVideoElement.h&quot;
+#include &quot;Logging.h&quot;
+#include &quot;MediaSessionManager.h&quot;
+#include &quot;Page.h&quot;
+#include &quot;ScriptController.h&quot;
+#include &quot;SourceBuffer.h&quot;
+
+#if PLATFORM(IOS)
+#include &quot;AudioSession.h&quot;
+#include &quot;RuntimeApplicationChecksIOS.h&quot;
+#endif
+
+namespace WebCore {
+
+#if !LOG_DISABLED
+static String restrictionName(MediaElementSession::BehaviorRestrictions restriction)
+{
+    StringBuilder restrictionBuilder;
+#define CASE(restrictionType) \
+    if (restriction &amp; MediaElementSession::restrictionType) { \
+        if (!restrictionBuilder.isEmpty()) \
+            restrictionBuilder.append(&quot;, &quot;); \
+        restrictionBuilder.append(#restrictionType); \
+    } \
+
+    CASE(NoRestrictions);
+    CASE(RequireUserGestureForLoad);
+    CASE(RequireUserGestureForRateChange);
+    CASE(RequireUserGestureForAudioRateChange);
+    CASE(RequireUserGestureForFullscreen);
+    CASE(RequirePageConsentToLoadMedia);
+    CASE(RequirePageConsentToResumeMedia);
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+    CASE(RequireUserGestureToShowPlaybackTargetPicker);
+    CASE(WirelessVideoPlaybackDisabled);
+#endif
+    CASE(RequireUserGestureForAudioRateChange);
+
+    return restrictionBuilder.toString();
+}
+#endif
+
+MediaElementSession::MediaElementSession(MediaSessionClient&amp; client)
+    : MediaSession(client)
+    , m_restrictions(NoRestrictions)
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+    , m_targetAvailabilityChangedTimer(*this, &amp;MediaElementSession::targetAvailabilityChangedTimerFired)
+#endif
+{
+}
+
+void MediaElementSession::registerWithDocument(const HTMLMediaElement&amp; element)
+{
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+    element.document().addPlaybackTargetPickerClient(*this);
+#else
+    UNUSED_PARAM(element);
+#endif
+}
+
+void MediaElementSession::unregisterWithDocument(const HTMLMediaElement&amp; element)
+{
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+    element.document().removePlaybackTargetPickerClient(*this);
+#else
+    UNUSED_PARAM(element);
+#endif
+}
+
+void MediaElementSession::addBehaviorRestriction(BehaviorRestrictions restriction)
+{
+    LOG(Media, &quot;MediaElementSession::addBehaviorRestriction - adding %s&quot;, restrictionName(restriction).utf8().data());
+    m_restrictions |= restriction;
+}
+
+void MediaElementSession::removeBehaviorRestriction(BehaviorRestrictions restriction)
+{
+    LOG(Media, &quot;MediaElementSession::removeBehaviorRestriction - removing %s&quot;, restrictionName(restriction).utf8().data());
+    m_restrictions &amp;= ~restriction;
+}
+
+bool MediaElementSession::playbackPermitted(const HTMLMediaElement&amp; element) const
+{
+    if (m_restrictions &amp; RequireUserGestureForRateChange &amp;&amp; !ScriptController::processingUserGesture()) {
+        LOG(Media, &quot;MediaElementSession::playbackPermitted - returning FALSE&quot;);
+        return false;
+    }
+
+    if (m_restrictions &amp; RequireUserGestureForAudioRateChange &amp;&amp; element.hasAudio() &amp;&amp; !ScriptController::processingUserGesture()) {
+        LOG(Media, &quot;MediaElementSession::playbackPermitted - returning FALSE&quot;);
+        return false;
+    }
+
+    return true;
+}
+
+bool MediaElementSession::dataLoadingPermitted(const HTMLMediaElement&amp;) const
+{
+    if (m_restrictions &amp; RequireUserGestureForLoad &amp;&amp; !ScriptController::processingUserGesture()) {
+        LOG(Media, &quot;MediaElementSession::dataLoadingPermitted - returning FALSE&quot;);
+        return false;
+    }
+
+    return true;
+}
+
+bool MediaElementSession::fullscreenPermitted(const HTMLMediaElement&amp;) const
+{
+    if (m_restrictions &amp; RequireUserGestureForFullscreen &amp;&amp; !ScriptController::processingUserGesture()) {
+        LOG(Media, &quot;MediaElementSession::fullscreenPermitted - returning FALSE&quot;);
+        return false;
+    }
+
+    return true;
+}
+
+bool MediaElementSession::pageAllowsDataLoading(const HTMLMediaElement&amp; element) const
+{
+    Page* page = element.document().page();
+    if (m_restrictions &amp; RequirePageConsentToLoadMedia &amp;&amp; page &amp;&amp; !page-&gt;canStartMedia()) {
+        LOG(Media, &quot;MediaElementSession::pageAllowsDataLoading - returning FALSE&quot;);
+        return false;
+    }
+
+    return true;
+}
+
+bool MediaElementSession::pageAllowsPlaybackAfterResuming(const HTMLMediaElement&amp; element) const
+{
+    Page* page = element.document().page();
+    if (m_restrictions &amp; RequirePageConsentToResumeMedia &amp;&amp; page &amp;&amp; !page-&gt;canStartMedia()) {
+        LOG(Media, &quot;MediaElementSession::pageAllowsPlaybackAfterResuming - returning FALSE&quot;);
+        return false;
+    }
+
+    return true;
+}
+
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+void MediaElementSession::showPlaybackTargetPicker(const HTMLMediaElement&amp; element)
+{
+    LOG(Media, &quot;MediaElementSession::showPlaybackTargetPicker&quot;);
+
+    if (m_restrictions &amp; RequireUserGestureToShowPlaybackTargetPicker &amp;&amp; !ScriptController::processingUserGesture()) {
+        LOG(Media, &quot;MediaElementSession::showPlaybackTargetPicker - returning early because of permissions&quot;);
+        return;
+    }
+
+    if (!element.document().page()) {
+        LOG(Media, &quot;MediaElementSession::showingPlaybackTargetPickerPermitted - returning early because page is NULL&quot;);
+        return;
+    }
+
+#if !PLATFORM(IOS)
+    if (!element.hasVideo()) {
+        LOG(Media, &quot;MediaElementSession::showPlaybackTargetPicker - returning early because element has no video&quot;);
+        return;
+    }
+#endif
+
+    element.document().showPlaybackTargetPicker(*this, is&lt;HTMLVideoElement&gt;(element));
+}
+
+bool MediaElementSession::hasWirelessPlaybackTargets(const HTMLMediaElement&amp;) const
+{
+#if PLATFORM(IOS)
+    // FIXME: consolidate Mac and iOS implementations
+    m_hasPlaybackTargets = MediaSessionManager::sharedManager().hasWirelessTargetsAvailable();
+#endif
+
+    LOG(Media, &quot;MediaElementSession::hasWirelessPlaybackTargets - returning %s&quot;, m_hasPlaybackTargets ? &quot;TRUE&quot; : &quot;FALSE&quot;);
+
+    return m_hasPlaybackTargets;
+}
+
+bool MediaElementSession::wirelessVideoPlaybackDisabled(const HTMLMediaElement&amp; element) const
+{
+    Settings* settings = element.document().settings();
+    if (!settings || !settings-&gt;allowsAirPlayForMediaPlayback()) {
+        LOG(Media, &quot;MediaElementSession::wirelessVideoPlaybackDisabled - returning TRUE because of settings&quot;);
+        return true;
+    }
+
+    if (element.fastHasAttribute(HTMLNames::webkitwirelessvideoplaybackdisabledAttr)) {
+        LOG(Media, &quot;MediaElementSession::wirelessVideoPlaybackDisabled - returning TRUE because of attribute&quot;);
+        return true;
+    }
+
+#if PLATFORM(IOS)
+    String legacyAirplayAttributeValue = element.fastGetAttribute(HTMLNames::webkitairplayAttr);
+    if (equalIgnoringCase(legacyAirplayAttributeValue, &quot;deny&quot;)) {
+        LOG(Media, &quot;MediaElementSession::wirelessVideoPlaybackDisabled - returning TRUE because of legacy attribute&quot;);
+        return true;
+    }
+    if (equalIgnoringCase(legacyAirplayAttributeValue, &quot;allow&quot;)) {
+        LOG(Media, &quot;MediaElementSession::wirelessVideoPlaybackDisabled - returning FALSE because of legacy attribute&quot;);
+        return false;
+    }
+#endif
+
+    MediaPlayer* player = element.player();
+    if (!player)
+        return true;
+
+    bool disabled = player-&gt;wirelessVideoPlaybackDisabled();
+    LOG(Media, &quot;MediaElementSession::wirelessVideoPlaybackDisabled - returning %s because media engine says so&quot;, disabled ? &quot;TRUE&quot; : &quot;FALSE&quot;);
+    
+    return disabled;
+}
+
+void MediaElementSession::setWirelessVideoPlaybackDisabled(const HTMLMediaElement&amp; element, bool disabled)
+{
+    if (disabled)
+        addBehaviorRestriction(WirelessVideoPlaybackDisabled);
+    else
+        removeBehaviorRestriction(WirelessVideoPlaybackDisabled);
+
+    MediaPlayer* player = element.player();
+    if (!player)
+        return;
+
+    LOG(Media, &quot;MediaElementSession::setWirelessVideoPlaybackDisabled - disabled %s&quot;, disabled ? &quot;TRUE&quot; : &quot;FALSE&quot;);
+    player-&gt;setWirelessVideoPlaybackDisabled(disabled);
+}
+
+void MediaElementSession::setHasPlaybackTargetAvailabilityListeners(const HTMLMediaElement&amp; element, bool hasListeners)
+{
+    LOG(Media, &quot;MediaElementSession::setHasPlaybackTargetAvailabilityListeners - hasListeners %s&quot;, hasListeners ? &quot;TRUE&quot; : &quot;FALSE&quot;);
+
+#if PLATFORM(IOS)
+    UNUSED_PARAM(element);
+    m_hasPlaybackTargetAvailabilityListeners = hasListeners;
+    MediaSessionManager::sharedManager().configureWireLessTargetMonitoring();
+#else
+    UNUSED_PARAM(hasListeners);
+    element.document().playbackTargetPickerClientStateDidChange(*this, element.mediaState());
+#endif
+}
+
+void MediaElementSession::setPlaybackTarget(Ref&lt;MediaPlaybackTarget&gt;&amp;&amp; device)
+{
+    m_playbackTarget = WTF::move(device);
+    client().setWirelessPlaybackTarget(*m_playbackTarget.copyRef());
+}
+
+void MediaElementSession::targetAvailabilityChangedTimerFired()
+{
+    client().wirelessRoutesAvailableDidChange();
+}
+
+void MediaElementSession::externalOutputDeviceAvailableDidChange(bool hasTargets)
+{
+    if (m_hasPlaybackTargets == hasTargets)
+        return;
+
+    LOG(Media, &quot;MediaElementSession::externalOutputDeviceAvailableDidChange(%p) - hasTargets %s&quot;, this, hasTargets ? &quot;TRUE&quot; : &quot;FALSE&quot;);
+
+    m_hasPlaybackTargets = hasTargets;
+    m_targetAvailabilityChangedTimer.startOneShot(0);
+}
+
+bool MediaElementSession::canPlayToWirelessPlaybackTarget() const
+{
+    if (!m_playbackTarget || !m_playbackTarget-&gt;hasActiveRoute())
+        return false;
+
+    return client().canPlayToWirelessPlaybackTarget();
+}
+
+bool MediaElementSession::isPlayingToWirelessPlaybackTarget() const
+{
+    if (!m_playbackTarget || !m_playbackTarget-&gt;hasActiveRoute())
+        return false;
+
+    return client().isPlayingToWirelessPlaybackTarget();
+}
+
+void MediaElementSession::setShouldPlayToPlaybackTarget(bool shouldPlay)
+{
+    LOG(Media, &quot;MediaElementSession::setShouldPlayToPlaybackTarget - shouldPlay %s&quot;, shouldPlay ? &quot;TRUE&quot; : &quot;FALSE&quot;);
+    m_shouldPlayToPlaybackTarget = shouldPlay;
+    client().setShouldPlayToPlaybackTarget(shouldPlay);
+}
+
+void MediaElementSession::mediaStateDidChange(const HTMLMediaElement&amp; element, MediaProducer::MediaStateFlags state)
+{
+    element.document().playbackTargetPickerClientStateDidChange(*this, state);
+}
+#endif
+
+MediaPlayer::Preload MediaElementSession::effectivePreloadForElement(const HTMLMediaElement&amp; element) const
+{
+    MediaSessionManager::SessionRestrictions restrictions = MediaSessionManager::sharedManager().restrictions(mediaType());
+    MediaPlayer::Preload preload = element.preloadValue();
+
+    if ((restrictions &amp; MediaSessionManager::MetadataPreloadingNotPermitted) == MediaSessionManager::MetadataPreloadingNotPermitted)
+        return MediaPlayer::None;
+
+    if ((restrictions &amp; MediaSessionManager::AutoPreloadingNotPermitted) == MediaSessionManager::AutoPreloadingNotPermitted) {
+        if (preload &gt; MediaPlayer::MetaData)
+            return MediaPlayer::MetaData;
+    }
+
+    return preload;
+}
+
+bool MediaElementSession::requiresFullscreenForVideoPlayback(const HTMLMediaElement&amp; element) const
+{
+    if (!MediaSessionManager::sharedManager().sessionRestrictsInlineVideoPlayback(*this))
+        return false;
+
+    Settings* settings = element.document().settings();
+    if (!settings || !settings-&gt;allowsInlineMediaPlayback())
+        return true;
+
+    if (element.fastHasAttribute(HTMLNames::webkit_playsinlineAttr))
+        return false;
+
+#if PLATFORM(IOS)
+    if (applicationIsDumpRenderTree())
+        return false;
+#endif
+
+    return true;
+}
+
+void MediaElementSession::mediaEngineUpdated(const HTMLMediaElement&amp; element)
+{
+    LOG(Media, &quot;MediaElementSession::mediaEngineUpdated&quot;);
+
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+    if (m_restrictions &amp; WirelessVideoPlaybackDisabled)
+        setWirelessVideoPlaybackDisabled(element, true);
+    if (m_playbackTarget)
+        client().setWirelessPlaybackTarget(*m_playbackTarget.copyRef());
+    if (m_shouldPlayToPlaybackTarget)
+        client().setShouldPlayToPlaybackTarget(true);
+#else
+    UNUSED_PARAM(element);
+#endif
+    
+}
+
+bool MediaElementSession::allowsAlternateFullscreen(const HTMLMediaElement&amp; element) const
+{
+    Settings* settings = element.document().settings();
+    return settings &amp;&amp; settings-&gt;allowsAlternateFullscreen();
+}
+
+#if ENABLE(MEDIA_SOURCE)
+const unsigned fiveMinutesOf1080PVideo = 290 * 1024 * 1024; // 290 MB is approximately 5 minutes of 8Mbps (1080p) content.
+const unsigned fiveMinutesStereoAudio = 14 * 1024 * 1024; // 14 MB is approximately 5 minutes of 384kbps content.
+
+size_t MediaElementSession::maximumMediaSourceBufferSize(const SourceBuffer&amp; buffer) const
+{
+    // A good quality 1080p video uses 8,000 kbps and stereo audio uses 384 kbps, so assume 95% for video and 5% for audio.
+    const float bufferBudgetPercentageForVideo = .95;
+    const float bufferBudgetPercentageForAudio = .05;
+
+    size_t maximum;
+    Settings* settings = buffer.document().settings();
+    if (settings)
+        maximum = settings-&gt;maximumSourceBufferSize();
+    else
+        maximum = fiveMinutesOf1080PVideo + fiveMinutesStereoAudio;
+
+    // Allow a SourceBuffer to buffer as though it is audio-only even if it doesn't have any active tracks (yet).
+    size_t bufferSize = static_cast&lt;size_t&gt;(maximum * bufferBudgetPercentageForAudio);
+    if (buffer.hasVideo())
+        bufferSize += static_cast&lt;size_t&gt;(maximum * bufferBudgetPercentageForVideo);
+
+    // FIXME: we might want to modify this algorithm to:
+    // - decrease the maximum size for background tabs
+    // - decrease the maximum size allowed for inactive elements when a process has more than one
+    //   element, eg. so a page with many elements which are played one at a time doesn't keep
+    //   everything buffered after an element has finished playing.
+
+    return bufferSize;
+}
+#endif
+
+}
+
+#endif // ENABLE(VIDEO)
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlMediaElementSessionhfromrev184965trunkSourceWebCorehtmlHTMLMediaSessionh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/html/MediaElementSession.h (from rev 184965, trunk/Source/WebCore/html/HTMLMediaSession.h) (0 => 184966)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/MediaElementSession.h                                (rev 0)
+++ trunk/Source/WebCore/html/MediaElementSession.h        2015-05-28 23:03:34 UTC (rev 184966)
</span><span class="lines">@@ -0,0 +1,134 @@
</span><ins>+/*
+ * Copyright (C) 2014-2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef MediaElementSession_h
+#define MediaElementSession_h
+
+#if ENABLE(VIDEO)
+
+#include &quot;MediaPlayer.h&quot;
+#include &quot;MediaSession.h&quot;
+#include &quot;Timer.h&quot;
+
+namespace WebCore {
+
+class Document;
+class HTMLMediaElement;
+class SourceBuffer;
+
+class MediaElementSession final : public MediaSession {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    explicit MediaElementSession(MediaSessionClient&amp;);
+    virtual ~MediaElementSession() { }
+
+    void registerWithDocument(const HTMLMediaElement&amp;);
+    void unregisterWithDocument(const HTMLMediaElement&amp;);
+
+    bool playbackPermitted(const HTMLMediaElement&amp;) const;
+    bool dataLoadingPermitted(const HTMLMediaElement&amp;) const;
+    bool fullscreenPermitted(const HTMLMediaElement&amp;) const;
+    bool pageAllowsDataLoading(const HTMLMediaElement&amp;) const;
+    bool pageAllowsPlaybackAfterResuming(const HTMLMediaElement&amp;) const;
+
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+    void showPlaybackTargetPicker(const HTMLMediaElement&amp;);
+    bool hasWirelessPlaybackTargets(const HTMLMediaElement&amp;) const;
+
+    bool wirelessVideoPlaybackDisabled(const HTMLMediaElement&amp;) const;
+    void setWirelessVideoPlaybackDisabled(const HTMLMediaElement&amp;, bool);
+
+    void setHasPlaybackTargetAvailabilityListeners(const HTMLMediaElement&amp;, bool);
+
+    virtual bool canPlayToWirelessPlaybackTarget() const override;
+    virtual bool isPlayingToWirelessPlaybackTarget() const override;
+
+    void mediaStateDidChange(const HTMLMediaElement&amp;, MediaProducer::MediaStateFlags);
+#endif
+
+    bool requiresFullscreenForVideoPlayback(const HTMLMediaElement&amp;) const;
+    WEBCORE_EXPORT bool allowsAlternateFullscreen(const HTMLMediaElement&amp;) const;
+    MediaPlayer::Preload effectivePreloadForElement(const HTMLMediaElement&amp;) const;
+
+    void mediaEngineUpdated(const HTMLMediaElement&amp;);
+
+    // Restrictions to modify default behaviors.
+    enum BehaviorRestrictionFlags {
+        NoRestrictions = 0,
+        RequireUserGestureForLoad = 1 &lt;&lt; 0,
+        RequireUserGestureForRateChange = 1 &lt;&lt; 1,
+        RequireUserGestureForFullscreen = 1 &lt;&lt; 2,
+        RequirePageConsentToLoadMedia = 1 &lt;&lt; 3,
+        RequirePageConsentToResumeMedia = 1 &lt;&lt; 4,
+        RequireUserGestureForAudioRateChange = 1 &lt;&lt; 5,
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+        RequireUserGestureToShowPlaybackTargetPicker = 1 &lt;&lt; 6,
+        WirelessVideoPlaybackDisabled =  1 &lt;&lt; 7,
+        RequireUserGestureToAutoplayToExternalDevice = 1 &lt;&lt; 8,
+#endif
+    };
+    typedef unsigned BehaviorRestrictions;
+
+    WEBCORE_EXPORT BehaviorRestrictions behaviorRestrictions() const { return m_restrictions; }
+    WEBCORE_EXPORT void addBehaviorRestriction(BehaviorRestrictions);
+    WEBCORE_EXPORT void removeBehaviorRestriction(BehaviorRestrictions);
+    bool hasBehaviorRestriction(BehaviorRestrictions restriction) const { return restriction &amp; m_restrictions; }
+
+#if ENABLE(MEDIA_SOURCE)
+    size_t maximumMediaSourceBufferSize(const SourceBuffer&amp;) const;
+#endif
+
+private:
+
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+    void targetAvailabilityChangedTimerFired();
+
+    // MediaPlaybackTargetClient
+    virtual void setPlaybackTarget(Ref&lt;MediaPlaybackTarget&gt;&amp;&amp;) override;
+    virtual void externalOutputDeviceAvailableDidChange(bool) override;
+    virtual void setShouldPlayToPlaybackTarget(bool) override;
+#endif
+#if PLATFORM(IOS)
+    bool requiresPlaybackTargetRouteMonitoring() const override { return m_hasPlaybackTargetAvailabilityListeners; }
+#endif
+
+    BehaviorRestrictions m_restrictions;
+
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+    mutable Timer m_targetAvailabilityChangedTimer;
+    RefPtr&lt;MediaPlaybackTarget&gt; m_playbackTarget;
+    bool m_shouldPlayToPlaybackTarget { false };
+    mutable bool m_hasPlaybackTargets { false };
+#endif
+#if PLATFORM(IOS)
+    bool m_hasPlaybackTargetAvailabilityListeners { false };
+#endif
+};
+
+}
+
+#endif // MediaElementSession_h
+
+#endif // ENABLE(VIDEO)
</ins></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (184965 => 184966)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2015-05-28 22:41:19 UTC (rev 184965)
+++ trunk/Source/WebCore/testing/Internals.cpp        2015-05-28 23:03:34 UTC (rev 184966)
</span><span class="lines">@@ -2648,34 +2648,34 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    HTMLMediaSession::BehaviorRestrictions restrictions = element-&gt;mediaSession().behaviorRestrictions();
</del><ins>+    MediaElementSession::BehaviorRestrictions restrictions = element-&gt;mediaSession().behaviorRestrictions();
</ins><span class="cx">     element-&gt;mediaSession().removeBehaviorRestriction(restrictions);
</span><span class="cx"> 
</span><del>-    restrictions = HTMLMediaSession::NoRestrictions;
</del><ins>+    restrictions = MediaElementSession::NoRestrictions;
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;String&gt; restrictionsArray;
</span><span class="cx">     restrictionsString.split(',', false, restrictionsArray);
</span><span class="cx">     for (auto&amp; restrictionString : restrictionsArray) {
</span><span class="cx">         if (equalIgnoringCase(restrictionString, &quot;NoRestrictions&quot;))
</span><del>-            restrictions |= HTMLMediaSession::NoRestrictions;
</del><ins>+            restrictions |= MediaElementSession::NoRestrictions;
</ins><span class="cx">         if (equalIgnoringCase(restrictionString, &quot;RequireUserGestureForLoad&quot;))
</span><del>-            restrictions |= HTMLMediaSession::RequireUserGestureForLoad;
</del><ins>+            restrictions |= MediaElementSession::RequireUserGestureForLoad;
</ins><span class="cx">         if (equalIgnoringCase(restrictionString, &quot;RequireUserGestureForRateChange&quot;))
</span><del>-            restrictions |= HTMLMediaSession::RequireUserGestureForRateChange;
</del><ins>+            restrictions |= MediaElementSession::RequireUserGestureForRateChange;
</ins><span class="cx">         if (equalIgnoringCase(restrictionString, &quot;RequireUserGestureForFullscreen&quot;))
</span><del>-            restrictions |= HTMLMediaSession::RequireUserGestureForFullscreen;
</del><ins>+            restrictions |= MediaElementSession::RequireUserGestureForFullscreen;
</ins><span class="cx">         if (equalIgnoringCase(restrictionString, &quot;RequirePageConsentToLoadMedia&quot;))
</span><del>-            restrictions |= HTMLMediaSession::RequirePageConsentToLoadMedia;
</del><ins>+            restrictions |= MediaElementSession::RequirePageConsentToLoadMedia;
</ins><span class="cx">         if (equalIgnoringCase(restrictionString, &quot;RequirePageConsentToResumeMedia&quot;))
</span><del>-            restrictions |= HTMLMediaSession::RequirePageConsentToResumeMedia;
</del><ins>+            restrictions |= MediaElementSession::RequirePageConsentToResumeMedia;
</ins><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET)
</span><span class="cx">         if (equalIgnoringCase(restrictionString, &quot;RequireUserGestureToShowPlaybackTargetPicker&quot;))
</span><del>-            restrictions |= HTMLMediaSession::RequireUserGestureToShowPlaybackTargetPicker;
</del><ins>+            restrictions |= MediaElementSession::RequireUserGestureToShowPlaybackTargetPicker;
</ins><span class="cx">         if (equalIgnoringCase(restrictionString, &quot;WirelessVideoPlaybackDisabled&quot;))
</span><del>-            restrictions |= HTMLMediaSession::WirelessVideoPlaybackDisabled;
</del><ins>+            restrictions |= MediaElementSession::WirelessVideoPlaybackDisabled;
</ins><span class="cx"> #endif
</span><span class="cx">         if (equalIgnoringCase(restrictionString, &quot;RequireUserGestureForAudioRateChange&quot;))
</span><del>-            restrictions |= HTMLMediaSession::RequireUserGestureForAudioRateChange;
</del><ins>+            restrictions |= MediaElementSession::RequireUserGestureForAudioRateChange;
</ins><span class="cx">     }
</span><span class="cx">     element-&gt;mediaSession().addBehaviorRestriction(restrictions);
</span><span class="cx"> }
</span><span class="lines">@@ -2727,7 +2727,7 @@
</span><span class="cx">     AudioContext::BehaviorRestrictions restrictions = context-&gt;behaviorRestrictions();
</span><span class="cx">     context-&gt;removeBehaviorRestriction(restrictions);
</span><span class="cx"> 
</span><del>-    restrictions = HTMLMediaSession::NoRestrictions;
</del><ins>+    restrictions = MediaElementSession::NoRestrictions;
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;String&gt; restrictionsArray;
</span><span class="cx">     restrictionsString.split(',', false, restrictionsArray);
</span></span></pre>
</div>
</div>

</body>
</html>