<!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>[195600] 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/195600">195600</a></dd>
<dt>Author</dt> <dd>adachan@apple.com</dd>
<dt>Date</dt> <dd>2016-01-26 10:56:00 -0800 (Tue, 26 Jan 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move WebVideoFullscreenManager and related classes from iOS specific folders to cocoa folders
https://bugs.webkit.org/show_bug.cgi?id=153473

Reviewed by Eric Carlson.

Source/WebCore:

No new tests, just moving files.

* WebCore.xcodeproj/project.pbxproj:
Update due to changes to the file locations.
* platform/cocoa/WebVideoFullscreenModel.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModel.h.
* platform/cocoa/WebVideoFullscreenModelVideoElement.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.h.
(WebCore::WebVideoFullscreenModelVideoElement::create):
Fix a style error by moving the opening curly brace down one line.
* platform/cocoa/WebVideoFullscreenModelVideoElement.mm: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm.

Source/WebKit2:

* DerivedSources.make:
Add new paths.
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h: Renamed from Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h.
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in: Renamed from Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in.
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm: Renamed from Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm.
(WebKit::WebVideoFullscreenManagerProxy::setSeekableRangesVector):
Fix a style error by moving the opening curly brace to the same line as the for statement.
* WebKit2.xcodeproj/project.pbxproj:
Update due to changes to the file locations.
* WebProcess/cocoa/WebVideoFullscreenManager.h: Renamed from Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h.
* WebProcess/cocoa/WebVideoFullscreenManager.messages.in: Renamed from Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.messages.in.
* WebProcess/cocoa/WebVideoFullscreenManager.mm: Renamed from Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm.
(WebKit::WebVideoFullscreenInterfaceContext::setSeekableRanges):
Fix a style error by adding a missing space after a comma.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2DerivedSourcesmake">trunk/Source/WebKit2/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformcocoaWebVideoFullscreenModelh">trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenModel.h</a></li>
<li><a href="#trunkSourceWebCoreplatformcocoaWebVideoFullscreenModelVideoElementh">trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.h</a></li>
<li><a href="#trunkSourceWebCoreplatformcocoaWebVideoFullscreenModelVideoElementmm">trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaWebVideoFullscreenManagerProxyh">trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaWebVideoFullscreenManagerProxymessagesin">trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaWebVideoFullscreenManagerProxymm">trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcesscocoaWebVideoFullscreenManagerh">trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcesscocoaWebVideoFullscreenManagermessagesin">trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebProcesscocoaWebVideoFullscreenManagermm">trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenModelh">trunk/Source/WebCore/platform/ios/WebVideoFullscreenModel.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenModelVideoElementh">trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenModelVideoElementmm">trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxyh">trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxymessagesin">trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxymm">trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagerh">trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagermessagesin">trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagermm">trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (195599 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-01-26 18:46:44 UTC (rev 195599)
+++ trunk/Source/WebCore/ChangeLog        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2016-01-25  Ada Chan  &lt;adachan@apple.com&gt;
+
+        Move WebVideoFullscreenManager and related classes from iOS specific folders to cocoa folders
+        https://bugs.webkit.org/show_bug.cgi?id=153473
+
+        Reviewed by Eric Carlson.
+
+        No new tests, just moving files.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        Update due to changes to the file locations.
+        * platform/cocoa/WebVideoFullscreenModel.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModel.h.
+        * platform/cocoa/WebVideoFullscreenModelVideoElement.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.h.
+        (WebCore::WebVideoFullscreenModelVideoElement::create):
+        Fix a style error by moving the opening curly brace down one line.
+        * platform/cocoa/WebVideoFullscreenModelVideoElement.mm: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm.
+
</ins><span class="cx"> 2016-01-26  Konstantin Tokarev  &lt;annulen@yandex.ru&gt;
</span><span class="cx"> 
</span><span class="cx">         Do not convert GlyphBufferAdvance to FloatSize
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (195599 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-01-26 18:46:44 UTC (rev 195599)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -1469,7 +1469,6 @@
</span><span class="cx">                 3F2B33EF165AF15600E3987C /* JSWebKitCSSViewportRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F2B33EA165AF15500E3987C /* JSWebKitCSSViewportRule.h */; };
</span><span class="cx">                 3F42B31D1881191B00278AAC /* WebVideoFullscreenControllerAVKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F42B31B1881191B00278AAC /* WebVideoFullscreenControllerAVKit.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 3F42B31E1881191B00278AAC /* WebVideoFullscreenControllerAVKit.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3F42B31C1881191B00278AAC /* WebVideoFullscreenControllerAVKit.mm */; };
</span><del>-                3FBC4AEA189880EF0046EE38 /* WebVideoFullscreenModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FBC4AE9189880EF0046EE38 /* WebVideoFullscreenModel.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><span class="cx">                 3FBC4AF3189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3FBC4AF1189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.mm */; };
</span><span class="cx">                 3FBC4AF4189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FBC4AF2189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 3FFFF9A8159D9A550020BBD5 /* WebKitCSSViewportRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */; };
</span><span class="lines">@@ -2274,6 +2273,9 @@
</span><span class="cx">                 52CCA9E915E3F64C0053C77F /* DOMDOMNamedFlowCollection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52CCA9E615E3F64C0053C77F /* DOMDOMNamedFlowCollection.mm */; };
</span><span class="cx">                 52CCA9EA15E3F64C0053C77F /* DOMDOMNamedFlowCollectionInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 52CCA9E715E3F64C0053C77F /* DOMDOMNamedFlowCollectionInternal.h */; };
</span><span class="cx">                 52D5A18F1C54592300DE34A3 /* VideoFullscreenLayerManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52D5A18D1C54590300DE34A3 /* VideoFullscreenLayerManager.mm */; };
</span><ins>+                52D5A1A71C57489D00DE34A3 /* WebVideoFullscreenModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 52D5A1A41C57488900DE34A3 /* WebVideoFullscreenModel.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                52D5A1A81C5748A300DE34A3 /* WebVideoFullscreenModelVideoElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 52D5A1A51C57488900DE34A3 /* WebVideoFullscreenModelVideoElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                52D5A1A91C5748A900DE34A3 /* WebVideoFullscreenModelVideoElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52D5A1A61C57488900DE34A3 /* WebVideoFullscreenModelVideoElement.mm */; };
</ins><span class="cx">                 52E2CAFC19FF0207001EEB4F /* MediaProducer.h in Headers */ = {isa = PBXBuildFile; fileRef = 52E2CAFB19FF0207001EEB4F /* MediaProducer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 52F10865162B6DA4009AC81E /* MixedContentChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52F10862162B6D82009AC81E /* MixedContentChecker.cpp */; };
</span><span class="cx">                 52F10866162B6DA8009AC81E /* MixedContentChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 52F10863162B6D82009AC81E /* MixedContentChecker.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -2498,8 +2500,6 @@
</span><span class="cx">                 65DF323C09D1DE65001BE325 /* JSCanvasProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DF323609D1DE65001BE325 /* JSCanvasProxy.h */; };
</span><span class="cx">                 65DF326109D1E199000BE325 /* UserAgentStyleSheetsData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 656581AF09D14EE6000E61D7 /* UserAgentStyleSheetsData.cpp */; };
</span><span class="cx">                 65E0E9441133C89F00B4CB10 /* JSDOMWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E0E9431133C89F00B4CB10 /* JSDOMWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                65FD466519B596F0001E2B4D /* WebVideoFullscreenModelVideoElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 6586FE3C19B548BD005C3C82 /* WebVideoFullscreenModelVideoElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
-                65FD466619B596F6001E2B4D /* WebVideoFullscreenModelVideoElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6586FE3D19B548BD005C3C82 /* WebVideoFullscreenModelVideoElement.mm */; };
</del><span class="cx">                 65FEA86909833ADE00BED4AB /* Page.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65FEA86809833ADE00BED4AB /* Page.cpp */; };
</span><span class="cx">                 6B3480940EEF50D400AC1B41 /* NativeImagePtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3480920EEF50D400AC1B41 /* NativeImagePtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 6C4C96DE1AD4483500365A50 /* JSReadableStreamController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6C4C96DA1AD4483500365A50 /* JSReadableStreamController.cpp */; };
</span><span class="lines">@@ -8857,7 +8857,6 @@
</span><span class="cx">                 3F2B33EA165AF15500E3987C /* JSWebKitCSSViewportRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitCSSViewportRule.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 3F42B31B1881191B00278AAC /* WebVideoFullscreenControllerAVKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenControllerAVKit.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 3F42B31C1881191B00278AAC /* WebVideoFullscreenControllerAVKit.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebVideoFullscreenControllerAVKit.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                3FBC4AE9189880EF0046EE38 /* WebVideoFullscreenModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenModel.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 3FBC4AF1189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebVideoFullscreenInterfaceAVKit.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 3FBC4AF2189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenInterfaceAVKit.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitCSSViewportRule.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -9755,6 +9754,9 @@
</span><span class="cx">                 52CCA9E715E3F64C0053C77F /* DOMDOMNamedFlowCollectionInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMDOMNamedFlowCollectionInternal.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 52D5A18D1C54590300DE34A3 /* VideoFullscreenLayerManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = VideoFullscreenLayerManager.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 52D5A18E1C54590300DE34A3 /* VideoFullscreenLayerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoFullscreenLayerManager.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                52D5A1A41C57488900DE34A3 /* WebVideoFullscreenModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenModel.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                52D5A1A51C57488900DE34A3 /* WebVideoFullscreenModelVideoElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenModelVideoElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                52D5A1A61C57488900DE34A3 /* WebVideoFullscreenModelVideoElement.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebVideoFullscreenModelVideoElement.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 52E2CAFB19FF0207001EEB4F /* MediaProducer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaProducer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 52F10862162B6D82009AC81E /* MixedContentChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MixedContentChecker.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 52F10863162B6D82009AC81E /* MixedContentChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MixedContentChecker.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -9962,8 +9964,6 @@
</span><span class="cx">                 657EDA061385CB97004E0645 /* MemoryPressureHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryPressureHandler.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 657EDA071385CB97004E0645 /* MemoryPressureHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryPressureHandler.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 658436850AE01B7400E53753 /* FrameLoadRequest.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FrameLoadRequest.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                6586FE3C19B548BD005C3C82 /* WebVideoFullscreenModelVideoElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenModelVideoElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                6586FE3D19B548BD005C3C82 /* WebVideoFullscreenModelVideoElement.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebVideoFullscreenModelVideoElement.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 6593923509AE4346002C531F /* URL.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = URL.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 6593923609AE4346002C531F /* URL.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = URL.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 6593923909AE435C002C531F /* URLMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = URLMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
</span><span class="lines">@@ -19772,9 +19772,6 @@
</span><span class="cx">                                 3F42B31C1881191B00278AAC /* WebVideoFullscreenControllerAVKit.mm */,
</span><span class="cx">                                 3FBC4AF2189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.h */,
</span><span class="cx">                                 3FBC4AF1189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.mm */,
</span><del>-                                3FBC4AE9189880EF0046EE38 /* WebVideoFullscreenModel.h */,
-                                6586FE3C19B548BD005C3C82 /* WebVideoFullscreenModelVideoElement.h */,
-                                6586FE3D19B548BD005C3C82 /* WebVideoFullscreenModelVideoElement.mm */,
</del><span class="cx">                                 E453903C0EAFD637003695C8 /* WidgetIOS.mm */,
</span><span class="cx">                         );
</span><span class="cx">                         path = ios;
</span><span class="lines">@@ -19813,6 +19810,9 @@
</span><span class="cx">                                 CDC979F31C498C0900DB50D4 /* WebCoreNSErrorExtras.h */,
</span><span class="cx">                                 CDC979F21C498C0900DB50D4 /* WebCoreNSErrorExtras.mm */,
</span><span class="cx">                                 52131E581C4F15220033F802 /* WebVideoFullscreenInterface.h */,
</span><ins>+                                52D5A1A41C57488900DE34A3 /* WebVideoFullscreenModel.h */,
+                                52D5A1A51C57488900DE34A3 /* WebVideoFullscreenModelVideoElement.h */,
+                                52D5A1A61C57488900DE34A3 /* WebVideoFullscreenModelVideoElement.mm */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = cocoa;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -28233,8 +28233,8 @@
</span><span class="cx">                                 CD82030C1395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.h in Headers */,
</span><span class="cx">                                 52131E591C4F15350033F802 /* WebVideoFullscreenInterface.h in Headers */,
</span><span class="cx">                                 3FBC4AF4189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.h in Headers */,
</span><del>-                                3FBC4AEA189880EF0046EE38 /* WebVideoFullscreenModel.h in Headers */,
-                                65FD466519B596F0001E2B4D /* WebVideoFullscreenModelVideoElement.h in Headers */,
</del><ins>+                                52D5A1A71C57489D00DE34A3 /* WebVideoFullscreenModel.h in Headers */,
+                                52D5A1A81C5748A300DE34A3 /* WebVideoFullscreenModelVideoElement.h in Headers */,
</ins><span class="cx">                                 F12171F616A8CF0B000053CA /* WebVTTElement.h in Headers */,
</span><span class="cx">                                 5D21A80313ECE5DF00BB7064 /* WebVTTParser.h in Headers */,
</span><span class="cx">                                 B10B6980140C174000BC1C26 /* WebVTTToken.h in Headers */,
</span><span class="lines">@@ -31649,7 +31649,7 @@
</span><span class="cx">                                 CD82030D1395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.mm in Sources */,
</span><span class="cx">                                 3FBC4AF3189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.mm in Sources */,
</span><span class="cx">                                 52131E5B1C4F15760033F802 /* WebVideoFullscreenInterfaceMac.mm in Sources */,
</span><del>-                                65FD466619B596F6001E2B4D /* WebVideoFullscreenModelVideoElement.mm in Sources */,
</del><ins>+                                52D5A1A91C5748A900DE34A3 /* WebVideoFullscreenModelVideoElement.mm in Sources */,
</ins><span class="cx">                                 F12171F516A8CED2000053CA /* WebVTTElement.cpp in Sources */,
</span><span class="cx">                                 5D21A80213ECE5DF00BB7064 /* WebVTTParser.cpp in Sources */,
</span><span class="cx">                                 B10B6981140C174000BC1C26 /* WebVTTTokenizer.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaWebVideoFullscreenModelhfromrev195599trunkSourceWebCoreplatformiosWebVideoFullscreenModelh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenModel.h (from rev 195599, trunk/Source/WebCore/platform/ios/WebVideoFullscreenModel.h) (0 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenModel.h                                (rev 0)
+++ trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenModel.h        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -0,0 +1,63 @@
</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. ``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
+ * 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 WebVideoFullscreenModel_h
+#define WebVideoFullscreenModel_h
+
+#if PLATFORM(IOS)
+
+#include &lt;WebCore/FloatRect.h&gt;
+
+namespace WebCore {
+
+class WebVideoFullscreenModel {
+public:
+    virtual ~WebVideoFullscreenModel() { };
+    virtual void play() = 0;
+    virtual void pause() = 0;
+    virtual void togglePlayState() = 0;
+    virtual void beginScrubbing() = 0;
+    virtual void endScrubbing() = 0;
+    virtual void seekToTime(double time) = 0;
+    virtual void fastSeek(double time) = 0;
+    virtual void beginScanningForward() = 0;
+    virtual void beginScanningBackward() = 0;
+    virtual void endScanning() = 0;
+    virtual void requestFullscreenMode(HTMLMediaElementEnums::VideoFullscreenMode) = 0;
+    virtual void setVideoLayerFrame(FloatRect) = 0;
+    enum VideoGravity { VideoGravityResize, VideoGravityResizeAspect, VideoGravityResizeAspectFill };
+    virtual void setVideoLayerGravity(VideoGravity) = 0;
+    virtual void selectAudioMediaOption(uint64_t index) = 0;
+    virtual void selectLegibleMediaOption(uint64_t index) = 0;
+    virtual void fullscreenModeChanged(HTMLMediaElementEnums::VideoFullscreenMode) = 0;
+    virtual bool isVisible() const = 0;
+};
+
+}
+
+#endif
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaWebVideoFullscreenModelVideoElementhfromrev195599trunkSourceWebCoreplatformiosWebVideoFullscreenModelVideoElementh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.h (from rev 195599, trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.h) (0 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.h                                (rev 0)
+++ trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.h        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -0,0 +1,104 @@
</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. ``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
+ * 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 WebVideoFullscreenModelVideoElement_h
+#define WebVideoFullscreenModelVideoElement_h
+
+#if PLATFORM(IOS)
+
+#include &lt;WebCore/EventListener.h&gt;
+#include &lt;WebCore/FloatRect.h&gt;
+#include &lt;WebCore/HTMLMediaElementEnums.h&gt;
+#include &lt;WebCore/PlatformLayer.h&gt;
+#include &lt;WebCore/WebVideoFullscreenModel.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+#include &lt;wtf/RetainPtr.h&gt;
+#include &lt;wtf/Vector.h&gt;
+
+namespace WebCore {
+class AudioTrack;
+class HTMLVideoElement;
+class TextTrack;
+class WebVideoFullscreenInterface;
+
+class WebVideoFullscreenModelVideoElement : public WebVideoFullscreenModel, public EventListener {
+public:
+    static RefPtr&lt;WebVideoFullscreenModelVideoElement&gt; create()
+    {
+        return adoptRef(*new WebVideoFullscreenModelVideoElement());
+    }
+    WEBCORE_EXPORT virtual ~WebVideoFullscreenModelVideoElement();
+    WEBCORE_EXPORT void setWebVideoFullscreenInterface(WebVideoFullscreenInterface*);
+    WEBCORE_EXPORT void setVideoElement(HTMLVideoElement*);
+    WEBCORE_EXPORT HTMLVideoElement* videoElement() const { return m_videoElement.get(); }
+    WEBCORE_EXPORT void setVideoFullscreenLayer(PlatformLayer*);
+    
+    WEBCORE_EXPORT virtual void handleEvent(WebCore::ScriptExecutionContext*, WebCore::Event*) override;
+    void updateForEventName(const WTF::AtomicString&amp;);
+    bool operator==(const EventListener&amp; rhs) override
+        {return static_cast&lt;WebCore::EventListener*&gt;(this) == &amp;rhs;}
+
+    WEBCORE_EXPORT virtual void play() override;
+    WEBCORE_EXPORT virtual void pause() override;
+    WEBCORE_EXPORT virtual void togglePlayState() override;
+    WEBCORE_EXPORT virtual void beginScrubbing() override;
+    WEBCORE_EXPORT virtual void endScrubbing() override;
+    WEBCORE_EXPORT virtual void seekToTime(double time) override;
+    WEBCORE_EXPORT virtual void fastSeek(double time) override;
+    WEBCORE_EXPORT virtual void beginScanningForward() override;
+    WEBCORE_EXPORT virtual void beginScanningBackward() override;
+    WEBCORE_EXPORT virtual void endScanning() override;
+    WEBCORE_EXPORT virtual void requestFullscreenMode(HTMLMediaElementEnums::VideoFullscreenMode) override;
+    WEBCORE_EXPORT virtual void setVideoLayerFrame(FloatRect) override;
+    WEBCORE_EXPORT virtual void setVideoLayerGravity(VideoGravity) override;
+    WEBCORE_EXPORT virtual void selectAudioMediaOption(uint64_t index) override;
+    WEBCORE_EXPORT virtual void selectLegibleMediaOption(uint64_t index) override;
+    WEBCORE_EXPORT virtual void fullscreenModeChanged(HTMLMediaElementEnums::VideoFullscreenMode) override;
+    WEBCORE_EXPORT virtual bool isVisible() const override;
+
+protected:
+    WEBCORE_EXPORT WebVideoFullscreenModelVideoElement();
+
+private:
+    static const Vector&lt;WTF::AtomicString&gt;&amp; observedEventNames();
+    const WTF::AtomicString&amp; eventNameAll();
+    
+    RefPtr&lt;HTMLVideoElement&gt; m_videoElement;
+    RetainPtr&lt;PlatformLayer&gt; m_videoFullscreenLayer;
+    bool m_isListening { false };
+    WebVideoFullscreenInterface* m_videoFullscreenInterface { nullptr };
+    FloatRect m_videoFrame;
+    Vector&lt;RefPtr&lt;TextTrack&gt;&gt; m_legibleTracksForMenu;
+    Vector&lt;RefPtr&lt;AudioTrack&gt;&gt; m_audioTracksForMenu;
+
+    void updateLegibleOptions();
+};
+
+}
+
+#endif
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaWebVideoFullscreenModelVideoElementmmfromrev195599trunkSourceWebCoreplatformiosWebVideoFullscreenModelVideoElementmm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm (from rev 195599, trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm) (0 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -0,0 +1,402 @@
</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. ``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
+ * 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;
+
+#if PLATFORM(IOS)
+#import &quot;WebVideoFullscreenModelVideoElement.h&quot;
+
+#import &quot;DOMEventInternal.h&quot;
+#import &quot;Logging.h&quot;
+#import &quot;MediaControlsHost.h&quot;
+#import &quot;WebVideoFullscreenInterface.h&quot;
+#import &lt;QuartzCore/CoreAnimation.h&gt;
+#import &lt;WebCore/DOMEventListener.h&gt;
+#import &lt;WebCore/Event.h&gt;
+#import &lt;WebCore/EventListener.h&gt;
+#import &lt;WebCore/EventNames.h&gt;
+#import &lt;WebCore/HTMLElement.h&gt;
+#import &lt;WebCore/HTMLVideoElement.h&gt;
+#import &lt;WebCore/Page.h&gt;
+#import &lt;WebCore/PageGroup.h&gt;
+#import &lt;WebCore/SoftLinking.h&gt;
+#import &lt;WebCore/TextTrackList.h&gt;
+#import &lt;WebCore/TimeRanges.h&gt;
+#import &lt;WebCore/WebCoreThreadRun.h&gt;
+#import &lt;wtf/NeverDestroyed.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+
+using namespace WebCore;
+
+WebVideoFullscreenModelVideoElement::WebVideoFullscreenModelVideoElement()
+    : EventListener(EventListener::CPPEventListenerType)
+{
+}
+
+WebVideoFullscreenModelVideoElement::~WebVideoFullscreenModelVideoElement()
+{
+}
+
+void WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface(WebVideoFullscreenInterface* interface)
+{
+    if (interface == m_videoFullscreenInterface)
+        return;
+
+    m_videoFullscreenInterface = interface;
+
+    if (m_videoFullscreenInterface) {
+        m_videoFullscreenInterface-&gt;resetMediaState();
+        if (m_videoElement) {
+            m_videoFullscreenInterface-&gt;setVideoDimensions(true, m_videoElement-&gt;videoWidth(), m_videoElement-&gt;videoHeight());
+            m_videoFullscreenInterface-&gt;setWirelessVideoPlaybackDisabled(m_videoElement-&gt;mediaSession().wirelessVideoPlaybackDisabled(*m_videoElement));
+        }
+    }
+}
+
+void WebVideoFullscreenModelVideoElement::setVideoElement(HTMLVideoElement* videoElement)
+{
+    if (m_videoElement == videoElement)
+        return;
+
+    if (m_videoFullscreenInterface)
+        m_videoFullscreenInterface-&gt;resetMediaState();
+
+    if (m_videoElement &amp;&amp; m_videoElement-&gt;videoFullscreenLayer())
+        m_videoElement-&gt;setVideoFullscreenLayer(nullptr);
+
+    if (m_videoElement &amp;&amp; m_isListening) {
+        for (auto&amp; eventName : observedEventNames())
+            m_videoElement-&gt;removeEventListener(eventName, this, false);
+    }
+    m_isListening = false;
+
+    m_videoElement = videoElement;
+
+    if (!m_videoElement)
+        return;
+
+    for (auto&amp; eventName : observedEventNames())
+        m_videoElement-&gt;addEventListener(eventName, this, false);
+    m_isListening = true;
+
+    updateForEventName(eventNameAll());
+
+    if (m_videoFullscreenInterface) {
+        m_videoFullscreenInterface-&gt;setVideoDimensions(true, videoElement-&gt;videoWidth(), videoElement-&gt;videoHeight());
+        m_videoFullscreenInterface-&gt;setWirelessVideoPlaybackDisabled(m_videoElement-&gt;mediaSession().wirelessVideoPlaybackDisabled(*m_videoElement));
+    }
+}
+
+void WebVideoFullscreenModelVideoElement::handleEvent(WebCore::ScriptExecutionContext*, WebCore::Event* event)
+{
+    updateForEventName(event-&gt;type());
+}
+
+void WebVideoFullscreenModelVideoElement::updateForEventName(const WTF::AtomicString&amp; eventName)
+{
+    if (!m_videoElement || !m_videoFullscreenInterface)
+        return;
+    
+    bool all = eventName == eventNameAll();
+
+    if (all
+        || eventName == eventNames().durationchangeEvent) {
+        m_videoFullscreenInterface-&gt;setDuration(m_videoElement-&gt;duration());
+        // These is no standard event for minFastReverseRateChange; duration change is a reasonable proxy for it.
+        // It happens every time a new item becomes ready to play.
+        m_videoFullscreenInterface-&gt;setCanPlayFastReverse(m_videoElement-&gt;minFastReverseRate() &lt; 0.0);
+    }
+
+    if (all
+        || eventName == eventNames().pauseEvent
+        || eventName == eventNames().playEvent
+        || eventName == eventNames().ratechangeEvent)
+        m_videoFullscreenInterface-&gt;setRate(!m_videoElement-&gt;paused(), m_videoElement-&gt;playbackRate());
+
+    if (all
+        || eventName == eventNames().timeupdateEvent) {
+        m_videoFullscreenInterface-&gt;setCurrentTime(m_videoElement-&gt;currentTime(), [[NSProcessInfo processInfo] systemUptime]);
+        m_videoFullscreenInterface-&gt;setBufferedTime(m_videoElement-&gt;maxBufferedTime());
+        // FIXME: 130788 - find a better event to update seekable ranges from.
+        m_videoFullscreenInterface-&gt;setSeekableRanges(*m_videoElement-&gt;seekable());
+    }
+
+    if (all
+        || eventName == eventNames().addtrackEvent
+        || eventName == eventNames().removetrackEvent)
+        updateLegibleOptions();
+
+    if (all
+        || eventName == eventNames().webkitcurrentplaybacktargetiswirelesschangedEvent) {
+        bool enabled = m_videoElement-&gt;webkitCurrentPlaybackTargetIsWireless();
+        WebVideoFullscreenInterface::ExternalPlaybackTargetType targetType = WebVideoFullscreenInterface::TargetTypeNone;
+        String localizedDeviceName;
+
+        if (m_videoElement-&gt;mediaControlsHost()) {
+            static NeverDestroyed&lt;String&gt; airplay(ASCIILiteral(&quot;airplay&quot;));
+            static NeverDestroyed&lt;String&gt; tvout(ASCIILiteral(&quot;tvout&quot;));
+            
+            String type = m_videoElement-&gt;mediaControlsHost()-&gt;externalDeviceType();
+            if (type == airplay)
+                targetType = WebVideoFullscreenInterface::TargetTypeAirPlay;
+            else if (type == tvout)
+                targetType = WebVideoFullscreenInterface::TargetTypeTVOut;
+            localizedDeviceName = m_videoElement-&gt;mediaControlsHost()-&gt;externalDeviceDisplayName();
+        }
+        m_videoFullscreenInterface-&gt;setExternalPlayback(enabled, targetType, localizedDeviceName);
+        m_videoFullscreenInterface-&gt;setWirelessVideoPlaybackDisabled(m_videoElement-&gt;mediaSession().wirelessVideoPlaybackDisabled(*m_videoElement));
+    }
+}
+
+void WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer(PlatformLayer* videoLayer)
+{
+    if (m_videoFullscreenLayer == videoLayer)
+        return;
+    
+    m_videoFullscreenLayer = videoLayer;
+    [m_videoFullscreenLayer setAnchorPoint:CGPointMake(0.5, 0.5)];
+    [m_videoFullscreenLayer setBounds:m_videoFrame];
+    
+    if (m_videoElement)
+        m_videoElement-&gt;setVideoFullscreenLayer(m_videoFullscreenLayer.get());
+}
+
+void WebVideoFullscreenModelVideoElement::play()
+{
+    if (m_videoElement)
+        m_videoElement-&gt;play();
+}
+
+void WebVideoFullscreenModelVideoElement::pause()
+{
+    if (m_videoElement)
+        m_videoElement-&gt;pause();
+}
+
+void WebVideoFullscreenModelVideoElement::togglePlayState()
+{
+    if (m_videoElement)
+        m_videoElement-&gt;togglePlayState();
+}
+
+void WebVideoFullscreenModelVideoElement::beginScrubbing()
+{
+    if (m_videoElement)
+        m_videoElement-&gt;beginScrubbing();
+}
+
+void WebVideoFullscreenModelVideoElement::endScrubbing()
+{
+    if (m_videoElement)
+        m_videoElement-&gt;endScrubbing();
+}
+
+void WebVideoFullscreenModelVideoElement::seekToTime(double time)
+{
+    if (m_videoElement)
+        m_videoElement-&gt;setCurrentTime(time);
+}
+
+void WebVideoFullscreenModelVideoElement::fastSeek(double time)
+{
+    if (m_videoElement)
+        m_videoElement-&gt;fastSeek(time);
+}
+
+void WebVideoFullscreenModelVideoElement::beginScanningForward()
+{
+    if (m_videoElement)
+        m_videoElement-&gt;beginScanning(MediaControllerInterface::Forward);
+}
+
+void WebVideoFullscreenModelVideoElement::beginScanningBackward()
+{
+    if (m_videoElement)
+        m_videoElement-&gt;beginScanning(MediaControllerInterface::Backward);
+}
+
+void WebVideoFullscreenModelVideoElement::endScanning()
+{
+    if (m_videoElement)
+        m_videoElement-&gt;endScanning();
+}
+
+void WebVideoFullscreenModelVideoElement::requestFullscreenMode(HTMLMediaElementEnums::VideoFullscreenMode mode)
+{
+    if (m_videoElement &amp;&amp; m_videoElement-&gt;fullscreenMode() != mode)
+        m_videoElement-&gt;setFullscreenMode(mode);
+}
+
+void WebVideoFullscreenModelVideoElement::setVideoLayerFrame(FloatRect rect)
+{
+    m_videoFrame = rect;
+    [m_videoFullscreenLayer setBounds:CGRect(rect)];
+    if (m_videoElement)
+        m_videoElement-&gt;setVideoFullscreenFrame(rect);
+}
+
+void WebVideoFullscreenModelVideoElement::setVideoLayerGravity(WebVideoFullscreenModel::VideoGravity gravity)
+{
+    MediaPlayer::VideoGravity videoGravity = MediaPlayer::VideoGravityResizeAspect;
+    if (gravity == WebVideoFullscreenModel::VideoGravityResize)
+        videoGravity = MediaPlayer::VideoGravityResize;
+    else if (gravity == WebVideoFullscreenModel::VideoGravityResizeAspect)
+        videoGravity = MediaPlayer::VideoGravityResizeAspect;
+    else if (gravity == WebVideoFullscreenModel::VideoGravityResizeAspectFill)
+        videoGravity = MediaPlayer::VideoGravityResizeAspectFill;
+    else
+        ASSERT_NOT_REACHED();
+    
+    m_videoElement-&gt;setVideoFullscreenGravity(videoGravity);
+}
+
+void WebVideoFullscreenModelVideoElement::selectAudioMediaOption(uint64_t selectedAudioIndex)
+{
+    AudioTrack* selectedAudioTrack = nullptr;
+
+    for (size_t index = 0; index &lt; m_audioTracksForMenu.size(); ++index) {
+        auto&amp; audioTrack = m_audioTracksForMenu[index];
+        audioTrack-&gt;setEnabled(index == static_cast&lt;size_t&gt;(selectedAudioIndex));
+        if (audioTrack-&gt;enabled())
+            selectedAudioTrack = audioTrack.get();
+    }
+
+    m_videoElement-&gt;audioTrackEnabledChanged(selectedAudioTrack);
+}
+
+void WebVideoFullscreenModelVideoElement::selectLegibleMediaOption(uint64_t index)
+{
+    TextTrack* textTrack = nullptr;
+    
+    if (index &lt; m_legibleTracksForMenu.size())
+        textTrack = m_legibleTracksForMenu[static_cast&lt;size_t&gt;(index)].get();
+    else
+        textTrack = TextTrack::captionMenuOffItem();
+    
+    m_videoElement-&gt;setSelectedTextTrack(textTrack);
+}
+
+void WebVideoFullscreenModelVideoElement::updateLegibleOptions()
+{
+    AudioTrackList* audioTrackList = m_videoElement-&gt;audioTracks();
+    TextTrackList* trackList = m_videoElement-&gt;textTracks();
+
+    if ((!trackList &amp;&amp; !audioTrackList) || !m_videoElement-&gt;document().page() || !m_videoElement-&gt;mediaControlsHost())
+        return;
+    
+    WTF::AtomicString displayMode = m_videoElement-&gt;mediaControlsHost()-&gt;captionDisplayMode();
+    TextTrack* offItem = m_videoElement-&gt;mediaControlsHost()-&gt;captionMenuOffItem();
+    TextTrack* automaticItem = m_videoElement-&gt;mediaControlsHost()-&gt;captionMenuAutomaticItem();
+    CaptionUserPreferences&amp; captionPreferences = *m_videoElement-&gt;document().page()-&gt;group().captionPreferences();
+    m_legibleTracksForMenu = captionPreferences.sortedTrackListForMenu(trackList);
+
+    m_audioTracksForMenu = captionPreferences.sortedTrackListForMenu(audioTrackList);
+    
+    Vector&lt;String&gt; audioTrackDisplayNames;
+    uint64_t selectedAudioIndex = 0;
+    
+    for (size_t index = 0; index &lt; m_audioTracksForMenu.size(); ++index) {
+        auto&amp; track = m_audioTracksForMenu[index];
+        audioTrackDisplayNames.append(captionPreferences.displayNameForTrack(track.get()));
+        
+        if (track-&gt;enabled())
+            selectedAudioIndex = index;
+    }
+    
+    m_videoFullscreenInterface-&gt;setAudioMediaSelectionOptions(audioTrackDisplayNames, selectedAudioIndex);
+
+    Vector&lt;String&gt; trackDisplayNames;
+    uint64_t selectedIndex = 0;
+    uint64_t offIndex = 0;
+    bool trackMenuItemSelected = false;
+    
+    for (size_t index = 0; index &lt; m_legibleTracksForMenu.size(); index++) {
+        auto&amp; track = m_legibleTracksForMenu[index];
+        trackDisplayNames.append(captionPreferences.displayNameForTrack(track.get()));
+        
+        if (track == offItem)
+            offIndex = index;
+        
+        if (track == automaticItem &amp;&amp; displayMode == MediaControlsHost::automaticKeyword()) {
+            selectedIndex = index;
+            trackMenuItemSelected = true;
+        }
+        
+        if (displayMode != MediaControlsHost::automaticKeyword() &amp;&amp; track-&gt;mode() == TextTrack::showingKeyword()) {
+            selectedIndex = index;
+            trackMenuItemSelected = true;
+        }
+    }
+    
+    if (offIndex &amp;&amp; !trackMenuItemSelected &amp;&amp; displayMode == MediaControlsHost::forcedOnlyKeyword()) {
+        selectedIndex = offIndex;
+        trackMenuItemSelected = true;
+    }
+    
+    m_videoFullscreenInterface-&gt;setLegibleMediaSelectionOptions(trackDisplayNames, selectedIndex);
+}
+
+const Vector&lt;AtomicString&gt;&amp; WebVideoFullscreenModelVideoElement::observedEventNames()
+{
+    static NeverDestroyed&lt;Vector&lt;AtomicString&gt;&gt; sEventNames;
+
+    if (!sEventNames.get().size()) {
+        sEventNames.get().append(eventNames().durationchangeEvent);
+        sEventNames.get().append(eventNames().pauseEvent);
+        sEventNames.get().append(eventNames().playEvent);
+        sEventNames.get().append(eventNames().ratechangeEvent);
+        sEventNames.get().append(eventNames().timeupdateEvent);
+        sEventNames.get().append(eventNames().addtrackEvent);
+        sEventNames.get().append(eventNames().removetrackEvent);
+        sEventNames.get().append(eventNames().webkitcurrentplaybacktargetiswirelesschangedEvent);
+    }
+    return sEventNames.get();
+}
+
+const AtomicString&amp; WebVideoFullscreenModelVideoElement::eventNameAll()
+{
+    static NeverDestroyed&lt;AtomicString&gt; sEventNameAll = &quot;allEvents&quot;;
+    return sEventNameAll;
+}
+
+void WebVideoFullscreenModelVideoElement::fullscreenModeChanged(HTMLMediaElementEnums::VideoFullscreenMode videoFullscreenMode)
+{
+    if (m_videoElement)
+        m_videoElement-&gt;fullscreenModeChanged(videoFullscreenMode);
+}
+
+bool WebVideoFullscreenModelVideoElement::isVisible() const
+{
+    if (!m_videoElement)
+        return false;
+
+    if (Page* page = m_videoElement-&gt;document().page())
+        return page-&gt;isVisible();
+
+    return false;
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenModelh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/ios/WebVideoFullscreenModel.h (195599 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenModel.h        2016-01-26 18:46:44 UTC (rev 195599)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenModel.h        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -1,63 +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. ``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
- * 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 WebVideoFullscreenModel_h
-#define WebVideoFullscreenModel_h
-
-#if PLATFORM(IOS)
-
-#include &lt;WebCore/FloatRect.h&gt;
-
-namespace WebCore {
-
-class WebVideoFullscreenModel {
-public:
-    virtual ~WebVideoFullscreenModel() { };
-    virtual void play() = 0;
-    virtual void pause() = 0;
-    virtual void togglePlayState() = 0;
-    virtual void beginScrubbing() = 0;
-    virtual void endScrubbing() = 0;
-    virtual void seekToTime(double time) = 0;
-    virtual void fastSeek(double time) = 0;
-    virtual void beginScanningForward() = 0;
-    virtual void beginScanningBackward() = 0;
-    virtual void endScanning() = 0;
-    virtual void requestFullscreenMode(HTMLMediaElementEnums::VideoFullscreenMode) = 0;
-    virtual void setVideoLayerFrame(FloatRect) = 0;
-    enum VideoGravity { VideoGravityResize, VideoGravityResizeAspect, VideoGravityResizeAspectFill };
-    virtual void setVideoLayerGravity(VideoGravity) = 0;
-    virtual void selectAudioMediaOption(uint64_t index) = 0;
-    virtual void selectLegibleMediaOption(uint64_t index) = 0;
-    virtual void fullscreenModeChanged(HTMLMediaElementEnums::VideoFullscreenMode) = 0;
-    virtual bool isVisible() const = 0;
-};
-
-}
-
-#endif
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenModelVideoElementh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.h (195599 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.h        2016-01-26 18:46:44 UTC (rev 195599)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.h        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -1,103 +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. ``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
- * 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 WebVideoFullscreenModelVideoElement_h
-#define WebVideoFullscreenModelVideoElement_h
-
-#if PLATFORM(IOS)
-
-#include &lt;WebCore/EventListener.h&gt;
-#include &lt;WebCore/FloatRect.h&gt;
-#include &lt;WebCore/HTMLMediaElementEnums.h&gt;
-#include &lt;WebCore/PlatformLayer.h&gt;
-#include &lt;WebCore/WebVideoFullscreenModel.h&gt;
-#include &lt;wtf/RefPtr.h&gt;
-#include &lt;wtf/RetainPtr.h&gt;
-#include &lt;wtf/Vector.h&gt;
-
-namespace WebCore {
-class AudioTrack;
-class HTMLVideoElement;
-class TextTrack;
-class WebVideoFullscreenInterface;
-
-class WebVideoFullscreenModelVideoElement : public WebVideoFullscreenModel, public EventListener {
-public:
-    static RefPtr&lt;WebVideoFullscreenModelVideoElement&gt; create() {
-        return adoptRef(*new WebVideoFullscreenModelVideoElement());
-    }
-    WEBCORE_EXPORT virtual ~WebVideoFullscreenModelVideoElement();
-    WEBCORE_EXPORT void setWebVideoFullscreenInterface(WebVideoFullscreenInterface*);
-    WEBCORE_EXPORT void setVideoElement(HTMLVideoElement*);
-    WEBCORE_EXPORT HTMLVideoElement* videoElement() const { return m_videoElement.get(); }
-    WEBCORE_EXPORT void setVideoFullscreenLayer(PlatformLayer*);
-    
-    WEBCORE_EXPORT virtual void handleEvent(WebCore::ScriptExecutionContext*, WebCore::Event*) override;
-    void updateForEventName(const WTF::AtomicString&amp;);
-    bool operator==(const EventListener&amp; rhs) override
-        {return static_cast&lt;WebCore::EventListener*&gt;(this) == &amp;rhs;}
-
-    WEBCORE_EXPORT virtual void play() override;
-    WEBCORE_EXPORT virtual void pause() override;
-    WEBCORE_EXPORT virtual void togglePlayState() override;
-    WEBCORE_EXPORT virtual void beginScrubbing() override;
-    WEBCORE_EXPORT virtual void endScrubbing() override;
-    WEBCORE_EXPORT virtual void seekToTime(double time) override;
-    WEBCORE_EXPORT virtual void fastSeek(double time) override;
-    WEBCORE_EXPORT virtual void beginScanningForward() override;
-    WEBCORE_EXPORT virtual void beginScanningBackward() override;
-    WEBCORE_EXPORT virtual void endScanning() override;
-    WEBCORE_EXPORT virtual void requestFullscreenMode(HTMLMediaElementEnums::VideoFullscreenMode) override;
-    WEBCORE_EXPORT virtual void setVideoLayerFrame(FloatRect) override;
-    WEBCORE_EXPORT virtual void setVideoLayerGravity(VideoGravity) override;
-    WEBCORE_EXPORT virtual void selectAudioMediaOption(uint64_t index) override;
-    WEBCORE_EXPORT virtual void selectLegibleMediaOption(uint64_t index) override;
-    WEBCORE_EXPORT virtual void fullscreenModeChanged(HTMLMediaElementEnums::VideoFullscreenMode) override;
-    WEBCORE_EXPORT virtual bool isVisible() const override;
-
-protected:
-    WEBCORE_EXPORT WebVideoFullscreenModelVideoElement();
-
-private:
-    static const Vector&lt;WTF::AtomicString&gt;&amp; observedEventNames();
-    const WTF::AtomicString&amp; eventNameAll();
-    
-    RefPtr&lt;HTMLVideoElement&gt; m_videoElement;
-    RetainPtr&lt;PlatformLayer&gt; m_videoFullscreenLayer;
-    bool m_isListening { false };
-    WebVideoFullscreenInterface* m_videoFullscreenInterface { nullptr };
-    FloatRect m_videoFrame;
-    Vector&lt;RefPtr&lt;TextTrack&gt;&gt; m_legibleTracksForMenu;
-    Vector&lt;RefPtr&lt;AudioTrack&gt;&gt; m_audioTracksForMenu;
-
-    void updateLegibleOptions();
-};
-
-}
-
-#endif
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenModelVideoElementmm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm (195599 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm        2016-01-26 18:46:44 UTC (rev 195599)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -1,402 +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. ``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
- * 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;
-
-#if PLATFORM(IOS)
-#import &quot;WebVideoFullscreenModelVideoElement.h&quot;
-
-#import &quot;DOMEventInternal.h&quot;
-#import &quot;Logging.h&quot;
-#import &quot;MediaControlsHost.h&quot;
-#import &quot;WebVideoFullscreenInterface.h&quot;
-#import &lt;QuartzCore/CoreAnimation.h&gt;
-#import &lt;WebCore/DOMEventListener.h&gt;
-#import &lt;WebCore/Event.h&gt;
-#import &lt;WebCore/EventListener.h&gt;
-#import &lt;WebCore/EventNames.h&gt;
-#import &lt;WebCore/HTMLElement.h&gt;
-#import &lt;WebCore/HTMLVideoElement.h&gt;
-#import &lt;WebCore/Page.h&gt;
-#import &lt;WebCore/PageGroup.h&gt;
-#import &lt;WebCore/SoftLinking.h&gt;
-#import &lt;WebCore/TextTrackList.h&gt;
-#import &lt;WebCore/TimeRanges.h&gt;
-#import &lt;WebCore/WebCoreThreadRun.h&gt;
-#import &lt;wtf/NeverDestroyed.h&gt;
-#import &lt;wtf/RetainPtr.h&gt;
-
-
-using namespace WebCore;
-
-WebVideoFullscreenModelVideoElement::WebVideoFullscreenModelVideoElement()
-    : EventListener(EventListener::CPPEventListenerType)
-{
-}
-
-WebVideoFullscreenModelVideoElement::~WebVideoFullscreenModelVideoElement()
-{
-}
-
-void WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface(WebVideoFullscreenInterface* interface)
-{
-    if (interface == m_videoFullscreenInterface)
-        return;
-
-    m_videoFullscreenInterface = interface;
-
-    if (m_videoFullscreenInterface) {
-        m_videoFullscreenInterface-&gt;resetMediaState();
-        if (m_videoElement) {
-            m_videoFullscreenInterface-&gt;setVideoDimensions(true, m_videoElement-&gt;videoWidth(), m_videoElement-&gt;videoHeight());
-            m_videoFullscreenInterface-&gt;setWirelessVideoPlaybackDisabled(m_videoElement-&gt;mediaSession().wirelessVideoPlaybackDisabled(*m_videoElement));
-        }
-    }
-}
-
-void WebVideoFullscreenModelVideoElement::setVideoElement(HTMLVideoElement* videoElement)
-{
-    if (m_videoElement == videoElement)
-        return;
-
-    if (m_videoFullscreenInterface)
-        m_videoFullscreenInterface-&gt;resetMediaState();
-
-    if (m_videoElement &amp;&amp; m_videoElement-&gt;videoFullscreenLayer())
-        m_videoElement-&gt;setVideoFullscreenLayer(nullptr);
-
-    if (m_videoElement &amp;&amp; m_isListening) {
-        for (auto&amp; eventName : observedEventNames())
-            m_videoElement-&gt;removeEventListener(eventName, this, false);
-    }
-    m_isListening = false;
-
-    m_videoElement = videoElement;
-
-    if (!m_videoElement)
-        return;
-
-    for (auto&amp; eventName : observedEventNames())
-        m_videoElement-&gt;addEventListener(eventName, this, false);
-    m_isListening = true;
-
-    updateForEventName(eventNameAll());
-
-    if (m_videoFullscreenInterface) {
-        m_videoFullscreenInterface-&gt;setVideoDimensions(true, videoElement-&gt;videoWidth(), videoElement-&gt;videoHeight());
-        m_videoFullscreenInterface-&gt;setWirelessVideoPlaybackDisabled(m_videoElement-&gt;mediaSession().wirelessVideoPlaybackDisabled(*m_videoElement));
-    }
-}
-
-void WebVideoFullscreenModelVideoElement::handleEvent(WebCore::ScriptExecutionContext*, WebCore::Event* event)
-{
-    updateForEventName(event-&gt;type());
-}
-
-void WebVideoFullscreenModelVideoElement::updateForEventName(const WTF::AtomicString&amp; eventName)
-{
-    if (!m_videoElement || !m_videoFullscreenInterface)
-        return;
-    
-    bool all = eventName == eventNameAll();
-
-    if (all
-        || eventName == eventNames().durationchangeEvent) {
-        m_videoFullscreenInterface-&gt;setDuration(m_videoElement-&gt;duration());
-        // These is no standard event for minFastReverseRateChange; duration change is a reasonable proxy for it.
-        // It happens every time a new item becomes ready to play.
-        m_videoFullscreenInterface-&gt;setCanPlayFastReverse(m_videoElement-&gt;minFastReverseRate() &lt; 0.0);
-    }
-
-    if (all
-        || eventName == eventNames().pauseEvent
-        || eventName == eventNames().playEvent
-        || eventName == eventNames().ratechangeEvent)
-        m_videoFullscreenInterface-&gt;setRate(!m_videoElement-&gt;paused(), m_videoElement-&gt;playbackRate());
-
-    if (all
-        || eventName == eventNames().timeupdateEvent) {
-        m_videoFullscreenInterface-&gt;setCurrentTime(m_videoElement-&gt;currentTime(), [[NSProcessInfo processInfo] systemUptime]);
-        m_videoFullscreenInterface-&gt;setBufferedTime(m_videoElement-&gt;maxBufferedTime());
-        // FIXME: 130788 - find a better event to update seekable ranges from.
-        m_videoFullscreenInterface-&gt;setSeekableRanges(*m_videoElement-&gt;seekable());
-    }
-
-    if (all
-        || eventName == eventNames().addtrackEvent
-        || eventName == eventNames().removetrackEvent)
-        updateLegibleOptions();
-
-    if (all
-        || eventName == eventNames().webkitcurrentplaybacktargetiswirelesschangedEvent) {
-        bool enabled = m_videoElement-&gt;webkitCurrentPlaybackTargetIsWireless();
-        WebVideoFullscreenInterface::ExternalPlaybackTargetType targetType = WebVideoFullscreenInterface::TargetTypeNone;
-        String localizedDeviceName;
-
-        if (m_videoElement-&gt;mediaControlsHost()) {
-            static NeverDestroyed&lt;String&gt; airplay(ASCIILiteral(&quot;airplay&quot;));
-            static NeverDestroyed&lt;String&gt; tvout(ASCIILiteral(&quot;tvout&quot;));
-            
-            String type = m_videoElement-&gt;mediaControlsHost()-&gt;externalDeviceType();
-            if (type == airplay)
-                targetType = WebVideoFullscreenInterface::TargetTypeAirPlay;
-            else if (type == tvout)
-                targetType = WebVideoFullscreenInterface::TargetTypeTVOut;
-            localizedDeviceName = m_videoElement-&gt;mediaControlsHost()-&gt;externalDeviceDisplayName();
-        }
-        m_videoFullscreenInterface-&gt;setExternalPlayback(enabled, targetType, localizedDeviceName);
-        m_videoFullscreenInterface-&gt;setWirelessVideoPlaybackDisabled(m_videoElement-&gt;mediaSession().wirelessVideoPlaybackDisabled(*m_videoElement));
-    }
-}
-
-void WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer(PlatformLayer* videoLayer)
-{
-    if (m_videoFullscreenLayer == videoLayer)
-        return;
-    
-    m_videoFullscreenLayer = videoLayer;
-    [m_videoFullscreenLayer setAnchorPoint:CGPointMake(0.5, 0.5)];
-    [m_videoFullscreenLayer setBounds:m_videoFrame];
-    
-    if (m_videoElement)
-        m_videoElement-&gt;setVideoFullscreenLayer(m_videoFullscreenLayer.get());
-}
-
-void WebVideoFullscreenModelVideoElement::play()
-{
-    if (m_videoElement)
-        m_videoElement-&gt;play();
-}
-
-void WebVideoFullscreenModelVideoElement::pause()
-{
-    if (m_videoElement)
-        m_videoElement-&gt;pause();
-}
-
-void WebVideoFullscreenModelVideoElement::togglePlayState()
-{
-    if (m_videoElement)
-        m_videoElement-&gt;togglePlayState();
-}
-
-void WebVideoFullscreenModelVideoElement::beginScrubbing()
-{
-    if (m_videoElement)
-        m_videoElement-&gt;beginScrubbing();
-}
-
-void WebVideoFullscreenModelVideoElement::endScrubbing()
-{
-    if (m_videoElement)
-        m_videoElement-&gt;endScrubbing();
-}
-
-void WebVideoFullscreenModelVideoElement::seekToTime(double time)
-{
-    if (m_videoElement)
-        m_videoElement-&gt;setCurrentTime(time);
-}
-
-void WebVideoFullscreenModelVideoElement::fastSeek(double time)
-{
-    if (m_videoElement)
-        m_videoElement-&gt;fastSeek(time);
-}
-
-void WebVideoFullscreenModelVideoElement::beginScanningForward()
-{
-    if (m_videoElement)
-        m_videoElement-&gt;beginScanning(MediaControllerInterface::Forward);
-}
-
-void WebVideoFullscreenModelVideoElement::beginScanningBackward()
-{
-    if (m_videoElement)
-        m_videoElement-&gt;beginScanning(MediaControllerInterface::Backward);
-}
-
-void WebVideoFullscreenModelVideoElement::endScanning()
-{
-    if (m_videoElement)
-        m_videoElement-&gt;endScanning();
-}
-
-void WebVideoFullscreenModelVideoElement::requestFullscreenMode(HTMLMediaElementEnums::VideoFullscreenMode mode)
-{
-    if (m_videoElement &amp;&amp; m_videoElement-&gt;fullscreenMode() != mode)
-        m_videoElement-&gt;setFullscreenMode(mode);
-}
-
-void WebVideoFullscreenModelVideoElement::setVideoLayerFrame(FloatRect rect)
-{
-    m_videoFrame = rect;
-    [m_videoFullscreenLayer setBounds:CGRect(rect)];
-    if (m_videoElement)
-        m_videoElement-&gt;setVideoFullscreenFrame(rect);
-}
-
-void WebVideoFullscreenModelVideoElement::setVideoLayerGravity(WebVideoFullscreenModel::VideoGravity gravity)
-{
-    MediaPlayer::VideoGravity videoGravity = MediaPlayer::VideoGravityResizeAspect;
-    if (gravity == WebVideoFullscreenModel::VideoGravityResize)
-        videoGravity = MediaPlayer::VideoGravityResize;
-    else if (gravity == WebVideoFullscreenModel::VideoGravityResizeAspect)
-        videoGravity = MediaPlayer::VideoGravityResizeAspect;
-    else if (gravity == WebVideoFullscreenModel::VideoGravityResizeAspectFill)
-        videoGravity = MediaPlayer::VideoGravityResizeAspectFill;
-    else
-        ASSERT_NOT_REACHED();
-    
-    m_videoElement-&gt;setVideoFullscreenGravity(videoGravity);
-}
-
-void WebVideoFullscreenModelVideoElement::selectAudioMediaOption(uint64_t selectedAudioIndex)
-{
-    AudioTrack* selectedAudioTrack = nullptr;
-
-    for (size_t index = 0; index &lt; m_audioTracksForMenu.size(); ++index) {
-        auto&amp; audioTrack = m_audioTracksForMenu[index];
-        audioTrack-&gt;setEnabled(index == static_cast&lt;size_t&gt;(selectedAudioIndex));
-        if (audioTrack-&gt;enabled())
-            selectedAudioTrack = audioTrack.get();
-    }
-
-    m_videoElement-&gt;audioTrackEnabledChanged(selectedAudioTrack);
-}
-
-void WebVideoFullscreenModelVideoElement::selectLegibleMediaOption(uint64_t index)
-{
-    TextTrack* textTrack = nullptr;
-    
-    if (index &lt; m_legibleTracksForMenu.size())
-        textTrack = m_legibleTracksForMenu[static_cast&lt;size_t&gt;(index)].get();
-    else
-        textTrack = TextTrack::captionMenuOffItem();
-    
-    m_videoElement-&gt;setSelectedTextTrack(textTrack);
-}
-
-void WebVideoFullscreenModelVideoElement::updateLegibleOptions()
-{
-    AudioTrackList* audioTrackList = m_videoElement-&gt;audioTracks();
-    TextTrackList* trackList = m_videoElement-&gt;textTracks();
-
-    if ((!trackList &amp;&amp; !audioTrackList) || !m_videoElement-&gt;document().page() || !m_videoElement-&gt;mediaControlsHost())
-        return;
-    
-    WTF::AtomicString displayMode = m_videoElement-&gt;mediaControlsHost()-&gt;captionDisplayMode();
-    TextTrack* offItem = m_videoElement-&gt;mediaControlsHost()-&gt;captionMenuOffItem();
-    TextTrack* automaticItem = m_videoElement-&gt;mediaControlsHost()-&gt;captionMenuAutomaticItem();
-    CaptionUserPreferences&amp; captionPreferences = *m_videoElement-&gt;document().page()-&gt;group().captionPreferences();
-    m_legibleTracksForMenu = captionPreferences.sortedTrackListForMenu(trackList);
-
-    m_audioTracksForMenu = captionPreferences.sortedTrackListForMenu(audioTrackList);
-    
-    Vector&lt;String&gt; audioTrackDisplayNames;
-    uint64_t selectedAudioIndex = 0;
-    
-    for (size_t index = 0; index &lt; m_audioTracksForMenu.size(); ++index) {
-        auto&amp; track = m_audioTracksForMenu[index];
-        audioTrackDisplayNames.append(captionPreferences.displayNameForTrack(track.get()));
-        
-        if (track-&gt;enabled())
-            selectedAudioIndex = index;
-    }
-    
-    m_videoFullscreenInterface-&gt;setAudioMediaSelectionOptions(audioTrackDisplayNames, selectedAudioIndex);
-
-    Vector&lt;String&gt; trackDisplayNames;
-    uint64_t selectedIndex = 0;
-    uint64_t offIndex = 0;
-    bool trackMenuItemSelected = false;
-    
-    for (size_t index = 0; index &lt; m_legibleTracksForMenu.size(); index++) {
-        auto&amp; track = m_legibleTracksForMenu[index];
-        trackDisplayNames.append(captionPreferences.displayNameForTrack(track.get()));
-        
-        if (track == offItem)
-            offIndex = index;
-        
-        if (track == automaticItem &amp;&amp; displayMode == MediaControlsHost::automaticKeyword()) {
-            selectedIndex = index;
-            trackMenuItemSelected = true;
-        }
-        
-        if (displayMode != MediaControlsHost::automaticKeyword() &amp;&amp; track-&gt;mode() == TextTrack::showingKeyword()) {
-            selectedIndex = index;
-            trackMenuItemSelected = true;
-        }
-    }
-    
-    if (offIndex &amp;&amp; !trackMenuItemSelected &amp;&amp; displayMode == MediaControlsHost::forcedOnlyKeyword()) {
-        selectedIndex = offIndex;
-        trackMenuItemSelected = true;
-    }
-    
-    m_videoFullscreenInterface-&gt;setLegibleMediaSelectionOptions(trackDisplayNames, selectedIndex);
-}
-
-const Vector&lt;AtomicString&gt;&amp; WebVideoFullscreenModelVideoElement::observedEventNames()
-{
-    static NeverDestroyed&lt;Vector&lt;AtomicString&gt;&gt; sEventNames;
-
-    if (!sEventNames.get().size()) {
-        sEventNames.get().append(eventNames().durationchangeEvent);
-        sEventNames.get().append(eventNames().pauseEvent);
-        sEventNames.get().append(eventNames().playEvent);
-        sEventNames.get().append(eventNames().ratechangeEvent);
-        sEventNames.get().append(eventNames().timeupdateEvent);
-        sEventNames.get().append(eventNames().addtrackEvent);
-        sEventNames.get().append(eventNames().removetrackEvent);
-        sEventNames.get().append(eventNames().webkitcurrentplaybacktargetiswirelesschangedEvent);
-    }
-    return sEventNames.get();
-}
-
-const AtomicString&amp; WebVideoFullscreenModelVideoElement::eventNameAll()
-{
-    static NeverDestroyed&lt;AtomicString&gt; sEventNameAll = &quot;allEvents&quot;;
-    return sEventNameAll;
-}
-
-void WebVideoFullscreenModelVideoElement::fullscreenModeChanged(HTMLMediaElementEnums::VideoFullscreenMode videoFullscreenMode)
-{
-    if (m_videoElement)
-        m_videoElement-&gt;fullscreenModeChanged(videoFullscreenMode);
-}
-
-bool WebVideoFullscreenModelVideoElement::isVisible() const
-{
-    if (!m_videoElement)
-        return false;
-
-    if (Page* page = m_videoElement-&gt;document().page())
-        return page-&gt;isVisible();
-
-    return false;
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (195599 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-01-26 18:46:44 UTC (rev 195599)
+++ trunk/Source/WebKit2/ChangeLog        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2016-01-25  Ada Chan  &lt;adachan@apple.com&gt;
+
+        Move WebVideoFullscreenManager and related classes from iOS specific folders to cocoa folders
+        https://bugs.webkit.org/show_bug.cgi?id=153473
+
+        Reviewed by Eric Carlson.
+
+        * DerivedSources.make:
+        Add new paths.
+        * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h: Renamed from Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h.
+        * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in: Renamed from Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in.
+        * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm: Renamed from Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm.
+        (WebKit::WebVideoFullscreenManagerProxy::setSeekableRangesVector):
+        Fix a style error by moving the opening curly brace to the same line as the for statement.
+        * WebKit2.xcodeproj/project.pbxproj:
+        Update due to changes to the file locations.
+        * WebProcess/cocoa/WebVideoFullscreenManager.h: Renamed from Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h.
+        * WebProcess/cocoa/WebVideoFullscreenManager.messages.in: Renamed from Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.messages.in.
+        * WebProcess/cocoa/WebVideoFullscreenManager.mm: Renamed from Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm.
+        (WebKit::WebVideoFullscreenInterfaceContext::setSeekableRanges):
+        Fix a style error by adding a missing space after a comma.
+
</ins><span class="cx"> 2016-01-26  Daniel Bates  &lt;dabates@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WebKitTestRunner: Credential cache is not cleared between tests
</span></span></pre></div>
<a id="trunkSourceWebKit2DerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DerivedSources.make (195599 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DerivedSources.make        2016-01-26 18:46:44 UTC (rev 195599)
+++ trunk/Source/WebKit2/DerivedSources.make        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -52,9 +52,11 @@
</span><span class="cx">     $(WebKit2)/WebProcess/UserContent \
</span><span class="cx">     $(WebKit2)/WebProcess/WebCoreSupport \
</span><span class="cx">     $(WebKit2)/WebProcess/WebPage \
</span><ins>+    $(WebKit2)/WebProcess/cocoa \
</ins><span class="cx">     $(WebKit2)/WebProcess/ios \
</span><span class="cx">     $(WebKit2)/WebProcess \
</span><span class="cx">     $(WebKit2)/UIProcess \
</span><ins>+    $(WebKit2)/UIProcess/Cocoa \
</ins><span class="cx">     $(WebKit2)/UIProcess/Databases \
</span><span class="cx">     $(WebKit2)/UIProcess/Downloads \
</span><span class="cx">     $(WebKit2)/UIProcess/Network \
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWebVideoFullscreenManagerProxyhfromrev195599trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxyh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h (from rev 195599, trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h) (0 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -0,0 +1,174 @@
</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.
+ */
+
+#ifndef WebVideoFullscreenManagerProxy_h
+#define WebVideoFullscreenManagerProxy_h
+
+#if PLATFORM(IOS)
+
+#include &quot;MessageReceiver.h&quot;
+#include &lt;WebCore/GraphicsLayer.h&gt;
+#include &lt;WebCore/WebVideoFullscreenInterfaceAVKit.h&gt;
+#include &lt;WebCore/WebVideoFullscreenModel.h&gt;
+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+
+OBJC_CLASS UIView;
+
+namespace WebKit {
+
+class WebPageProxy;
+class WebVideoFullscreenManagerProxy;
+
+class WebVideoFullscreenModelContext final: public RefCounted&lt;WebVideoFullscreenModelContext&gt;, public WebCore::WebVideoFullscreenModel, public WebCore::WebVideoFullscreenChangeObserver  {
+public:
+    static Ref&lt;WebVideoFullscreenModelContext&gt; create(WebVideoFullscreenManagerProxy&amp; manager, uint64_t contextId)
+    {
+        return adoptRef(*new WebVideoFullscreenModelContext(manager, contextId));
+    }
+    virtual ~WebVideoFullscreenModelContext() { }
+
+    void invalidate() { m_manager = nullptr; }
+
+    UIView *layerHostView() const { return m_layerHostView.get(); }
+    void setLayerHostView(RetainPtr&lt;UIView&gt;&amp;&amp; layerHostView) { m_layerHostView = WTFMove(layerHostView); }
+
+private:
+    WebVideoFullscreenModelContext(WebVideoFullscreenManagerProxy&amp; manager, uint64_t contextId)
+        : m_manager(&amp;manager)
+        , m_contextId(contextId)
+    {
+    }
+
+    // WebVideoFullscreenModel
+    virtual void play() override;
+    virtual void pause() override;
+    virtual void togglePlayState() override;
+    virtual void beginScrubbing() override;
+    virtual void endScrubbing() override;
+    virtual void seekToTime(double) override;
+    virtual void fastSeek(double time) override;
+    virtual void beginScanningForward() override;
+    virtual void beginScanningBackward() override;
+    virtual void endScanning() override;
+    virtual void requestFullscreenMode(WebCore::HTMLMediaElementEnums::VideoFullscreenMode) override;
+    virtual void setVideoLayerFrame(WebCore::FloatRect) override;
+    virtual void setVideoLayerGravity(VideoGravity) override;
+    virtual void selectAudioMediaOption(uint64_t) override;
+    virtual void selectLegibleMediaOption(uint64_t) override;
+    virtual void fullscreenModeChanged(WebCore::HTMLMediaElementEnums::VideoFullscreenMode) override;
+    virtual bool isVisible() const override;
+
+    // WebVideoFullscreenChangeObserver
+    virtual void didSetupFullscreen() override;
+    virtual void didEnterFullscreen() override;
+    virtual void didExitFullscreen() override;
+    virtual void didCleanupFullscreen() override;
+    virtual void fullscreenMayReturnToInline() override;
+
+    WebVideoFullscreenManagerProxy* m_manager;
+    uint64_t m_contextId;
+    RetainPtr&lt;UIView *&gt; m_layerHostView;
+};
+
+class WebVideoFullscreenManagerProxy : public RefCounted&lt;WebVideoFullscreenManagerProxy&gt;, private IPC::MessageReceiver {
+public:
+    static RefPtr&lt;WebVideoFullscreenManagerProxy&gt; create(WebPageProxy&amp;);
+    virtual ~WebVideoFullscreenManagerProxy();
+
+    void invalidate();
+
+    void requestHideAndExitFullscreen();
+    bool hasMode(WebCore::HTMLMediaElementEnums::VideoFullscreenMode) const;
+    bool mayAutomaticallyShowVideoPictureInPicture() const;
+    void applicationDidBecomeActive();
+    bool isVisible() const;
+
+private:
+    friend class WebVideoFullscreenModelContext;
+
+    explicit WebVideoFullscreenManagerProxy(WebPageProxy&amp;);
+    virtual void didReceiveMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;) override;
+
+    typedef std::tuple&lt;RefPtr&lt;WebVideoFullscreenModelContext&gt;, RefPtr&lt;WebCore::WebVideoFullscreenInterfaceAVKit&gt;&gt; ModelInterfaceTuple;
+    ModelInterfaceTuple createModelAndInterface(uint64_t contextId);
+    ModelInterfaceTuple&amp; ensureModelAndInterface(uint64_t contextId);
+    WebVideoFullscreenModelContext&amp; ensureModel(uint64_t contextId);
+    WebCore::WebVideoFullscreenInterfaceAVKit&amp; ensureInterface(uint64_t contextId);
+
+    // Messages from WebVideoFullscreenManager
+    void setupFullscreenWithID(uint64_t contextId, uint32_t videoLayerID, const WebCore::IntRect&amp; initialRect, float hostingScaleFactor, WebCore::HTMLMediaElementEnums::VideoFullscreenMode, bool allowsPictureInPicture);
+    void resetMediaState(uint64_t contextId);
+    void setCurrentTime(uint64_t contextId, double currentTime, double hostTime);
+    void setBufferedTime(uint64_t contextId, double bufferedTime);
+    void setVideoDimensions(uint64_t contextId, bool hasVideo, unsigned width, unsigned height);
+    void setSeekableRangesVector(uint64_t contextId, Vector&lt;std::pair&lt;double, double&gt;&gt; ranges);
+    void setCanPlayFastReverse(uint64_t contextId, bool value);
+    void setAudioMediaSelectionOptions(uint64_t contextId, Vector&lt;String&gt; options, uint64_t selectedIndex);
+    void setLegibleMediaSelectionOptions(uint64_t contextId, Vector&lt;String&gt; options, uint64_t selectedIndex);
+    void setExternalPlaybackProperties(uint64_t contextId, bool enabled, uint32_t targetType, String localizedDeviceName);
+    void setWirelessVideoPlaybackDisabled(uint64_t contextId, bool);
+    void setDuration(uint64_t contextId, double duration);
+    void setRate(uint64_t contextId, bool isPlaying, double rate);
+    void enterFullscreen(uint64_t contextId);
+    void exitFullscreen(uint64_t contextId, WebCore::IntRect finalRect);
+    void cleanupFullscreen(uint64_t contextId);
+    void preparedToReturnToInline(uint64_t contextId, bool visible, WebCore::IntRect inlineRect);
+
+    // Messages to WebVideoFullscreenManager
+    void play(uint64_t contextId);
+    void pause(uint64_t contextId);
+    void togglePlayState(uint64_t contextId);
+    void beginScrubbing(uint64_t contextId);
+    void endScrubbing(uint64_t contextId);
+    void seekToTime(uint64_t contextId, double time);
+    void fastSeek(uint64_t contextId, double time);
+    void beginScanningForward(uint64_t contextId);
+    void beginScanningBackward(uint64_t contextId);
+    void endScanning(uint64_t contextId);
+    void requestFullscreenMode(uint64_t contextId, WebCore::HTMLMediaElementEnums::VideoFullscreenMode);
+    void didSetupFullscreen(uint64_t contextId);
+    void didExitFullscreen(uint64_t contextId);
+    void didEnterFullscreen(uint64_t contextId);
+    void didCleanupFullscreen(uint64_t contextId);
+    void setVideoLayerFrame(uint64_t contextId, WebCore::FloatRect);
+    void setVideoLayerGravity(uint64_t contextId, WebCore::WebVideoFullscreenModel::VideoGravity);
+    void selectAudioMediaOption(uint64_t contextId, uint64_t index);
+    void selectLegibleMediaOption(uint64_t contextId, uint64_t index);
+    void fullscreenModeChanged(uint64_t contextId, WebCore::HTMLMediaElementEnums::VideoFullscreenMode);
+    void fullscreenMayReturnToInline(uint64_t contextId);
+
+    WebPageProxy* m_page;
+    HashMap&lt;uint64_t, ModelInterfaceTuple&gt; m_contextMap;
+
+};
+    
+} // namespace WebKit
+
+#endif // PLATFORM(IOS)
+
+#endif // WebVideoFullscreenManagerProxy_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWebVideoFullscreenManagerProxymessagesinfromrev195599trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxymessagesin"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in (from rev 195599, trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in) (0 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -0,0 +1,43 @@
</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.
+
+#if PLATFORM(IOS)
+messages -&gt; WebVideoFullscreenManagerProxy {
+    ResetMediaState(uint64_t contextId)
+    SetCurrentTime(uint64_t contextId, double currentTime, double hostTime)
+    SetBufferedTime(uint64_t contextId, double bufferedTime)
+    SetVideoDimensions(uint64_t contextId, bool hasVideo, unsigned width, unsigned height)
+    SetSeekableRangesVector(uint64_t contextId, Vector&lt;std::pair&lt;double, double&gt;&gt; ranges)
+    SetCanPlayFastReverse(uint64_t contextId, bool value)
+    SetAudioMediaSelectionOptions(uint64_t contextId, Vector&lt;String&gt; options, uint64_t selectedIndex)
+    SetLegibleMediaSelectionOptions(uint64_t contextId, Vector&lt;String&gt; options, uint64_t selectedIndex)
+    SetExternalPlaybackProperties(uint64_t contextId, bool enabled, uint32_t targetType, String localizedDeviceName)
+    SetWirelessVideoPlaybackDisabled(uint64_t contextId, bool disabled)
+    SetDuration(uint64_t contextId, double duration)
+    SetRate(uint64_t contextId, bool isPlaying, double rate)
+    SetupFullscreenWithID(uint64_t contextId, uint32_t videoLayerID, WebCore::IntRect initialRect, float hostingScaleFactor, WebCore::HTMLMediaElementEnums::VideoFullscreenMode videoFullscreenMode, bool allowsPictureInPicture)
+    EnterFullscreen(uint64_t contextId)
+    ExitFullscreen(uint64_t contextId, WebCore::IntRect finalRect)
+    CleanupFullscreen(uint64_t contextId)
+    PreparedToReturnToInline(uint64_t contextId, bool visible, WebCore::IntRect inlineRect)
+}
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWebVideoFullscreenManagerProxymmfromrev195599trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxymm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm (from rev 195599, trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm) (0 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -0,0 +1,593 @@
</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.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;WebVideoFullscreenManagerProxy.h&quot;
+
+#if PLATFORM(IOS)
+
+#import &quot;RemoteLayerTreeDrawingAreaProxy.h&quot;
+#import &quot;UIKitSPI.h&quot;
+#import &quot;WebPageProxy.h&quot;
+#import &quot;WebProcessProxy.h&quot;
+#import &quot;WebVideoFullscreenManagerMessages.h&quot;
+#import &quot;WebVideoFullscreenManagerProxyMessages.h&quot;
+#import &lt;QuartzCore/CoreAnimation.h&gt;
+#import &lt;WebCore/QuartzCoreSPI.h&gt;
+#import &lt;WebCore/TimeRanges.h&gt;
+#import &lt;WebKitSystemInterface.h&gt;
+
+@interface WKLayerHostView : UIView
+@property (nonatomic, assign) uint32_t contextID;
+@end
+
+@implementation WKLayerHostView
+
++ (Class)layerClass {
+    return [CALayerHost class];
+}
+
+- (uint32_t)contextID {
+    return [[self layerHost] contextId];
+}
+
+- (void)setContextID:(uint32_t)contextID {
+    [[self layerHost] setContextId:contextID];
+}
+
+- (CALayerHost *)layerHost {
+    return (CALayerHost *)[self layer];
+}
+
+@end
+
+using namespace WebCore;
+
+namespace WebKit {
+
+#if !HAVE(AVKIT)
+
+RefPtr&lt;WebVideoFullscreenManagerProxy&gt; WebVideoFullscreenManagerProxy::create(WebPageProxy&amp;)
+{
+    return nullptr;
+}
+
+void WebVideoFullscreenManagerProxy::invalidate()
+{
+}
+
+bool WebVideoFullscreenManagerProxy::hasMode(HTMLMediaElementEnums::VideoFullscreenMode) const
+{
+    return false;
+}
+
+bool WebVideoFullscreenManagerProxy::mayAutomaticallyShowVideoPictureInPicture() const
+{
+    return false;
+}
+
+void WebVideoFullscreenManagerProxy::requestHideAndExitFullscreen()
+{
+
+}
+
+void WebVideoFullscreenManagerProxy::applicationDidBecomeActive()
+{
+
+}
+#else
+
+#pragma mark - WebVideoFullscreenModelContext
+
+void WebVideoFullscreenModelContext::play()
+{
+    if (m_manager)
+        m_manager-&gt;play(m_contextId);
+}
+
+void WebVideoFullscreenModelContext::pause()
+{
+    if (m_manager)
+        m_manager-&gt;pause(m_contextId);
+}
+
+void WebVideoFullscreenModelContext::togglePlayState()
+{
+    if (m_manager)
+        m_manager-&gt;togglePlayState(m_contextId);
+}
+
+void WebVideoFullscreenModelContext::beginScrubbing()
+{
+    if (m_manager)
+        m_manager-&gt;beginScrubbing(m_contextId);
+}
+
+void WebVideoFullscreenModelContext::endScrubbing()
+{
+    if (m_manager)
+        m_manager-&gt;endScrubbing(m_contextId);
+}
+
+void WebVideoFullscreenModelContext::seekToTime(double time)
+{
+    if (m_manager)
+        m_manager-&gt;seekToTime(m_contextId, time);
+}
+
+void WebVideoFullscreenModelContext::fastSeek(double time)
+{
+    if (m_manager)
+        m_manager-&gt;fastSeek(m_contextId, time);
+}
+
+void WebVideoFullscreenModelContext::beginScanningForward()
+{
+    if (m_manager)
+        m_manager-&gt;beginScanningForward(m_contextId);
+}
+
+void WebVideoFullscreenModelContext::beginScanningBackward()
+{
+    if (m_manager)
+        m_manager-&gt;beginScanningBackward(m_contextId);
+}
+
+void WebVideoFullscreenModelContext::endScanning()
+{
+    if (m_manager)
+        m_manager-&gt;endScanning(m_contextId);
+}
+
+void WebVideoFullscreenModelContext::requestFullscreenMode(HTMLMediaElementEnums::VideoFullscreenMode mode)
+{
+    if (m_manager)
+        m_manager-&gt;requestFullscreenMode(m_contextId, mode);
+}
+
+void WebVideoFullscreenModelContext::setVideoLayerFrame(WebCore::FloatRect frame)
+{
+    if (m_manager)
+        m_manager-&gt;setVideoLayerFrame(m_contextId, frame);
+}
+
+void WebVideoFullscreenModelContext::setVideoLayerGravity(WebCore::WebVideoFullscreenModel::VideoGravity gravity)
+{
+    if (m_manager)
+        m_manager-&gt;setVideoLayerGravity(m_contextId, gravity);
+}
+
+void WebVideoFullscreenModelContext::selectAudioMediaOption(uint64_t optionId)
+{
+    if (m_manager)
+        m_manager-&gt;selectAudioMediaOption(m_contextId, optionId);
+}
+
+void WebVideoFullscreenModelContext::selectLegibleMediaOption(uint64_t optionId)
+{
+    if (m_manager)
+        m_manager-&gt;selectLegibleMediaOption(m_contextId, optionId);
+}
+
+void WebVideoFullscreenModelContext::fullscreenModeChanged(WebCore::HTMLMediaElementEnums::VideoFullscreenMode mode)
+{
+    if (m_manager)
+        m_manager-&gt;fullscreenModeChanged(m_contextId, mode);
+}
+
+bool WebVideoFullscreenModelContext::isVisible() const
+{
+    return m_manager ? m_manager-&gt;isVisible() : false;
+}
+
+void WebVideoFullscreenModelContext::didSetupFullscreen()
+{
+    if (m_manager)
+        m_manager-&gt;didSetupFullscreen(m_contextId);
+}
+
+void WebVideoFullscreenModelContext::didEnterFullscreen()
+{
+    if (m_manager)
+        m_manager-&gt;didEnterFullscreen(m_contextId);
+}
+
+void WebVideoFullscreenModelContext::didExitFullscreen()
+{
+    if (m_manager)
+        m_manager-&gt;didExitFullscreen(m_contextId);
+}
+
+void WebVideoFullscreenModelContext::didCleanupFullscreen()
+{
+    if (m_manager)
+        m_manager-&gt;didCleanupFullscreen(m_contextId);
+}
+
+void WebVideoFullscreenModelContext::fullscreenMayReturnToInline()
+{
+    if (m_manager)
+        m_manager-&gt;fullscreenMayReturnToInline(m_contextId);
+}
+
+#pragma mark - WebVideoFullscreenManagerProxy
+
+RefPtr&lt;WebVideoFullscreenManagerProxy&gt; WebVideoFullscreenManagerProxy::create(WebPageProxy&amp; page)
+{
+    return adoptRef(new WebVideoFullscreenManagerProxy(page));
+}
+
+WebVideoFullscreenManagerProxy::WebVideoFullscreenManagerProxy(WebPageProxy&amp; page)
+    : m_page(&amp;page)
+{
+    m_page-&gt;process().addMessageReceiver(Messages::WebVideoFullscreenManagerProxy::messageReceiverName(), m_page-&gt;pageID(), *this);
+}
+
+WebVideoFullscreenManagerProxy::~WebVideoFullscreenManagerProxy()
+{
+    if (!m_page)
+        return;
+    invalidate();
+}
+
+void WebVideoFullscreenManagerProxy::invalidate()
+{
+    m_page-&gt;process().removeMessageReceiver(Messages::WebVideoFullscreenManagerProxy::messageReceiverName(), m_page-&gt;pageID());
+    m_page = nullptr;
+
+    for (auto&amp; tuple : m_contextMap.values()) {
+        RefPtr&lt;WebVideoFullscreenModelContext&gt; model;
+        RefPtr&lt;WebCore::WebVideoFullscreenInterfaceAVKit&gt; interface;
+        std::tie(model, interface) = tuple;
+
+        interface-&gt;invalidate();
+        [model-&gt;layerHostView() removeFromSuperview];
+        model-&gt;setLayerHostView(nullptr);
+    }
+
+    m_contextMap.clear();
+}
+
+void WebVideoFullscreenManagerProxy::requestHideAndExitFullscreen()
+{
+    for (auto&amp; tuple : m_contextMap.values())
+        std::get&lt;1&gt;(tuple)-&gt;requestHideAndExitFullscreen();
+}
+
+bool WebVideoFullscreenManagerProxy::hasMode(HTMLMediaElementEnums::VideoFullscreenMode mode) const
+{
+    for (auto&amp; tuple : m_contextMap.values()) {
+        if (std::get&lt;1&gt;(tuple)-&gt;hasMode(mode))
+            return true;
+    }
+    return false;
+}
+
+bool WebVideoFullscreenManagerProxy::mayAutomaticallyShowVideoPictureInPicture() const
+{
+    for (auto&amp; tuple : m_contextMap.values()) {
+        if (std::get&lt;1&gt;(tuple)-&gt;mayAutomaticallyShowVideoPictureInPicture())
+            return true;
+    }
+    return false;
+}
+
+void WebVideoFullscreenManagerProxy::applicationDidBecomeActive()
+{
+    for (auto&amp; tuple : m_contextMap.values())
+        std::get&lt;1&gt;(tuple)-&gt;applicationDidBecomeActive();
+}
+
+WebVideoFullscreenManagerProxy::ModelInterfaceTuple WebVideoFullscreenManagerProxy::createModelAndInterface(uint64_t contextId)
+{
+    Ref&lt;WebVideoFullscreenModelContext&gt; model = WebVideoFullscreenModelContext::create(*this, contextId);
+    Ref&lt;WebCore::WebVideoFullscreenInterfaceAVKit&gt; interface = WebVideoFullscreenInterfaceAVKit::create();
+
+    interface-&gt;setWebVideoFullscreenModel(&amp;model.get());
+    interface-&gt;setWebVideoFullscreenChangeObserver(&amp;model.get());
+
+    return std::make_tuple(WTFMove(model), WTFMove(interface));
+}
+
+WebVideoFullscreenManagerProxy::ModelInterfaceTuple&amp; WebVideoFullscreenManagerProxy::ensureModelAndInterface(uint64_t contextId)
+{
+    auto addResult = m_contextMap.add(contextId, ModelInterfaceTuple());
+    if (addResult.isNewEntry)
+        addResult.iterator-&gt;value = createModelAndInterface(contextId);
+    return addResult.iterator-&gt;value;
+}
+
+WebVideoFullscreenModelContext&amp; WebVideoFullscreenManagerProxy::ensureModel(uint64_t contextId)
+{
+    return *std::get&lt;0&gt;(ensureModelAndInterface(contextId));
+}
+
+WebCore::WebVideoFullscreenInterfaceAVKit&amp; WebVideoFullscreenManagerProxy::ensureInterface(uint64_t contextId)
+{
+    return *std::get&lt;1&gt;(ensureModelAndInterface(contextId));
+}
+
+#pragma mark Messages from WebVideoFullscreenManager
+
+void WebVideoFullscreenManagerProxy::setupFullscreenWithID(uint64_t contextId, uint32_t videoLayerID, const WebCore::IntRect&amp; initialRect, float hostingDeviceScaleFactor, HTMLMediaElementEnums::VideoFullscreenMode videoFullscreenMode, bool allowsPictureInPicture)
+{
+    ASSERT(videoLayerID);
+    RefPtr&lt;WebVideoFullscreenModelContext&gt; model;
+    RefPtr&lt;WebCore::WebVideoFullscreenInterfaceAVKit&gt; interface;
+
+    std::tie(model, interface) = ensureModelAndInterface(contextId);
+
+    RetainPtr&lt;WKLayerHostView&gt; view = static_cast&lt;WKLayerHostView*&gt;(model-&gt;layerHostView());
+    if (!view) {
+        view = adoptNS([[WKLayerHostView alloc] init]);
+        model-&gt;setLayerHostView(view);
+    }
+    [view setContextID:videoLayerID];
+    if (hostingDeviceScaleFactor != 1) {
+        // Invert the scale transform added in the WebProcess to fix &lt;rdar://problem/18316542&gt;.
+        float inverseScale = 1 / hostingDeviceScaleFactor;
+        [[view layer] setSublayerTransform:CATransform3DMakeScale(inverseScale, inverseScale, 1)];
+    }
+
+    UIView *parentView = downcast&lt;RemoteLayerTreeDrawingAreaProxy&gt;(*m_page-&gt;drawingArea()).remoteLayerTreeHost().rootLayer();
+    interface-&gt;setupFullscreen(*model-&gt;layerHostView(), initialRect, parentView, videoFullscreenMode, allowsPictureInPicture);
+}
+
+void WebVideoFullscreenManagerProxy::resetMediaState(uint64_t contextId)
+{
+    ensureInterface(contextId).resetMediaState();
+}
+
+void WebVideoFullscreenManagerProxy::setCurrentTime(uint64_t contextId, double currentTime, double hostTime)
+{
+    ensureInterface(contextId).setCurrentTime(currentTime, hostTime);
+}
+
+void WebVideoFullscreenManagerProxy::setBufferedTime(uint64_t contextId, double bufferedTime)
+{
+    ensureInterface(contextId).setBufferedTime(bufferedTime);
+}
+
+void WebVideoFullscreenManagerProxy::setVideoDimensions(uint64_t contextId, bool hasVideo, unsigned width, unsigned height)
+{
+    ensureInterface(contextId).setVideoDimensions(hasVideo, width, height);
+}
+
+void WebVideoFullscreenManagerProxy::setSeekableRangesVector(uint64_t contextId, Vector&lt;std::pair&lt;double, double&gt;&gt; ranges)
+{
+    RefPtr&lt;TimeRanges&gt; timeRanges = TimeRanges::create();
+    for (const auto&amp; range : ranges) {
+        ASSERT(isfinite(range.first));
+        ASSERT(isfinite(range.second));
+        ASSERT(range.second &gt;= range.first);
+        timeRanges-&gt;add(range.first, range.second);
+    }
+
+    ensureInterface(contextId).setSeekableRanges(*timeRanges);
+}
+
+void WebVideoFullscreenManagerProxy::setCanPlayFastReverse(uint64_t contextId, bool value)
+{
+    ensureInterface(contextId).setCanPlayFastReverse(value);
+}
+
+void WebVideoFullscreenManagerProxy::setAudioMediaSelectionOptions(uint64_t contextId, Vector&lt;String&gt; options, uint64_t selectedIndex)
+{
+    ensureInterface(contextId).setAudioMediaSelectionOptions(options, selectedIndex);
+}
+
+void WebVideoFullscreenManagerProxy::setLegibleMediaSelectionOptions(uint64_t contextId, Vector&lt;String&gt; options, uint64_t selectedIndex)
+{
+    ensureInterface(contextId).setLegibleMediaSelectionOptions(options, selectedIndex);
+}
+
+void WebVideoFullscreenManagerProxy::setExternalPlaybackProperties(uint64_t contextId, bool enabled, uint32_t targetType, String localizedDeviceName)
+{
+    WebVideoFullscreenInterface::ExternalPlaybackTargetType type = static_cast&lt;WebVideoFullscreenInterface::ExternalPlaybackTargetType&gt;(targetType);
+    ASSERT(type == WebVideoFullscreenInterface::TargetTypeAirPlay || type == WebVideoFullscreenInterface::TargetTypeTVOut || type == WebVideoFullscreenInterface::TargetTypeNone);
+    
+    ensureInterface(contextId).setExternalPlayback(enabled, type, localizedDeviceName);
+}
+
+void WebVideoFullscreenManagerProxy::setWirelessVideoPlaybackDisabled(uint64_t contextId, bool disabled)
+{
+    ensureInterface(contextId).setWirelessVideoPlaybackDisabled(disabled);
+}
+
+void WebVideoFullscreenManagerProxy::setDuration(uint64_t contextId, double duration)
+{
+    ensureInterface(contextId).setDuration(duration);
+}
+
+void WebVideoFullscreenManagerProxy::setRate(uint64_t contextId, bool isPlaying, double rate)
+{
+    ensureInterface(contextId).setRate(isPlaying, rate);
+}
+
+void WebVideoFullscreenManagerProxy::enterFullscreen(uint64_t contextId)
+{
+    auto&amp; interface = ensureInterface(contextId);
+    interface.enterFullscreen();
+
+    // Only one context can be in a given full screen mode at a time:
+    for (auto&amp; contextPair : m_contextMap) {
+        auto&amp; otherContextId = contextPair.key;
+        if (contextId == otherContextId)
+            continue;
+
+        auto&amp; otherInterface = std::get&lt;1&gt;(contextPair.value);
+        if (otherInterface-&gt;hasMode(interface.mode()))
+            otherInterface-&gt;requestHideAndExitFullscreen();
+    }
+}
+
+void WebVideoFullscreenManagerProxy::exitFullscreen(uint64_t contextId, WebCore::IntRect finalRect)
+{
+    ensureInterface(contextId).exitFullscreen(finalRect);
+}
+
+void WebVideoFullscreenManagerProxy::cleanupFullscreen(uint64_t contextId)
+{
+    ensureInterface(contextId).cleanupFullscreen();
+}
+
+void WebVideoFullscreenManagerProxy::preparedToReturnToInline(uint64_t contextId, bool visible, WebCore::IntRect inlineRect)
+{
+    m_page-&gt;fullscreenMayReturnToInline();
+
+    ensureInterface(contextId).preparedToReturnToInline(visible, inlineRect);
+}
+
+#pragma mark Messages to WebVideoFullscreenManager
+
+void WebVideoFullscreenManagerProxy::play(uint64_t contextId)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManager::Play(contextId), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManagerProxy::pause(uint64_t contextId)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManager::Pause(contextId), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManagerProxy::togglePlayState(uint64_t contextId)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManager::TogglePlayState(contextId), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManagerProxy::beginScrubbing(uint64_t contextId)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManager::BeginScrubbing(contextId), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManagerProxy::endScrubbing(uint64_t contextId)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManager::EndScrubbing(contextId), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManagerProxy::seekToTime(uint64_t contextId, double time)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManager::SeekToTime(contextId, time), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManagerProxy::fastSeek(uint64_t contextId, double time)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManager::FastSeek(contextId, time), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManagerProxy::beginScanningForward(uint64_t contextId)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManager::BeginScanningForward(contextId), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManagerProxy::beginScanningBackward(uint64_t contextId)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManager::BeginScanningBackward(contextId), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManagerProxy::endScanning(uint64_t contextId)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManager::EndScanning(contextId), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManagerProxy::requestFullscreenMode(uint64_t contextId, WebCore::HTMLMediaElementEnums::VideoFullscreenMode mode)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManager::RequestFullscreenMode(contextId, mode), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManagerProxy::didSetupFullscreen(uint64_t contextId)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManager::DidSetupFullscreen(contextId), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManagerProxy::didExitFullscreen(uint64_t contextId)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManager::DidExitFullscreen(contextId), m_page-&gt;pageID());
+    m_page-&gt;didExitFullscreen();
+}
+
+void WebVideoFullscreenManagerProxy::didEnterFullscreen(uint64_t contextId)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManager::DidEnterFullscreen(contextId), m_page-&gt;pageID());
+    m_page-&gt;didEnterFullscreen();
+}
+
+void WebVideoFullscreenManagerProxy::didCleanupFullscreen(uint64_t contextId)
+{
+    auto&amp; model = ensureModel(contextId);
+
+    [CATransaction flush];
+    [model.layerHostView() removeFromSuperview];
+    model.setLayerHostView(nullptr);
+    m_page-&gt;send(Messages::WebVideoFullscreenManager::DidCleanupFullscreen(contextId), m_page-&gt;pageID());
+
+    m_contextMap.remove(contextId);
+}
+
+void WebVideoFullscreenManagerProxy::setVideoLayerFrame(uint64_t contextId, WebCore::FloatRect frame)
+{
+    @autoreleasepool {
+        mach_port_name_t fencePort = [UIWindow _synchronizeDrawingAcrossProcesses];
+
+        m_page-&gt;send(Messages::WebVideoFullscreenManager::SetVideoLayerFrameFenced(contextId, frame, IPC::Attachment(fencePort, MACH_MSG_TYPE_MOVE_SEND)), m_page-&gt;pageID());
+    }
+}
+
+void WebVideoFullscreenManagerProxy::setVideoLayerGravity(uint64_t contextId, WebCore::WebVideoFullscreenModel::VideoGravity gravity)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManager::SetVideoLayerGravityEnum(contextId, (unsigned)gravity), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManagerProxy::selectAudioMediaOption(uint64_t contextId, uint64_t index)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManager::SelectAudioMediaOption(contextId, index), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManagerProxy::selectLegibleMediaOption(uint64_t contextId, uint64_t index)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManager::SelectLegibleMediaOption(contextId, index), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManagerProxy::fullscreenModeChanged(uint64_t contextId, WebCore::HTMLMediaElementEnums::VideoFullscreenMode mode)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManager::FullscreenModeChanged(contextId, mode), m_page-&gt;pageID());
+}
+
+bool WebVideoFullscreenManagerProxy::isVisible() const
+{
+    return m_page-&gt;isViewVisible() &amp;&amp; m_page-&gt;isInWindow();
+}
+
+void WebVideoFullscreenManagerProxy::fullscreenMayReturnToInline(uint64_t contextId)
+{
+    bool isViewVisible = m_page-&gt;isViewVisible();
+    m_page-&gt;send(Messages::WebVideoFullscreenManager::FullscreenMayReturnToInline(contextId, isViewVisible), m_page-&gt;pageID());
+}
+
+#endif
+
+} // namespace WebKit
+
+#endif // PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxyh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h (195599 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h        2016-01-26 18:46:44 UTC (rev 195599)
+++ trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -1,174 +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.
- */
-
-#ifndef WebVideoFullscreenManagerProxy_h
-#define WebVideoFullscreenManagerProxy_h
-
-#if PLATFORM(IOS)
-
-#include &quot;MessageReceiver.h&quot;
-#include &lt;WebCore/GraphicsLayer.h&gt;
-#include &lt;WebCore/WebVideoFullscreenInterfaceAVKit.h&gt;
-#include &lt;WebCore/WebVideoFullscreenModel.h&gt;
-#include &lt;wtf/HashMap.h&gt;
-#include &lt;wtf/PassRefPtr.h&gt;
-#include &lt;wtf/RefCounted.h&gt;
-#include &lt;wtf/RefPtr.h&gt;
-
-OBJC_CLASS UIView;
-
-namespace WebKit {
-
-class WebPageProxy;
-class WebVideoFullscreenManagerProxy;
-
-class WebVideoFullscreenModelContext final: public RefCounted&lt;WebVideoFullscreenModelContext&gt;, public WebCore::WebVideoFullscreenModel, public WebCore::WebVideoFullscreenChangeObserver  {
-public:
-    static Ref&lt;WebVideoFullscreenModelContext&gt; create(WebVideoFullscreenManagerProxy&amp; manager, uint64_t contextId)
-    {
-        return adoptRef(*new WebVideoFullscreenModelContext(manager, contextId));
-    }
-    virtual ~WebVideoFullscreenModelContext() { }
-
-    void invalidate() { m_manager = nullptr; }
-
-    UIView *layerHostView() const { return m_layerHostView.get(); }
-    void setLayerHostView(RetainPtr&lt;UIView&gt;&amp;&amp; layerHostView) { m_layerHostView = WTFMove(layerHostView); }
-
-private:
-    WebVideoFullscreenModelContext(WebVideoFullscreenManagerProxy&amp; manager, uint64_t contextId)
-        : m_manager(&amp;manager)
-        , m_contextId(contextId)
-    {
-    }
-
-    // WebVideoFullscreenModel
-    virtual void play() override;
-    virtual void pause() override;
-    virtual void togglePlayState() override;
-    virtual void beginScrubbing() override;
-    virtual void endScrubbing() override;
-    virtual void seekToTime(double) override;
-    virtual void fastSeek(double time) override;
-    virtual void beginScanningForward() override;
-    virtual void beginScanningBackward() override;
-    virtual void endScanning() override;
-    virtual void requestFullscreenMode(WebCore::HTMLMediaElementEnums::VideoFullscreenMode) override;
-    virtual void setVideoLayerFrame(WebCore::FloatRect) override;
-    virtual void setVideoLayerGravity(VideoGravity) override;
-    virtual void selectAudioMediaOption(uint64_t) override;
-    virtual void selectLegibleMediaOption(uint64_t) override;
-    virtual void fullscreenModeChanged(WebCore::HTMLMediaElementEnums::VideoFullscreenMode) override;
-    virtual bool isVisible() const override;
-
-    // WebVideoFullscreenChangeObserver
-    virtual void didSetupFullscreen() override;
-    virtual void didEnterFullscreen() override;
-    virtual void didExitFullscreen() override;
-    virtual void didCleanupFullscreen() override;
-    virtual void fullscreenMayReturnToInline() override;
-
-    WebVideoFullscreenManagerProxy* m_manager;
-    uint64_t m_contextId;
-    RetainPtr&lt;UIView *&gt; m_layerHostView;
-};
-
-class WebVideoFullscreenManagerProxy : public RefCounted&lt;WebVideoFullscreenManagerProxy&gt;, private IPC::MessageReceiver {
-public:
-    static RefPtr&lt;WebVideoFullscreenManagerProxy&gt; create(WebPageProxy&amp;);
-    virtual ~WebVideoFullscreenManagerProxy();
-
-    void invalidate();
-
-    void requestHideAndExitFullscreen();
-    bool hasMode(WebCore::HTMLMediaElementEnums::VideoFullscreenMode) const;
-    bool mayAutomaticallyShowVideoPictureInPicture() const;
-    void applicationDidBecomeActive();
-    bool isVisible() const;
-
-private:
-    friend class WebVideoFullscreenModelContext;
-
-    explicit WebVideoFullscreenManagerProxy(WebPageProxy&amp;);
-    virtual void didReceiveMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;) override;
-
-    typedef std::tuple&lt;RefPtr&lt;WebVideoFullscreenModelContext&gt;, RefPtr&lt;WebCore::WebVideoFullscreenInterfaceAVKit&gt;&gt; ModelInterfaceTuple;
-    ModelInterfaceTuple createModelAndInterface(uint64_t contextId);
-    ModelInterfaceTuple&amp; ensureModelAndInterface(uint64_t contextId);
-    WebVideoFullscreenModelContext&amp; ensureModel(uint64_t contextId);
-    WebCore::WebVideoFullscreenInterfaceAVKit&amp; ensureInterface(uint64_t contextId);
-
-    // Messages from WebVideoFullscreenManager
-    void setupFullscreenWithID(uint64_t contextId, uint32_t videoLayerID, const WebCore::IntRect&amp; initialRect, float hostingScaleFactor, WebCore::HTMLMediaElementEnums::VideoFullscreenMode, bool allowsPictureInPicture);
-    void resetMediaState(uint64_t contextId);
-    void setCurrentTime(uint64_t contextId, double currentTime, double hostTime);
-    void setBufferedTime(uint64_t contextId, double bufferedTime);
-    void setVideoDimensions(uint64_t contextId, bool hasVideo, unsigned width, unsigned height);
-    void setSeekableRangesVector(uint64_t contextId, Vector&lt;std::pair&lt;double, double&gt;&gt; ranges);
-    void setCanPlayFastReverse(uint64_t contextId, bool value);
-    void setAudioMediaSelectionOptions(uint64_t contextId, Vector&lt;String&gt; options, uint64_t selectedIndex);
-    void setLegibleMediaSelectionOptions(uint64_t contextId, Vector&lt;String&gt; options, uint64_t selectedIndex);
-    void setExternalPlaybackProperties(uint64_t contextId, bool enabled, uint32_t targetType, String localizedDeviceName);
-    void setWirelessVideoPlaybackDisabled(uint64_t contextId, bool);
-    void setDuration(uint64_t contextId, double duration);
-    void setRate(uint64_t contextId, bool isPlaying, double rate);
-    void enterFullscreen(uint64_t contextId);
-    void exitFullscreen(uint64_t contextId, WebCore::IntRect finalRect);
-    void cleanupFullscreen(uint64_t contextId);
-    void preparedToReturnToInline(uint64_t contextId, bool visible, WebCore::IntRect inlineRect);
-
-    // Messages to WebVideoFullscreenManager
-    void play(uint64_t contextId);
-    void pause(uint64_t contextId);
-    void togglePlayState(uint64_t contextId);
-    void beginScrubbing(uint64_t contextId);
-    void endScrubbing(uint64_t contextId);
-    void seekToTime(uint64_t contextId, double time);
-    void fastSeek(uint64_t contextId, double time);
-    void beginScanningForward(uint64_t contextId);
-    void beginScanningBackward(uint64_t contextId);
-    void endScanning(uint64_t contextId);
-    void requestFullscreenMode(uint64_t contextId, WebCore::HTMLMediaElementEnums::VideoFullscreenMode);
-    void didSetupFullscreen(uint64_t contextId);
-    void didExitFullscreen(uint64_t contextId);
-    void didEnterFullscreen(uint64_t contextId);
-    void didCleanupFullscreen(uint64_t contextId);
-    void setVideoLayerFrame(uint64_t contextId, WebCore::FloatRect);
-    void setVideoLayerGravity(uint64_t contextId, WebCore::WebVideoFullscreenModel::VideoGravity);
-    void selectAudioMediaOption(uint64_t contextId, uint64_t index);
-    void selectLegibleMediaOption(uint64_t contextId, uint64_t index);
-    void fullscreenModeChanged(uint64_t contextId, WebCore::HTMLMediaElementEnums::VideoFullscreenMode);
-    void fullscreenMayReturnToInline(uint64_t contextId);
-
-    WebPageProxy* m_page;
-    HashMap&lt;uint64_t, ModelInterfaceTuple&gt; m_contextMap;
-
-};
-    
-} // namespace WebKit
-
-#endif // PLATFORM(IOS)
-
-#endif // WebVideoFullscreenManagerProxy_h
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxymessagesin"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in (195599 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in        2016-01-26 18:46:44 UTC (rev 195599)
+++ trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -1,43 +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.
-
-#if PLATFORM(IOS)
-messages -&gt; WebVideoFullscreenManagerProxy {
-    ResetMediaState(uint64_t contextId)
-    SetCurrentTime(uint64_t contextId, double currentTime, double hostTime)
-    SetBufferedTime(uint64_t contextId, double bufferedTime)
-    SetVideoDimensions(uint64_t contextId, bool hasVideo, unsigned width, unsigned height)
-    SetSeekableRangesVector(uint64_t contextId, Vector&lt;std::pair&lt;double, double&gt;&gt; ranges)
-    SetCanPlayFastReverse(uint64_t contextId, bool value)
-    SetAudioMediaSelectionOptions(uint64_t contextId, Vector&lt;String&gt; options, uint64_t selectedIndex)
-    SetLegibleMediaSelectionOptions(uint64_t contextId, Vector&lt;String&gt; options, uint64_t selectedIndex)
-    SetExternalPlaybackProperties(uint64_t contextId, bool enabled, uint32_t targetType, String localizedDeviceName)
-    SetWirelessVideoPlaybackDisabled(uint64_t contextId, bool disabled)
-    SetDuration(uint64_t contextId, double duration)
-    SetRate(uint64_t contextId, bool isPlaying, double rate)
-    SetupFullscreenWithID(uint64_t contextId, uint32_t videoLayerID, WebCore::IntRect initialRect, float hostingScaleFactor, WebCore::HTMLMediaElementEnums::VideoFullscreenMode videoFullscreenMode, bool allowsPictureInPicture)
-    EnterFullscreen(uint64_t contextId)
-    ExitFullscreen(uint64_t contextId, WebCore::IntRect finalRect)
-    CleanupFullscreen(uint64_t contextId)
-    PreparedToReturnToInline(uint64_t contextId, bool visible, WebCore::IntRect inlineRect)
-}
-#endif
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxymm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm (195599 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm        2016-01-26 18:46:44 UTC (rev 195599)
+++ trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -1,594 +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.
- */
-
-#import &quot;config.h&quot;
-#import &quot;WebVideoFullscreenManagerProxy.h&quot;
-
-#if PLATFORM(IOS)
-
-#import &quot;RemoteLayerTreeDrawingAreaProxy.h&quot;
-#import &quot;UIKitSPI.h&quot;
-#import &quot;WebPageProxy.h&quot;
-#import &quot;WebProcessProxy.h&quot;
-#import &quot;WebVideoFullscreenManagerMessages.h&quot;
-#import &quot;WebVideoFullscreenManagerProxyMessages.h&quot;
-#import &lt;QuartzCore/CoreAnimation.h&gt;
-#import &lt;WebCore/QuartzCoreSPI.h&gt;
-#import &lt;WebCore/TimeRanges.h&gt;
-#import &lt;WebKitSystemInterface.h&gt;
-
-@interface WKLayerHostView : UIView
-@property (nonatomic, assign) uint32_t contextID;
-@end
-
-@implementation WKLayerHostView
-
-+ (Class)layerClass {
-    return [CALayerHost class];
-}
-
-- (uint32_t)contextID {
-    return [[self layerHost] contextId];
-}
-
-- (void)setContextID:(uint32_t)contextID {
-    [[self layerHost] setContextId:contextID];
-}
-
-- (CALayerHost *)layerHost {
-    return (CALayerHost *)[self layer];
-}
-
-@end
-
-using namespace WebCore;
-
-namespace WebKit {
-
-#if !HAVE(AVKIT)
-
-RefPtr&lt;WebVideoFullscreenManagerProxy&gt; WebVideoFullscreenManagerProxy::create(WebPageProxy&amp;)
-{
-    return nullptr;
-}
-
-void WebVideoFullscreenManagerProxy::invalidate()
-{
-}
-
-bool WebVideoFullscreenManagerProxy::hasMode(HTMLMediaElementEnums::VideoFullscreenMode) const
-{
-    return false;
-}
-
-bool WebVideoFullscreenManagerProxy::mayAutomaticallyShowVideoPictureInPicture() const
-{
-    return false;
-}
-
-void WebVideoFullscreenManagerProxy::requestHideAndExitFullscreen()
-{
-
-}
-
-void WebVideoFullscreenManagerProxy::applicationDidBecomeActive()
-{
-
-}
-#else
-
-#pragma mark - WebVideoFullscreenModelContext
-
-void WebVideoFullscreenModelContext::play()
-{
-    if (m_manager)
-        m_manager-&gt;play(m_contextId);
-}
-
-void WebVideoFullscreenModelContext::pause()
-{
-    if (m_manager)
-        m_manager-&gt;pause(m_contextId);
-}
-
-void WebVideoFullscreenModelContext::togglePlayState()
-{
-    if (m_manager)
-        m_manager-&gt;togglePlayState(m_contextId);
-}
-
-void WebVideoFullscreenModelContext::beginScrubbing()
-{
-    if (m_manager)
-        m_manager-&gt;beginScrubbing(m_contextId);
-}
-
-void WebVideoFullscreenModelContext::endScrubbing()
-{
-    if (m_manager)
-        m_manager-&gt;endScrubbing(m_contextId);
-}
-
-void WebVideoFullscreenModelContext::seekToTime(double time)
-{
-    if (m_manager)
-        m_manager-&gt;seekToTime(m_contextId, time);
-}
-
-void WebVideoFullscreenModelContext::fastSeek(double time)
-{
-    if (m_manager)
-        m_manager-&gt;fastSeek(m_contextId, time);
-}
-
-void WebVideoFullscreenModelContext::beginScanningForward()
-{
-    if (m_manager)
-        m_manager-&gt;beginScanningForward(m_contextId);
-}
-
-void WebVideoFullscreenModelContext::beginScanningBackward()
-{
-    if (m_manager)
-        m_manager-&gt;beginScanningBackward(m_contextId);
-}
-
-void WebVideoFullscreenModelContext::endScanning()
-{
-    if (m_manager)
-        m_manager-&gt;endScanning(m_contextId);
-}
-
-void WebVideoFullscreenModelContext::requestFullscreenMode(HTMLMediaElementEnums::VideoFullscreenMode mode)
-{
-    if (m_manager)
-        m_manager-&gt;requestFullscreenMode(m_contextId, mode);
-}
-
-void WebVideoFullscreenModelContext::setVideoLayerFrame(WebCore::FloatRect frame)
-{
-    if (m_manager)
-        m_manager-&gt;setVideoLayerFrame(m_contextId, frame);
-}
-
-void WebVideoFullscreenModelContext::setVideoLayerGravity(WebCore::WebVideoFullscreenModel::VideoGravity gravity)
-{
-    if (m_manager)
-        m_manager-&gt;setVideoLayerGravity(m_contextId, gravity);
-}
-
-void WebVideoFullscreenModelContext::selectAudioMediaOption(uint64_t optionId)
-{
-    if (m_manager)
-        m_manager-&gt;selectAudioMediaOption(m_contextId, optionId);
-}
-
-void WebVideoFullscreenModelContext::selectLegibleMediaOption(uint64_t optionId)
-{
-    if (m_manager)
-        m_manager-&gt;selectLegibleMediaOption(m_contextId, optionId);
-}
-
-void WebVideoFullscreenModelContext::fullscreenModeChanged(WebCore::HTMLMediaElementEnums::VideoFullscreenMode mode)
-{
-    if (m_manager)
-        m_manager-&gt;fullscreenModeChanged(m_contextId, mode);
-}
-
-bool WebVideoFullscreenModelContext::isVisible() const
-{
-    return m_manager ? m_manager-&gt;isVisible() : false;
-}
-
-void WebVideoFullscreenModelContext::didSetupFullscreen()
-{
-    if (m_manager)
-        m_manager-&gt;didSetupFullscreen(m_contextId);
-}
-
-void WebVideoFullscreenModelContext::didEnterFullscreen()
-{
-    if (m_manager)
-        m_manager-&gt;didEnterFullscreen(m_contextId);
-}
-
-void WebVideoFullscreenModelContext::didExitFullscreen()
-{
-    if (m_manager)
-        m_manager-&gt;didExitFullscreen(m_contextId);
-}
-
-void WebVideoFullscreenModelContext::didCleanupFullscreen()
-{
-    if (m_manager)
-        m_manager-&gt;didCleanupFullscreen(m_contextId);
-}
-
-void WebVideoFullscreenModelContext::fullscreenMayReturnToInline()
-{
-    if (m_manager)
-        m_manager-&gt;fullscreenMayReturnToInline(m_contextId);
-}
-
-#pragma mark - WebVideoFullscreenManagerProxy
-
-RefPtr&lt;WebVideoFullscreenManagerProxy&gt; WebVideoFullscreenManagerProxy::create(WebPageProxy&amp; page)
-{
-    return adoptRef(new WebVideoFullscreenManagerProxy(page));
-}
-
-WebVideoFullscreenManagerProxy::WebVideoFullscreenManagerProxy(WebPageProxy&amp; page)
-    : m_page(&amp;page)
-{
-    m_page-&gt;process().addMessageReceiver(Messages::WebVideoFullscreenManagerProxy::messageReceiverName(), m_page-&gt;pageID(), *this);
-}
-
-WebVideoFullscreenManagerProxy::~WebVideoFullscreenManagerProxy()
-{
-    if (!m_page)
-        return;
-    invalidate();
-}
-
-void WebVideoFullscreenManagerProxy::invalidate()
-{
-    m_page-&gt;process().removeMessageReceiver(Messages::WebVideoFullscreenManagerProxy::messageReceiverName(), m_page-&gt;pageID());
-    m_page = nullptr;
-
-    for (auto&amp; tuple : m_contextMap.values()) {
-        RefPtr&lt;WebVideoFullscreenModelContext&gt; model;
-        RefPtr&lt;WebCore::WebVideoFullscreenInterfaceAVKit&gt; interface;
-        std::tie(model, interface) = tuple;
-
-        interface-&gt;invalidate();
-        [model-&gt;layerHostView() removeFromSuperview];
-        model-&gt;setLayerHostView(nullptr);
-    }
-
-    m_contextMap.clear();
-}
-
-void WebVideoFullscreenManagerProxy::requestHideAndExitFullscreen()
-{
-    for (auto&amp; tuple : m_contextMap.values())
-        std::get&lt;1&gt;(tuple)-&gt;requestHideAndExitFullscreen();
-}
-
-bool WebVideoFullscreenManagerProxy::hasMode(HTMLMediaElementEnums::VideoFullscreenMode mode) const
-{
-    for (auto&amp; tuple : m_contextMap.values()) {
-        if (std::get&lt;1&gt;(tuple)-&gt;hasMode(mode))
-            return true;
-    }
-    return false;
-}
-
-bool WebVideoFullscreenManagerProxy::mayAutomaticallyShowVideoPictureInPicture() const
-{
-    for (auto&amp; tuple : m_contextMap.values()) {
-        if (std::get&lt;1&gt;(tuple)-&gt;mayAutomaticallyShowVideoPictureInPicture())
-            return true;
-    }
-    return false;
-}
-
-void WebVideoFullscreenManagerProxy::applicationDidBecomeActive()
-{
-    for (auto&amp; tuple : m_contextMap.values())
-        std::get&lt;1&gt;(tuple)-&gt;applicationDidBecomeActive();
-}
-
-WebVideoFullscreenManagerProxy::ModelInterfaceTuple WebVideoFullscreenManagerProxy::createModelAndInterface(uint64_t contextId)
-{
-    Ref&lt;WebVideoFullscreenModelContext&gt; model = WebVideoFullscreenModelContext::create(*this, contextId);
-    Ref&lt;WebCore::WebVideoFullscreenInterfaceAVKit&gt; interface = WebVideoFullscreenInterfaceAVKit::create();
-
-    interface-&gt;setWebVideoFullscreenModel(&amp;model.get());
-    interface-&gt;setWebVideoFullscreenChangeObserver(&amp;model.get());
-
-    return std::make_tuple(WTFMove(model), WTFMove(interface));
-}
-
-WebVideoFullscreenManagerProxy::ModelInterfaceTuple&amp; WebVideoFullscreenManagerProxy::ensureModelAndInterface(uint64_t contextId)
-{
-    auto addResult = m_contextMap.add(contextId, ModelInterfaceTuple());
-    if (addResult.isNewEntry)
-        addResult.iterator-&gt;value = createModelAndInterface(contextId);
-    return addResult.iterator-&gt;value;
-}
-
-WebVideoFullscreenModelContext&amp; WebVideoFullscreenManagerProxy::ensureModel(uint64_t contextId)
-{
-    return *std::get&lt;0&gt;(ensureModelAndInterface(contextId));
-}
-
-WebCore::WebVideoFullscreenInterfaceAVKit&amp; WebVideoFullscreenManagerProxy::ensureInterface(uint64_t contextId)
-{
-    return *std::get&lt;1&gt;(ensureModelAndInterface(contextId));
-}
-
-#pragma mark Messages from WebVideoFullscreenManager
-
-void WebVideoFullscreenManagerProxy::setupFullscreenWithID(uint64_t contextId, uint32_t videoLayerID, const WebCore::IntRect&amp; initialRect, float hostingDeviceScaleFactor, HTMLMediaElementEnums::VideoFullscreenMode videoFullscreenMode, bool allowsPictureInPicture)
-{
-    ASSERT(videoLayerID);
-    RefPtr&lt;WebVideoFullscreenModelContext&gt; model;
-    RefPtr&lt;WebCore::WebVideoFullscreenInterfaceAVKit&gt; interface;
-
-    std::tie(model, interface) = ensureModelAndInterface(contextId);
-
-    RetainPtr&lt;WKLayerHostView&gt; view = static_cast&lt;WKLayerHostView*&gt;(model-&gt;layerHostView());
-    if (!view) {
-        view = adoptNS([[WKLayerHostView alloc] init]);
-        model-&gt;setLayerHostView(view);
-    }
-    [view setContextID:videoLayerID];
-    if (hostingDeviceScaleFactor != 1) {
-        // Invert the scale transform added in the WebProcess to fix &lt;rdar://problem/18316542&gt;.
-        float inverseScale = 1 / hostingDeviceScaleFactor;
-        [[view layer] setSublayerTransform:CATransform3DMakeScale(inverseScale, inverseScale, 1)];
-    }
-
-    UIView *parentView = downcast&lt;RemoteLayerTreeDrawingAreaProxy&gt;(*m_page-&gt;drawingArea()).remoteLayerTreeHost().rootLayer();
-    interface-&gt;setupFullscreen(*model-&gt;layerHostView(), initialRect, parentView, videoFullscreenMode, allowsPictureInPicture);
-}
-
-void WebVideoFullscreenManagerProxy::resetMediaState(uint64_t contextId)
-{
-    ensureInterface(contextId).resetMediaState();
-}
-
-void WebVideoFullscreenManagerProxy::setCurrentTime(uint64_t contextId, double currentTime, double hostTime)
-{
-    ensureInterface(contextId).setCurrentTime(currentTime, hostTime);
-}
-
-void WebVideoFullscreenManagerProxy::setBufferedTime(uint64_t contextId, double bufferedTime)
-{
-    ensureInterface(contextId).setBufferedTime(bufferedTime);
-}
-
-void WebVideoFullscreenManagerProxy::setVideoDimensions(uint64_t contextId, bool hasVideo, unsigned width, unsigned height)
-{
-    ensureInterface(contextId).setVideoDimensions(hasVideo, width, height);
-}
-
-void WebVideoFullscreenManagerProxy::setSeekableRangesVector(uint64_t contextId, Vector&lt;std::pair&lt;double, double&gt;&gt; ranges)
-{
-    RefPtr&lt;TimeRanges&gt; timeRanges = TimeRanges::create();
-    for (const auto&amp; range : ranges)
-    {
-        ASSERT(isfinite(range.first));
-        ASSERT(isfinite(range.second));
-        ASSERT(range.second &gt;= range.first);
-        timeRanges-&gt;add(range.first, range.second);
-    }
-
-    ensureInterface(contextId).setSeekableRanges(*timeRanges);
-}
-
-void WebVideoFullscreenManagerProxy::setCanPlayFastReverse(uint64_t contextId, bool value)
-{
-    ensureInterface(contextId).setCanPlayFastReverse(value);
-}
-
-void WebVideoFullscreenManagerProxy::setAudioMediaSelectionOptions(uint64_t contextId, Vector&lt;String&gt; options, uint64_t selectedIndex)
-{
-    ensureInterface(contextId).setAudioMediaSelectionOptions(options, selectedIndex);
-}
-
-void WebVideoFullscreenManagerProxy::setLegibleMediaSelectionOptions(uint64_t contextId, Vector&lt;String&gt; options, uint64_t selectedIndex)
-{
-    ensureInterface(contextId).setLegibleMediaSelectionOptions(options, selectedIndex);
-}
-
-void WebVideoFullscreenManagerProxy::setExternalPlaybackProperties(uint64_t contextId, bool enabled, uint32_t targetType, String localizedDeviceName)
-{
-    WebVideoFullscreenInterface::ExternalPlaybackTargetType type = static_cast&lt;WebVideoFullscreenInterface::ExternalPlaybackTargetType&gt;(targetType);
-    ASSERT(type == WebVideoFullscreenInterface::TargetTypeAirPlay || type == WebVideoFullscreenInterface::TargetTypeTVOut || type == WebVideoFullscreenInterface::TargetTypeNone);
-    
-    ensureInterface(contextId).setExternalPlayback(enabled, type, localizedDeviceName);
-}
-
-void WebVideoFullscreenManagerProxy::setWirelessVideoPlaybackDisabled(uint64_t contextId, bool disabled)
-{
-    ensureInterface(contextId).setWirelessVideoPlaybackDisabled(disabled);
-}
-
-void WebVideoFullscreenManagerProxy::setDuration(uint64_t contextId, double duration)
-{
-    ensureInterface(contextId).setDuration(duration);
-}
-
-void WebVideoFullscreenManagerProxy::setRate(uint64_t contextId, bool isPlaying, double rate)
-{
-    ensureInterface(contextId).setRate(isPlaying, rate);
-}
-
-void WebVideoFullscreenManagerProxy::enterFullscreen(uint64_t contextId)
-{
-    auto&amp; interface = ensureInterface(contextId);
-    interface.enterFullscreen();
-
-    // Only one context can be in a given full screen mode at a time:
-    for (auto&amp; contextPair : m_contextMap) {
-        auto&amp; otherContextId = contextPair.key;
-        if (contextId == otherContextId)
-            continue;
-
-        auto&amp; otherInterface = std::get&lt;1&gt;(contextPair.value);
-        if (otherInterface-&gt;hasMode(interface.mode()))
-            otherInterface-&gt;requestHideAndExitFullscreen();
-    }
-}
-
-void WebVideoFullscreenManagerProxy::exitFullscreen(uint64_t contextId, WebCore::IntRect finalRect)
-{
-    ensureInterface(contextId).exitFullscreen(finalRect);
-}
-
-void WebVideoFullscreenManagerProxy::cleanupFullscreen(uint64_t contextId)
-{
-    ensureInterface(contextId).cleanupFullscreen();
-}
-
-void WebVideoFullscreenManagerProxy::preparedToReturnToInline(uint64_t contextId, bool visible, WebCore::IntRect inlineRect)
-{
-    m_page-&gt;fullscreenMayReturnToInline();
-
-    ensureInterface(contextId).preparedToReturnToInline(visible, inlineRect);
-}
-
-#pragma mark Messages to WebVideoFullscreenManager
-
-void WebVideoFullscreenManagerProxy::play(uint64_t contextId)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManager::Play(contextId), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManagerProxy::pause(uint64_t contextId)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManager::Pause(contextId), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManagerProxy::togglePlayState(uint64_t contextId)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManager::TogglePlayState(contextId), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManagerProxy::beginScrubbing(uint64_t contextId)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManager::BeginScrubbing(contextId), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManagerProxy::endScrubbing(uint64_t contextId)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManager::EndScrubbing(contextId), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManagerProxy::seekToTime(uint64_t contextId, double time)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManager::SeekToTime(contextId, time), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManagerProxy::fastSeek(uint64_t contextId, double time)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManager::FastSeek(contextId, time), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManagerProxy::beginScanningForward(uint64_t contextId)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManager::BeginScanningForward(contextId), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManagerProxy::beginScanningBackward(uint64_t contextId)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManager::BeginScanningBackward(contextId), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManagerProxy::endScanning(uint64_t contextId)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManager::EndScanning(contextId), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManagerProxy::requestFullscreenMode(uint64_t contextId, WebCore::HTMLMediaElementEnums::VideoFullscreenMode mode)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManager::RequestFullscreenMode(contextId, mode), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManagerProxy::didSetupFullscreen(uint64_t contextId)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManager::DidSetupFullscreen(contextId), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManagerProxy::didExitFullscreen(uint64_t contextId)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManager::DidExitFullscreen(contextId), m_page-&gt;pageID());
-    m_page-&gt;didExitFullscreen();
-}
-
-void WebVideoFullscreenManagerProxy::didEnterFullscreen(uint64_t contextId)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManager::DidEnterFullscreen(contextId), m_page-&gt;pageID());
-    m_page-&gt;didEnterFullscreen();
-}
-
-void WebVideoFullscreenManagerProxy::didCleanupFullscreen(uint64_t contextId)
-{
-    auto&amp; model = ensureModel(contextId);
-
-    [CATransaction flush];
-    [model.layerHostView() removeFromSuperview];
-    model.setLayerHostView(nullptr);
-    m_page-&gt;send(Messages::WebVideoFullscreenManager::DidCleanupFullscreen(contextId), m_page-&gt;pageID());
-
-    m_contextMap.remove(contextId);
-}
-
-void WebVideoFullscreenManagerProxy::setVideoLayerFrame(uint64_t contextId, WebCore::FloatRect frame)
-{
-    @autoreleasepool {
-        mach_port_name_t fencePort = [UIWindow _synchronizeDrawingAcrossProcesses];
-
-        m_page-&gt;send(Messages::WebVideoFullscreenManager::SetVideoLayerFrameFenced(contextId, frame, IPC::Attachment(fencePort, MACH_MSG_TYPE_MOVE_SEND)), m_page-&gt;pageID());
-    }
-}
-
-void WebVideoFullscreenManagerProxy::setVideoLayerGravity(uint64_t contextId, WebCore::WebVideoFullscreenModel::VideoGravity gravity)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManager::SetVideoLayerGravityEnum(contextId, (unsigned)gravity), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManagerProxy::selectAudioMediaOption(uint64_t contextId, uint64_t index)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManager::SelectAudioMediaOption(contextId, index), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManagerProxy::selectLegibleMediaOption(uint64_t contextId, uint64_t index)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManager::SelectLegibleMediaOption(contextId, index), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManagerProxy::fullscreenModeChanged(uint64_t contextId, WebCore::HTMLMediaElementEnums::VideoFullscreenMode mode)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManager::FullscreenModeChanged(contextId, mode), m_page-&gt;pageID());
-}
-
-bool WebVideoFullscreenManagerProxy::isVisible() const
-{
-    return m_page-&gt;isViewVisible() &amp;&amp; m_page-&gt;isInWindow();
-}
-
-void WebVideoFullscreenManagerProxy::fullscreenMayReturnToInline(uint64_t contextId)
-{
-    bool isViewVisible = m_page-&gt;isViewVisible();
-    m_page-&gt;send(Messages::WebVideoFullscreenManager::FullscreenMayReturnToInline(contextId, isViewVisible), m_page-&gt;pageID());
-}
-
-#endif
-
-} // namespace WebKit
-
-#endif // PLATFORM(IOS)
</del></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (195599 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-01-26 18:46:44 UTC (rev 195599)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -854,9 +854,6 @@
</span><span class="cx">                 3F87B9BD158940120090FF62 /* WebColorChooser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3F87B9BA15893F630090FF62 /* WebColorChooser.cpp */; };
</span><span class="cx">                 3F87B9BE158940190090FF62 /* WebColorChooser.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F87B9BB15893F630090FF62 /* WebColorChooser.h */; };
</span><span class="cx">                 3F87B9C0158940D80090FF62 /* WebColorPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F87B9BF158940D80090FF62 /* WebColorPicker.h */; };
</span><del>-                3F889D14188778C900FEADAF /* WebVideoFullscreenManagerProxy.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3F889D12188778C900FEADAF /* WebVideoFullscreenManagerProxy.mm */; };
-                3F889D15188778C900FEADAF /* WebVideoFullscreenManagerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F889D13188778C900FEADAF /* WebVideoFullscreenManagerProxy.h */; };
-                3F889D171887859300FEADAF /* WebVideoFullscreenManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3F889D0D1887699C00FEADAF /* WebVideoFullscreenManager.mm */; };
</del><span class="cx">                 4A3CC18A19B063E700D14AEF /* UserMediaPermissionRequestManagerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A410F3919AF7B04002EBAB5 /* UserMediaPermissionRequestManagerProxy.cpp */; };
</span><span class="cx">                 4A3CC18B19B0640F00D14AEF /* UserMediaPermissionRequestManagerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A410F3A19AF7B04002EBAB5 /* UserMediaPermissionRequestManagerProxy.h */; };
</span><span class="cx">                 4A3CC18C19B0641500D14AEF /* UserMediaPermissionRequestProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A410F3B19AF7B04002EBAB5 /* UserMediaPermissionRequestProxy.cpp */; };
</span><span class="lines">@@ -1049,6 +1046,9 @@
</span><span class="cx">                 5272B28A1406985D0096A5D0 /* StatisticsData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5272B2881406985D0096A5D0 /* StatisticsData.cpp */; };
</span><span class="cx">                 5272B28B1406985D0096A5D0 /* StatisticsData.h in Headers */ = {isa = PBXBuildFile; fileRef = 5272B2891406985D0096A5D0 /* StatisticsData.h */; };
</span><span class="cx">                 528C37C1195CBB1A00D8B9CC /* WKBackForwardListPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9F28101958F478008CAC72 /* WKBackForwardListPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                52D5A1B01C57495A00DE34A3 /* WebVideoFullscreenManagerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 52D5A1AA1C57494E00DE34A3 /* WebVideoFullscreenManagerProxy.h */; };
+                52D5A1B11C57496200DE34A3 /* WebVideoFullscreenManagerProxy.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52D5A1AC1C57494E00DE34A3 /* WebVideoFullscreenManagerProxy.mm */; };
+                52D5A1B71C574A0200DE34A3 /* WebVideoFullscreenManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52D5A1B41C5749F200DE34A3 /* WebVideoFullscreenManager.mm */; };
</ins><span class="cx">                 5C1426EC1C23F80900D41183 /* NetworkProcessCreationParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C1426E21C23F80500D41183 /* NetworkProcessCreationParameters.cpp */; };
</span><span class="cx">                 5C1426ED1C23F80900D41183 /* NetworkProcessCreationParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C1426E31C23F80500D41183 /* NetworkProcessCreationParameters.h */; };
</span><span class="cx">                 5C1426EE1C23F80900D41183 /* NetworkProcessSupplement.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C1426E41C23F80500D41183 /* NetworkProcessSupplement.h */; };
</span><span class="lines">@@ -3010,12 +3010,6 @@
</span><span class="cx">                 3F87B9BA15893F630090FF62 /* WebColorChooser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebColorChooser.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 3F87B9BB15893F630090FF62 /* WebColorChooser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebColorChooser.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 3F87B9BF158940D80090FF62 /* WebColorPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebColorPicker.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                3F889D0D1887699C00FEADAF /* WebVideoFullscreenManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebVideoFullscreenManager.mm; path = ios/WebVideoFullscreenManager.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
-                3F889D0E1887699C00FEADAF /* WebVideoFullscreenManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebVideoFullscreenManager.h; path = ios/WebVideoFullscreenManager.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                3F889D101887710000FEADAF /* WebVideoFullscreenManager.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WebVideoFullscreenManager.messages.in; path = ios/WebVideoFullscreenManager.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
-                3F889D12188778C900FEADAF /* WebVideoFullscreenManagerProxy.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebVideoFullscreenManagerProxy.mm; path = ios/WebVideoFullscreenManagerProxy.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
-                3F889D13188778C900FEADAF /* WebVideoFullscreenManagerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebVideoFullscreenManagerProxy.h; path = ios/WebVideoFullscreenManagerProxy.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                3F889D1618877A2400FEADAF /* WebVideoFullscreenManagerProxy.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; name = WebVideoFullscreenManagerProxy.messages.in; path = ios/WebVideoFullscreenManagerProxy.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 4A410F3519AF7AC3002EBAB5 /* WKUserMediaPermissionRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKUserMediaPermissionRequest.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 4A410F3619AF7AC3002EBAB5 /* WKUserMediaPermissionRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKUserMediaPermissionRequest.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 4A410F3919AF7B04002EBAB5 /* UserMediaPermissionRequestManagerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserMediaPermissionRequestManagerProxy.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -3234,6 +3228,12 @@
</span><span class="cx">                 51FD18B41651FBAD00DBE1CE /* NetworkResourceLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkResourceLoader.h; path = NetworkProcess/NetworkResourceLoader.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5272B2881406985D0096A5D0 /* StatisticsData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StatisticsData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5272B2891406985D0096A5D0 /* StatisticsData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatisticsData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                52D5A1AA1C57494E00DE34A3 /* WebVideoFullscreenManagerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenManagerProxy.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                52D5A1AB1C57494E00DE34A3 /* WebVideoFullscreenManagerProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebVideoFullscreenManagerProxy.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
+                52D5A1AC1C57494E00DE34A3 /* WebVideoFullscreenManagerProxy.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebVideoFullscreenManagerProxy.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                52D5A1B21C5749F200DE34A3 /* WebVideoFullscreenManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenManager.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                52D5A1B31C5749F200DE34A3 /* WebVideoFullscreenManager.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebVideoFullscreenManager.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
+                52D5A1B41C5749F200DE34A3 /* WebVideoFullscreenManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebVideoFullscreenManager.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 5C1426E21C23F80500D41183 /* NetworkProcessCreationParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkProcessCreationParameters.cpp; path = NetworkProcess/NetworkProcessCreationParameters.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5C1426E31C23F80500D41183 /* NetworkProcessCreationParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkProcessCreationParameters.h; path = NetworkProcess/NetworkProcessCreationParameters.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5C1426E41C23F80500D41183 /* NetworkProcessSupplement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkProcessSupplement.h; path = NetworkProcess/NetworkProcessSupplement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4937,6 +4937,9 @@
</span><span class="cx">                                 7C4694CB1A4B510A00AD5845 /* WebPasteboardProxyCocoa.mm */,
</span><span class="cx">                                 7CE4D2151A49148400C7F152 /* WebProcessPoolCocoa.mm */,
</span><span class="cx">                                 1A04F6171A4A3A7A00A21B6E /* WebProcessProxyCocoa.mm */,
</span><ins>+                                52D5A1AA1C57494E00DE34A3 /* WebVideoFullscreenManagerProxy.h */,
+                                52D5A1AB1C57494E00DE34A3 /* WebVideoFullscreenManagerProxy.messages.in */,
+                                52D5A1AC1C57494E00DE34A3 /* WebVideoFullscreenManagerProxy.mm */,
</ins><span class="cx">                                 2DFC7DB91BCCC19500C1548C /* WebViewImpl.h */,
</span><span class="cx">                                 2DFC7DBA1BCCC19500C1548C /* WebViewImpl.mm */,
</span><span class="cx">                                 1AD01BCB1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.h */,
</span><span class="lines">@@ -5132,9 +5135,6 @@
</span><span class="cx">                                 2D3EF4401917646300034184 /* WebMemoryPressureHandlerIOS.mm */,
</span><span class="cx">                                 2DA944AB1884E9BA00ED86DB /* WebPageProxyIOS.mm */,
</span><span class="cx">                                 2DA944AC1884E9BA00ED86DB /* WebProcessProxyIOS.mm */,
</span><del>-                                3F889D13188778C900FEADAF /* WebVideoFullscreenManagerProxy.h */,
-                                3F889D1618877A2400FEADAF /* WebVideoFullscreenManagerProxy.messages.in */,
-                                3F889D12188778C900FEADAF /* WebVideoFullscreenManagerProxy.mm */,
</del><span class="cx">                                 0FCB4E3818BBE044000FCFC9 /* WKActionSheet.h */,
</span><span class="cx">                                 0FCB4E3918BBE044000FCFC9 /* WKActionSheet.mm */,
</span><span class="cx">                                 0FCB4E3A18BBE044000FCFC9 /* WKActionSheetAssistant.h */,
</span><span class="lines">@@ -5164,16 +5164,6 @@
</span><span class="cx">                         name = ios;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><del>-                2DA944B11884E9DF00ED86DB /* ios */ = {
-                        isa = PBXGroup;
-                        children = (
-                                3F889D0E1887699C00FEADAF /* WebVideoFullscreenManager.h */,
-                                3F889D101887710000FEADAF /* WebVideoFullscreenManager.messages.in */,
-                                3F889D0D1887699C00FEADAF /* WebVideoFullscreenManager.mm */,
-                        );
-                        name = ios;
-                        sourceTree = &quot;&lt;group&gt;&quot;;
-                };
</del><span class="cx">                 2DA944B41884EA2A00ED86DB /* ios */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -5902,6 +5892,9 @@
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="cx">                                 7C6E70F918B2D4A000F24E2E /* WebProcessCocoa.mm */,
</span><ins>+                                52D5A1B21C5749F200DE34A3 /* WebVideoFullscreenManager.h */,
+                                52D5A1B31C5749F200DE34A3 /* WebVideoFullscreenManager.messages.in */,
+                                52D5A1B41C5749F200DE34A3 /* WebVideoFullscreenManager.mm */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = cocoa;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -6004,7 +5997,6 @@
</span><span class="cx">                                 BC0E5FCB12D696DD0012A72A /* Geolocation */,
</span><span class="cx">                                 51FBB9C1132E079200F327B4 /* IconDatabase */,
</span><span class="cx">                                 BC204EDF11C83E72008F3375 /* InjectedBundle */,
</span><del>-                                2DA944B11884E9DF00ED86DB /* ios */,
</del><span class="cx">                                 33D3A3BD1339609800709BE4 /* MediaCache */,
</span><span class="cx">                                 4A410F4119AF7B27002EBAB5 /* MediaStream */,
</span><span class="cx">                                 5105B0D2162F7A5E00E27709 /* Network */,
</span><span class="lines">@@ -8145,7 +8137,7 @@
</span><span class="cx">                                 1AAF08A2192681D100B6390C /* WebUserContentControllerProxy.h in Headers */,
</span><span class="cx">                                 7C361D79192803BD0036A59D /* WebUserContentControllerProxyMessages.h in Headers */,
</span><span class="cx">                                 15739BBD1B42042D00D258C1 /* WebUserMediaClient.h in Headers */,
</span><del>-                                3F889D15188778C900FEADAF /* WebVideoFullscreenManagerProxy.h in Headers */,
</del><ins>+                                52D5A1B01C57495A00DE34A3 /* WebVideoFullscreenManagerProxy.h in Headers */,
</ins><span class="cx">                                 2DFC7DBB1BCCC19500C1548C /* WebViewImpl.h in Headers */,
</span><span class="cx">                                 29CD55AA128E294F00133C85 /* WKAccessibilityWebPageObjectBase.h in Headers */,
</span><span class="cx">                                 29232DF418B29D6800D0596F /* WKAccessibilityWebPageObjectMac.h in Headers */,
</span><span class="lines">@@ -9932,9 +9924,9 @@
</span><span class="cx">                                 1AAF08A1192681D100B6390C /* WebUserContentControllerProxy.cpp in Sources */,
</span><span class="cx">                                 7C361D78192803BD0036A59D /* WebUserContentControllerProxyMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 15739BBE1B42046600D258C1 /* WebUserMediaClient.cpp in Sources */,
</span><del>-                                3F889D171887859300FEADAF /* WebVideoFullscreenManager.mm in Sources */,
</del><ins>+                                52D5A1B71C574A0200DE34A3 /* WebVideoFullscreenManager.mm in Sources */,
+                                52D5A1B11C57496200DE34A3 /* WebVideoFullscreenManagerProxy.mm in Sources */,
</ins><span class="cx">                                 3F418EF91887BD97002795FD /* WebVideoFullscreenManagerMessageReceiver.cpp in Sources */,
</span><del>-                                3F889D14188778C900FEADAF /* WebVideoFullscreenManagerProxy.mm in Sources */,
</del><span class="cx">                                 3F418EFB1887BD97002795FD /* WebVideoFullscreenManagerProxyMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 2DFC7DBC1BCCC19500C1548C /* WebViewImpl.mm in Sources */,
</span><span class="cx">                                 C0337DD1127A2980008FF4F4 /* WebWheelEvent.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcesscocoaWebVideoFullscreenManagerhfromrev195599trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagerh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.h (from rev 195599, trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h) (0 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.h                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.h        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -0,0 +1,177 @@
</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.
+ */
+#ifndef WebVideoFullscreenManager_h
+#define WebVideoFullscreenManager_h
+
+#if PLATFORM(IOS)
+
+#include &quot;MessageReceiver.h&quot;
+#include &lt;WebCore/EventListener.h&gt;
+#include &lt;WebCore/HTMLMediaElementEnums.h&gt;
+#include &lt;WebCore/PlatformCALayer.h&gt;
+#include &lt;WebCore/WebVideoFullscreenInterface.h&gt;
+#include &lt;WebCore/WebVideoFullscreenModelVideoElement.h&gt;
+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+
+namespace IPC {
+class Attachment;
+class Connection;
+class MessageDecoder;
+class MessageReceiver;
+}
+
+namespace WebCore {
+class Node;
+}
+
+namespace WebKit {
+
+class LayerHostingContext;
+class WebPage;
+class WebVideoFullscreenManager;
+
+class WebVideoFullscreenInterfaceContext : public RefCounted&lt;WebVideoFullscreenInterfaceContext&gt;, public WebCore::WebVideoFullscreenInterface {
+public:
+    static Ref&lt;WebVideoFullscreenInterfaceContext&gt; create(WebVideoFullscreenManager&amp; manager, uint64_t contextId)
+    {
+        return adoptRef(*new WebVideoFullscreenInterfaceContext(manager, contextId));
+    }
+    virtual ~WebVideoFullscreenInterfaceContext();
+
+    void invalidate() { m_manager = nullptr; }
+
+    LayerHostingContext* layerHostingContext() { return m_layerHostingContext.get(); }
+    void setLayerHostingContext(std::unique_ptr&lt;LayerHostingContext&gt;&amp;&amp;);
+
+    bool isAnimating() const { return m_isAnimating; }
+    void setIsAnimating(bool flag) { m_isAnimating = flag; }
+
+    bool targetIsFullscreen() const { return m_targetIsFullscreen; }
+    void setTargetIsFullscreen(bool flag) { m_targetIsFullscreen = flag; }
+
+    WebCore::HTMLMediaElementEnums::VideoFullscreenMode fullscreenMode() const { return m_fullscreenMode; }
+    void setFullscreenMode(WebCore::HTMLMediaElementEnums::VideoFullscreenMode mode) { m_fullscreenMode = mode; }
+
+    bool isFullscreen() const { return m_isFullscreen; }
+    void setIsFullscreen(bool flag) { m_isFullscreen = flag; }
+
+private:
+    // WebVideoFullscreenInterface
+    virtual void resetMediaState() override;
+    virtual void setDuration(double) override;
+    virtual void setCurrentTime(double currentTime, double anchorTime) override;
+    virtual void setBufferedTime(double) override;
+    virtual void setRate(bool isPlaying, float playbackRate) override;
+    virtual void setVideoDimensions(bool hasVideo, float width, float height) override;
+    virtual void setSeekableRanges(const WebCore::TimeRanges&amp;) override;
+    virtual void setCanPlayFastReverse(bool value) override;
+    virtual void setAudioMediaSelectionOptions(const Vector&lt;WTF::String&gt;&amp; options, uint64_t selectedIndex) override;
+    virtual void setLegibleMediaSelectionOptions(const Vector&lt;WTF::String&gt;&amp; options, uint64_t selectedIndex) override;
+    virtual void setExternalPlayback(bool enabled, ExternalPlaybackTargetType, WTF::String localizedDeviceName) override;
+    virtual void setWirelessVideoPlaybackDisabled(bool) override;
+
+    WebVideoFullscreenInterfaceContext(WebVideoFullscreenManager&amp;, uint64_t contextId);
+
+    WebVideoFullscreenManager* m_manager;
+    uint64_t m_contextId;
+    std::unique_ptr&lt;LayerHostingContext&gt; m_layerHostingContext;
+    bool m_isAnimating { false };
+    bool m_targetIsFullscreen { false };
+    WebCore::HTMLMediaElementEnums::VideoFullscreenMode m_fullscreenMode { WebCore::HTMLMediaElementEnums::VideoFullscreenModeNone };
+    bool m_isFullscreen { false };
+};
+
+class WebVideoFullscreenManager : public RefCounted&lt;WebVideoFullscreenManager&gt;, private IPC::MessageReceiver {
+public:
+    static Ref&lt;WebVideoFullscreenManager&gt; create(PassRefPtr&lt;WebPage&gt;);
+    virtual ~WebVideoFullscreenManager();
+    
+    void didReceiveMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;) override;
+
+    // Interface to ChromeClient
+    bool supportsVideoFullscreen() const;
+    void enterVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&amp;, WebCore::HTMLMediaElementEnums::VideoFullscreenMode);
+    void exitVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&amp;);
+    
+protected:
+    friend class WebVideoFullscreenInterfaceContext;
+
+    explicit WebVideoFullscreenManager(PassRefPtr&lt;WebPage&gt;);
+
+    typedef std::tuple&lt;RefPtr&lt;WebCore::WebVideoFullscreenModelVideoElement&gt;, RefPtr&lt;WebVideoFullscreenInterfaceContext&gt;&gt; ModelInterfaceTuple;
+    ModelInterfaceTuple createModelAndInterface(uint64_t contextId);
+    ModelInterfaceTuple&amp; ensureModelAndInterface(uint64_t contextId);
+    WebCore::WebVideoFullscreenModelVideoElement&amp; ensureModel(uint64_t contextId);
+    WebVideoFullscreenInterfaceContext&amp; ensureInterface(uint64_t contextId);
+
+    // Interface to WebVideoFullscreenInterfaceContext
+    void resetMediaState(uint64_t contextId);
+    void setDuration(uint64_t contextId, double);
+    void setCurrentTime(uint64_t contextId, double currentTime, double anchorTime);
+    void setBufferedTime(uint64_t contextId, double bufferedTime);
+    void setRate(uint64_t contextId, bool isPlaying, float playbackRate);
+    void setVideoDimensions(uint64_t contextId, bool hasVideo, float width, float height);
+    void setSeekableRanges(uint64_t contextId, const WebCore::TimeRanges&amp;);
+    void setCanPlayFastReverse(uint64_t contextId, bool value);
+    void setAudioMediaSelectionOptions(uint64_t contextId, const Vector&lt;String&gt;&amp; options, uint64_t selectedIndex);
+    void setLegibleMediaSelectionOptions(uint64_t contextId, const Vector&lt;String&gt;&amp; options, uint64_t selectedIndex);
+    void setExternalPlayback(uint64_t contextId, bool enabled, WebCore::WebVideoFullscreenInterface::ExternalPlaybackTargetType, String localizedDeviceName);
+    void setWirelessVideoPlaybackDisabled(uint64_t contextId, bool);
+
+    // Messages from WebVideoFullscreenManagerProxy
+    void play(uint64_t contextId);
+    void pause(uint64_t contextId);
+    void togglePlayState(uint64_t contextId);
+    void beginScrubbing(uint64_t contextId);
+    void endScrubbing(uint64_t contextId);
+    void seekToTime(uint64_t contextId, double time);
+    void fastSeek(uint64_t contextId, double time);
+    void beginScanningForward(uint64_t contextId);
+    void beginScanningBackward(uint64_t contextId);
+    void endScanning(uint64_t contextId);
+    void requestFullscreenMode(uint64_t contextId, WebCore::HTMLMediaElementEnums::VideoFullscreenMode);
+    void didSetupFullscreen(uint64_t contextId);
+    void didExitFullscreen(uint64_t contextId);
+    void didEnterFullscreen(uint64_t contextId);
+    void didCleanupFullscreen(uint64_t contextId);
+    void setVideoLayerFrameFenced(uint64_t contextId, WebCore::FloatRect bounds, IPC::Attachment fencePort);
+    void setVideoLayerGravityEnum(uint64_t contextId, unsigned gravity);
+    void selectAudioMediaOption(uint64_t contextId, uint64_t index);
+    void selectLegibleMediaOption(uint64_t contextId, uint64_t index);
+    void fullscreenModeChanged(uint64_t contextId, WebCore::HTMLMediaElementEnums::VideoFullscreenMode);
+    void fullscreenMayReturnToInline(uint64_t contextId, bool isPageVisible);
+    
+    WebPage* m_page;
+    HashMap&lt;WebCore::HTMLVideoElement*, uint64_t&gt; m_videoElements;
+    HashMap&lt;uint64_t, ModelInterfaceTuple&gt; m_contextMap;
+};
+    
+} // namespace WebKit
+
+#endif // PLATFORM(IOS)
+
+#endif // WebVideoFullscreenManager_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcesscocoaWebVideoFullscreenManagermessagesinfromrev195599trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagermessagesin"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.messages.in (from rev 195599, trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.messages.in) (0 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.messages.in                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.messages.in        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -0,0 +1,47 @@
</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.
+
+#if PLATFORM(IOS)
+messages -&gt; WebVideoFullscreenManager {
+    Play(uint64_t contextId)
+    Pause(uint64_t contextId)
+    TogglePlayState(uint64_t contextId)
+    BeginScrubbing(uint64_t contextId)
+    EndScrubbing(uint64_t contextId)
+    SeekToTime(uint64_t contextId, double time)
+    FastSeek(uint64_t contextId, double time)
+    BeginScanningForward(uint64_t contextId)
+    BeginScanningBackward(uint64_t contextId)
+    EndScanning(uint64_t contextId)
+    RequestFullscreenMode(uint64_t contextId, WebCore::HTMLMediaElementEnums::VideoFullscreenMode videoFullscreenMode)
+    DidSetupFullscreen(uint64_t contextId)
+    DidExitFullscreen(uint64_t contextId)
+    DidEnterFullscreen(uint64_t contextId)
+    DidCleanupFullscreen(uint64_t contextId)
+    SetVideoLayerFrameFenced(uint64_t contextId, WebCore::FloatRect bounds, IPC::Attachment fencePort)
+    SetVideoLayerGravityEnum(uint64_t contextId, unsigned gravity)
+    SelectAudioMediaOption(uint64_t contextId, uint64_t index)
+    SelectLegibleMediaOption(uint64_t contextId, uint64_t index)
+    FullscreenModeChanged(uint64_t contextId, WebCore::HTMLMediaElementEnums::VideoFullscreenMode videoFullscreenMode)
+    FullscreenMayReturnToInline(uint64_t contextId, bool isPageVisible)
+}
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcesscocoaWebVideoFullscreenManagermmfromrev195599trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagermm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm (from rev 195599, trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm) (0 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -0,0 +1,561 @@
</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.
+ */
+#import &quot;config.h&quot;
+#import &quot;WebVideoFullscreenManager.h&quot;
+
+#if PLATFORM(IOS)
+
+#import &quot;Attachment.h&quot;
+#import &quot;WebCoreArgumentCoders.h&quot;
+#import &quot;WebPage.h&quot;
+#import &quot;WebProcess.h&quot;
+#import &quot;WebVideoFullscreenManagerMessages.h&quot;
+#import &quot;WebVideoFullscreenManagerProxyMessages.h&quot;
+#import &lt;QuartzCore/CoreAnimation.h&gt;
+#import &lt;WebCore/Color.h&gt;
+#import &lt;WebCore/Event.h&gt;
+#import &lt;WebCore/EventNames.h&gt;
+#import &lt;WebCore/FrameView.h&gt;
+#import &lt;WebCore/HTMLVideoElement.h&gt;
+#import &lt;WebCore/PlatformCALayer.h&gt;
+#import &lt;WebCore/RenderLayer.h&gt;
+#import &lt;WebCore/RenderLayerBacking.h&gt;
+#import &lt;WebCore/RenderView.h&gt;
+#import &lt;WebCore/Settings.h&gt;
+#import &lt;WebCore/TimeRanges.h&gt;
+#import &lt;WebCore/WebCoreThreadRun.h&gt;
+#import &lt;mach/mach_port.h&gt;
+
+using namespace WebCore;
+
+namespace WebKit {
+
+static IntRect clientRectForElement(HTMLElement* element)
+{
+    if (!element)
+        return IntRect();
+
+    return element-&gt;clientRect();
+}
+
+static uint64_t nextContextId()
+{
+    static uint64_t contextId = 0;
+    return ++contextId;
+}
+
+#pragma mark - WebVideoFullscreenInterfaceContext
+
+WebVideoFullscreenInterfaceContext::WebVideoFullscreenInterfaceContext(WebVideoFullscreenManager&amp; manager, uint64_t contextId)
+    : m_manager(&amp;manager)
+    , m_contextId(contextId)
+{
+}
+
+WebVideoFullscreenInterfaceContext::~WebVideoFullscreenInterfaceContext()
+{
+}
+
+void WebVideoFullscreenInterfaceContext::setLayerHostingContext(std::unique_ptr&lt;LayerHostingContext&gt;&amp;&amp; context)
+{
+    m_layerHostingContext = WTFMove(context);
+}
+
+void WebVideoFullscreenInterfaceContext::resetMediaState()
+{
+    if (m_manager)
+        m_manager-&gt;resetMediaState(m_contextId);
+}
+
+void WebVideoFullscreenInterfaceContext::setDuration(double duration)
+{
+    if (m_manager)
+        m_manager-&gt;setDuration(m_contextId, duration);
+}
+
+void WebVideoFullscreenInterfaceContext::setCurrentTime(double currentTime, double anchorTime)
+{
+    if (m_manager)
+        m_manager-&gt;setCurrentTime(m_contextId, currentTime, anchorTime);
+}
+
+void WebVideoFullscreenInterfaceContext::setBufferedTime(double bufferedTime)
+{
+    if (m_manager)
+        m_manager-&gt;setBufferedTime(m_contextId, bufferedTime);
+}
+
+void WebVideoFullscreenInterfaceContext::setRate(bool isPlaying, float playbackRate)
+{
+    if (m_manager)
+        m_manager-&gt;setRate(m_contextId, isPlaying, playbackRate);
+}
+
+void WebVideoFullscreenInterfaceContext::setVideoDimensions(bool hasVideo, float width, float height)
+{
+    if (m_manager)
+        m_manager-&gt;setVideoDimensions(m_contextId, hasVideo, width, height);
+}
+
+void WebVideoFullscreenInterfaceContext::setSeekableRanges(const WebCore::TimeRanges&amp; ranges)
+{
+    if (m_manager)
+        m_manager-&gt;setSeekableRanges(m_contextId, ranges);
+}
+
+void WebVideoFullscreenInterfaceContext::setCanPlayFastReverse(bool value)
+{
+    if (m_manager)
+        m_manager-&gt;setCanPlayFastReverse(m_contextId, value);
+}
+
+void WebVideoFullscreenInterfaceContext::setAudioMediaSelectionOptions(const Vector&lt;WTF::String&gt;&amp; options, uint64_t selectedIndex)
+{
+    if (m_manager)
+        m_manager-&gt;setAudioMediaSelectionOptions(m_contextId, options, selectedIndex);
+}
+
+void WebVideoFullscreenInterfaceContext::setLegibleMediaSelectionOptions(const Vector&lt;WTF::String&gt;&amp; options, uint64_t selectedIndex)
+{
+    if (m_manager)
+        m_manager-&gt;setLegibleMediaSelectionOptions(m_contextId, options, selectedIndex);
+}
+
+void WebVideoFullscreenInterfaceContext::setExternalPlayback(bool enabled, ExternalPlaybackTargetType type, WTF::String localizedDeviceName)
+{
+    if (m_manager)
+        m_manager-&gt;setExternalPlayback(m_contextId, enabled, type, localizedDeviceName);
+}
+
+void WebVideoFullscreenInterfaceContext::setWirelessVideoPlaybackDisabled(bool disabled)
+{
+    if (m_manager)
+        m_manager-&gt;setWirelessVideoPlaybackDisabled(m_contextId, disabled);
+}
+
+#pragma mark - WebVideoFullscreenManager
+
+Ref&lt;WebVideoFullscreenManager&gt; WebVideoFullscreenManager::create(PassRefPtr&lt;WebPage&gt; page)
+{
+    return adoptRef(*new WebVideoFullscreenManager(page));
+}
+
+WebVideoFullscreenManager::WebVideoFullscreenManager(PassRefPtr&lt;WebPage&gt; page)
+    : m_page(page.get())
+{
+    WebProcess::singleton().addMessageReceiver(Messages::WebVideoFullscreenManager::messageReceiverName(), page-&gt;pageID(), *this);
+}
+
+WebVideoFullscreenManager::~WebVideoFullscreenManager()
+{
+    for (auto&amp; tuple : m_contextMap.values()) {
+        RefPtr&lt;WebVideoFullscreenModelVideoElement&gt; model;
+        RefPtr&lt;WebVideoFullscreenInterfaceContext&gt; interface;
+        std::tie(model, interface) = tuple;
+
+        model-&gt;setWebVideoFullscreenInterface(nullptr);
+        model-&gt;setVideoElement(nullptr);
+
+        interface-&gt;invalidate();
+    }
+
+    m_contextMap.clear();
+    m_videoElements.clear();
+
+    WebProcess::singleton().removeMessageReceiver(Messages::WebVideoFullscreenManager::messageReceiverName(), m_page-&gt;pageID());
+}
+
+WebVideoFullscreenManager::ModelInterfaceTuple WebVideoFullscreenManager::createModelAndInterface(uint64_t contextId)
+{
+    RefPtr&lt;WebVideoFullscreenModelVideoElement&gt; model = WebVideoFullscreenModelVideoElement::create();
+    RefPtr&lt;WebVideoFullscreenInterfaceContext&gt; interface = WebVideoFullscreenInterfaceContext::create(*this, contextId);
+
+    interface-&gt;setLayerHostingContext(LayerHostingContext::createForExternalHostingProcess());
+    model-&gt;setWebVideoFullscreenInterface(interface.get());
+
+    return std::make_tuple(WTFMove(model), WTFMove(interface));
+}
+
+WebVideoFullscreenManager::ModelInterfaceTuple&amp; WebVideoFullscreenManager::ensureModelAndInterface(uint64_t contextId)
+{
+    auto addResult = m_contextMap.add(contextId, ModelInterfaceTuple());
+    if (addResult.isNewEntry)
+        addResult.iterator-&gt;value = createModelAndInterface(contextId);
+    return addResult.iterator-&gt;value;
+}
+
+WebCore::WebVideoFullscreenModelVideoElement&amp; WebVideoFullscreenManager::ensureModel(uint64_t contextId)
+{
+    return *std::get&lt;0&gt;(ensureModelAndInterface(contextId));
+}
+
+WebVideoFullscreenInterfaceContext&amp; WebVideoFullscreenManager::ensureInterface(uint64_t contextId)
+{
+    return *std::get&lt;1&gt;(ensureModelAndInterface(contextId));
+}
+
+#pragma mark Interface to ChromeClient:
+
+bool WebVideoFullscreenManager::supportsVideoFullscreen() const
+{
+    return Settings::avKitEnabled();
+}
+
+void WebVideoFullscreenManager::enterVideoFullscreenForVideoElement(HTMLVideoElement&amp; videoElement, HTMLMediaElementEnums::VideoFullscreenMode mode)
+{
+    ASSERT(mode != HTMLMediaElementEnums::VideoFullscreenModeNone);
+
+    uint64_t contextId;
+
+    auto addResult = m_videoElements.add(&amp;videoElement, 0);
+    if (addResult.isNewEntry)
+        addResult.iterator-&gt;value = nextContextId();
+    contextId = addResult.iterator-&gt;value;
+
+    RefPtr&lt;WebVideoFullscreenModelVideoElement&gt; model;
+    RefPtr&lt;WebVideoFullscreenInterfaceContext&gt; interface;
+    std::tie(model, interface) = ensureModelAndInterface(contextId);
+
+    FloatRect clientRect = clientRectForElement(&amp;videoElement);
+    FloatRect videoLayerFrame = FloatRect(0, 0, clientRect.width(), clientRect.height());
+
+    HTMLMediaElementEnums::VideoFullscreenMode oldMode = interface-&gt;fullscreenMode();
+    interface-&gt;setTargetIsFullscreen(true);
+    interface-&gt;setFullscreenMode(mode);
+    model-&gt;setVideoElement(&amp;videoElement);
+    if (oldMode == HTMLMediaElementEnums::VideoFullscreenModeNone)
+        model-&gt;setVideoLayerFrame(videoLayerFrame);
+
+    if (interface-&gt;isAnimating())
+        return;
+    interface-&gt;setIsAnimating(true);
+
+    bool allowsPictureInPicture = videoElement.mediaSession().allowsPictureInPicture(videoElement);
+    
+    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetupFullscreenWithID(contextId, interface-&gt;layerHostingContext()-&gt;contextID(), clientRectForElement(&amp;videoElement), m_page-&gt;deviceScaleFactor(), interface-&gt;fullscreenMode(), allowsPictureInPicture), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManager::exitVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&amp; videoElement)
+{
+    ASSERT(m_videoElements.contains(&amp;videoElement));
+
+    uint64_t contextId = m_videoElements.get(&amp;videoElement);
+    auto&amp; interface = ensureInterface(contextId);
+
+    interface.setTargetIsFullscreen(false);
+
+    if (interface.isAnimating())
+        return;
+
+    interface.setIsAnimating(true);
+    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::ExitFullscreen(contextId, clientRectForElement(&amp;videoElement)), m_page-&gt;pageID());
+}
+
+#pragma mark Interface to WebVideoFullscreenInterfaceContext:
+
+void WebVideoFullscreenManager::resetMediaState(uint64_t contextId)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::ResetMediaState(contextId), m_page-&gt;pageID());
+}
+    
+void WebVideoFullscreenManager::setDuration(uint64_t contextId, double duration)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetDuration(contextId, duration), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManager::setCurrentTime(uint64_t contextId, double currentTime, double anchorTime)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetCurrentTime(contextId, currentTime, anchorTime), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManager::setBufferedTime(uint64_t contextId, double bufferedTime)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetBufferedTime(contextId, bufferedTime), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManager::setRate(uint64_t contextId, bool isPlaying, float playbackRate)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetRate(contextId, isPlaying, playbackRate), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManager::setVideoDimensions(uint64_t contextId, bool hasVideo, float width, float height)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetVideoDimensions(contextId, hasVideo, width, height), m_page-&gt;pageID());
+}
+    
+void WebVideoFullscreenManager::setSeekableRanges(uint64_t contextId, const WebCore::TimeRanges&amp; timeRanges)
+{
+    Vector&lt;std::pair&lt;double, double&gt;&gt; rangesVector;
+    
+    for (unsigned i = 0; i &lt; timeRanges.length(); i++) {
+        ExceptionCode exceptionCode;
+        double start = timeRanges.start(i, exceptionCode);
+        double end = timeRanges.end(i, exceptionCode);
+        rangesVector.append(std::pair&lt;double, double&gt;(start, end));
+    }
+
+    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetSeekableRangesVector(contextId, WTFMove(rangesVector)), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManager::setCanPlayFastReverse(uint64_t contextId, bool value)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetCanPlayFastReverse(contextId, value), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManager::setAudioMediaSelectionOptions(uint64_t contextId, const Vector&lt;String&gt;&amp; options, uint64_t selectedIndex)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetAudioMediaSelectionOptions(contextId, options, selectedIndex), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManager::setLegibleMediaSelectionOptions(uint64_t contextId, const Vector&lt;String&gt;&amp; options, uint64_t selectedIndex)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetLegibleMediaSelectionOptions(contextId, options, selectedIndex), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManager::setExternalPlayback(uint64_t contextId, bool enabled, WebVideoFullscreenInterface::ExternalPlaybackTargetType targetType, String localizedDeviceName)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetExternalPlaybackProperties(contextId, enabled, static_cast&lt;uint32_t&gt;(targetType), localizedDeviceName), m_page-&gt;pageID());
+}
+
+void WebVideoFullscreenManager::setWirelessVideoPlaybackDisabled(uint64_t contextId, bool disabled)
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetWirelessVideoPlaybackDisabled(contextId, disabled));
+}
+
+#pragma mark Messages from WebVideoFullscreenManagerProxy:
+
+void WebVideoFullscreenManager::play(uint64_t contextId)
+{
+    ensureModel(contextId).play();
+}
+
+void WebVideoFullscreenManager::pause(uint64_t contextId)
+{
+    ensureModel(contextId).pause();
+}
+
+void WebVideoFullscreenManager::togglePlayState(uint64_t contextId)
+{
+    ensureModel(contextId).togglePlayState();
+}
+
+void WebVideoFullscreenManager::beginScrubbing(uint64_t contextId)
+{
+    ensureModel(contextId).beginScrubbing();
+}
+
+void WebVideoFullscreenManager::endScrubbing(uint64_t contextId)
+{
+    ensureModel(contextId).endScrubbing();
+}
+
+void WebVideoFullscreenManager::seekToTime(uint64_t contextId, double time)
+{
+    ensureModel(contextId).seekToTime(time);
+}
+
+void WebVideoFullscreenManager::fastSeek(uint64_t contextId, double time)
+{
+    ensureModel(contextId).fastSeek(time);
+}
+
+void WebVideoFullscreenManager::beginScanningForward(uint64_t contextId)
+{
+    ensureModel(contextId).beginScanningForward();
+}
+
+void WebVideoFullscreenManager::beginScanningBackward(uint64_t contextId)
+{
+    ensureModel(contextId).beginScanningBackward();
+}
+
+void WebVideoFullscreenManager::endScanning(uint64_t contextId)
+{
+    ensureModel(contextId).endScanning();
+}
+
+void WebVideoFullscreenManager::requestFullscreenMode(uint64_t contextId, WebCore::HTMLMediaElementEnums::VideoFullscreenMode mode)
+{
+    ensureModel(contextId).requestFullscreenMode(mode);
+}
+
+void WebVideoFullscreenManager::selectAudioMediaOption(uint64_t contextId, uint64_t index)
+{
+    ensureModel(contextId).selectAudioMediaOption(index);
+}
+
+void WebVideoFullscreenManager::selectLegibleMediaOption(uint64_t contextId, uint64_t index)
+{
+    ensureModel(contextId).selectLegibleMediaOption(index);
+}
+
+void WebVideoFullscreenManager::fullscreenModeChanged(uint64_t contextId, WebCore::HTMLMediaElementEnums::VideoFullscreenMode videoFullscreenMode)
+{
+    ensureModel(contextId).fullscreenModeChanged(videoFullscreenMode);
+}
+
+#pragma mark Messages from WebVideoFullscreenManager:
+
+void WebVideoFullscreenManager::didSetupFullscreen(uint64_t contextId)
+{
+    PlatformLayer* videoLayer = [CALayer layer];
+#ifndef NDEBUG
+    [videoLayer setName:@&quot;Web video fullscreen manager layer&quot;];
+#endif
+
+    [CATransaction begin];
+    [CATransaction setDisableActions:YES];
+
+    [videoLayer setPosition:CGPointMake(0, 0)];
+    [videoLayer setBackgroundColor:cachedCGColor(WebCore::Color::transparent)];
+
+    // Set a scale factor here to make convertRect:toLayer:nil take scale factor into account. &lt;rdar://problem/18316542&gt;.
+    // This scale factor is inverted in the hosting process.
+    float hostingScaleFactor = m_page-&gt;deviceScaleFactor();
+    [videoLayer setTransform:CATransform3DMakeScale(hostingScaleFactor, hostingScaleFactor, 1)];
+
+    RefPtr&lt;WebVideoFullscreenModelVideoElement&gt; model;
+    RefPtr&lt;WebVideoFullscreenInterfaceContext&gt; interface;
+    std::tie(model, interface) = ensureModelAndInterface(contextId);
+
+    interface-&gt;layerHostingContext()-&gt;setRootLayer(videoLayer);
+    model-&gt;setVideoFullscreenLayer(videoLayer);
+
+    [CATransaction commit];
+
+    RefPtr&lt;WebVideoFullscreenManager&gt; strongThis(this);
+    dispatch_async(dispatch_get_main_queue(), [strongThis, this, contextId] {
+        m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::EnterFullscreen(contextId), m_page-&gt;pageID());
+    });
+}
+    
+void WebVideoFullscreenManager::didEnterFullscreen(uint64_t contextId)
+{
+    RefPtr&lt;WebVideoFullscreenModelVideoElement&gt; model;
+    RefPtr&lt;WebVideoFullscreenInterfaceContext&gt; interface;
+    std::tie(model, interface) = ensureModelAndInterface(contextId);
+
+    interface-&gt;setIsAnimating(false);
+    interface-&gt;setIsFullscreen(false);
+
+    if (interface-&gt;targetIsFullscreen())
+        return;
+
+    RefPtr&lt;HTMLVideoElement&gt; videoElement = model-&gt;videoElement();
+    if (!videoElement)
+        return;
+
+    // exit fullscreen now if it was previously requested during an animation.
+    RefPtr&lt;WebVideoFullscreenManager&gt; strongThis(this);
+    dispatch_async(dispatch_get_main_queue(), [strongThis, videoElement] {
+        strongThis-&gt;exitVideoFullscreenForVideoElement(*videoElement);
+    });
+}
+
+void WebVideoFullscreenManager::didExitFullscreen(uint64_t contextId)
+{
+    RefPtr&lt;WebVideoFullscreenModelVideoElement&gt; model;
+    RefPtr&lt;WebVideoFullscreenInterfaceContext&gt; interface;
+    std::tie(model, interface) = ensureModelAndInterface(contextId);
+
+    model-&gt;setVideoFullscreenLayer(nil);
+
+    RefPtr&lt;WebVideoFullscreenManager&gt; strongThis(this);
+    dispatch_async(dispatch_get_main_queue(), [strongThis, contextId, interface] {
+        if (interface-&gt;layerHostingContext()) {
+            interface-&gt;layerHostingContext()-&gt;setRootLayer(nullptr);
+            interface-&gt;setLayerHostingContext(nullptr);
+        }
+        if (strongThis-&gt;m_page)
+            strongThis-&gt;m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::CleanupFullscreen(contextId), strongThis-&gt;m_page-&gt;pageID());
+    });
+}
+    
+void WebVideoFullscreenManager::didCleanupFullscreen(uint64_t contextId)
+{
+    RefPtr&lt;WebVideoFullscreenModelVideoElement&gt; model;
+    RefPtr&lt;WebVideoFullscreenInterfaceContext&gt; interface;
+    std::tie(model, interface) = ensureModelAndInterface(contextId);
+
+    interface-&gt;setIsAnimating(false);
+    interface-&gt;setIsFullscreen(false);
+    HTMLMediaElementEnums::VideoFullscreenMode mode = interface-&gt;fullscreenMode();
+    bool targetIsFullscreen = interface-&gt;targetIsFullscreen();
+
+    model-&gt;setVideoFullscreenLayer(nil);
+    RefPtr&lt;HTMLVideoElement&gt; videoElement = model-&gt;videoElement();
+
+    model-&gt;setVideoElement(nullptr);
+    model-&gt;setWebVideoFullscreenInterface(nullptr);
+    interface-&gt;invalidate();
+    m_videoElements.remove(videoElement.get());
+    m_contextMap.remove(contextId);
+
+    if (!videoElement || !targetIsFullscreen)
+        return;
+
+    RefPtr&lt;WebVideoFullscreenManager&gt; strongThis(this);
+    dispatch_async(dispatch_get_main_queue(), [strongThis, videoElement, mode] {
+        strongThis-&gt;enterVideoFullscreenForVideoElement(*videoElement, mode);
+    });
+}
+    
+void WebVideoFullscreenManager::setVideoLayerGravityEnum(uint64_t contextId, unsigned gravity)
+{
+    ensureModel(contextId).setVideoLayerGravity((WebVideoFullscreenModel::VideoGravity)gravity);
+}
+    
+void WebVideoFullscreenManager::fullscreenMayReturnToInline(uint64_t contextId, bool isPageVisible)
+{
+    auto&amp; model = ensureModel(contextId);
+
+    if (!isPageVisible)
+        model.videoElement()-&gt;scrollIntoViewIfNotVisible(false);
+    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::PreparedToReturnToInline(contextId, true, clientRectForElement(model.videoElement())), m_page-&gt;pageID());
+}
+    
+void WebVideoFullscreenManager::setVideoLayerFrameFenced(uint64_t contextId, WebCore::FloatRect bounds, IPC::Attachment fencePort)
+{
+    RefPtr&lt;WebVideoFullscreenModelVideoElement&gt; model;
+    RefPtr&lt;WebVideoFullscreenInterfaceContext&gt; interface;
+    std::tie(model, interface) = ensureModelAndInterface(contextId);
+
+    if (std::isnan(bounds.x()) || std::isnan(bounds.y()) || std::isnan(bounds.width()) || std::isnan(bounds.height())) {
+        FloatRect clientRect = clientRectForElement(model-&gt;videoElement());
+        bounds = FloatRect(0, 0, clientRect.width(), clientRect.height());
+    }
+    
+    [CATransaction begin];
+    [CATransaction setAnimationDuration:0];
+    if (interface-&gt;layerHostingContext())
+        interface-&gt;layerHostingContext()-&gt;setFencePort(fencePort.port());
+    model-&gt;setVideoLayerFrame(bounds);
+    mach_port_deallocate(mach_task_self(), fencePort.port());
+    [CATransaction commit];
+}
+
+} // namespace WebKit
+
+#endif // PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagerh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h (195599 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h        2016-01-26 18:46:44 UTC (rev 195599)
+++ trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -1,177 +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.
- */
-#ifndef WebVideoFullscreenManager_h
-#define WebVideoFullscreenManager_h
-
-#if PLATFORM(IOS)
-
-#include &quot;MessageReceiver.h&quot;
-#include &lt;WebCore/EventListener.h&gt;
-#include &lt;WebCore/HTMLMediaElementEnums.h&gt;
-#include &lt;WebCore/PlatformCALayer.h&gt;
-#include &lt;WebCore/WebVideoFullscreenInterface.h&gt;
-#include &lt;WebCore/WebVideoFullscreenModelVideoElement.h&gt;
-#include &lt;wtf/HashMap.h&gt;
-#include &lt;wtf/RefCounted.h&gt;
-#include &lt;wtf/RefPtr.h&gt;
-
-namespace IPC {
-class Attachment;
-class Connection;
-class MessageDecoder;
-class MessageReceiver;
-}
-
-namespace WebCore {
-class Node;
-}
-
-namespace WebKit {
-
-class LayerHostingContext;
-class WebPage;
-class WebVideoFullscreenManager;
-
-class WebVideoFullscreenInterfaceContext : public RefCounted&lt;WebVideoFullscreenInterfaceContext&gt;, public WebCore::WebVideoFullscreenInterface {
-public:
-    static Ref&lt;WebVideoFullscreenInterfaceContext&gt; create(WebVideoFullscreenManager&amp; manager, uint64_t contextId)
-    {
-        return adoptRef(*new WebVideoFullscreenInterfaceContext(manager, contextId));
-    }
-    virtual ~WebVideoFullscreenInterfaceContext();
-
-    void invalidate() { m_manager = nullptr; }
-
-    LayerHostingContext* layerHostingContext() { return m_layerHostingContext.get(); }
-    void setLayerHostingContext(std::unique_ptr&lt;LayerHostingContext&gt;&amp;&amp;);
-
-    bool isAnimating() const { return m_isAnimating; }
-    void setIsAnimating(bool flag) { m_isAnimating = flag; }
-
-    bool targetIsFullscreen() const { return m_targetIsFullscreen; }
-    void setTargetIsFullscreen(bool flag) { m_targetIsFullscreen = flag; }
-
-    WebCore::HTMLMediaElementEnums::VideoFullscreenMode fullscreenMode() const { return m_fullscreenMode; }
-    void setFullscreenMode(WebCore::HTMLMediaElementEnums::VideoFullscreenMode mode) { m_fullscreenMode = mode; }
-
-    bool isFullscreen() const { return m_isFullscreen; }
-    void setIsFullscreen(bool flag) { m_isFullscreen = flag; }
-
-private:
-    // WebVideoFullscreenInterface
-    virtual void resetMediaState() override;
-    virtual void setDuration(double) override;
-    virtual void setCurrentTime(double currentTime, double anchorTime) override;
-    virtual void setBufferedTime(double) override;
-    virtual void setRate(bool isPlaying, float playbackRate) override;
-    virtual void setVideoDimensions(bool hasVideo, float width, float height) override;
-    virtual void setSeekableRanges(const WebCore::TimeRanges&amp;) override;
-    virtual void setCanPlayFastReverse(bool value) override;
-    virtual void setAudioMediaSelectionOptions(const Vector&lt;WTF::String&gt;&amp; options, uint64_t selectedIndex) override;
-    virtual void setLegibleMediaSelectionOptions(const Vector&lt;WTF::String&gt;&amp; options, uint64_t selectedIndex) override;
-    virtual void setExternalPlayback(bool enabled, ExternalPlaybackTargetType, WTF::String localizedDeviceName) override;
-    virtual void setWirelessVideoPlaybackDisabled(bool) override;
-
-    WebVideoFullscreenInterfaceContext(WebVideoFullscreenManager&amp;, uint64_t contextId);
-
-    WebVideoFullscreenManager* m_manager;
-    uint64_t m_contextId;
-    std::unique_ptr&lt;LayerHostingContext&gt; m_layerHostingContext;
-    bool m_isAnimating { false };
-    bool m_targetIsFullscreen { false };
-    WebCore::HTMLMediaElementEnums::VideoFullscreenMode m_fullscreenMode { WebCore::HTMLMediaElementEnums::VideoFullscreenModeNone };
-    bool m_isFullscreen { false };
-};
-
-class WebVideoFullscreenManager : public RefCounted&lt;WebVideoFullscreenManager&gt;, private IPC::MessageReceiver {
-public:
-    static Ref&lt;WebVideoFullscreenManager&gt; create(PassRefPtr&lt;WebPage&gt;);
-    virtual ~WebVideoFullscreenManager();
-    
-    void didReceiveMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;) override;
-
-    // Interface to ChromeClient
-    bool supportsVideoFullscreen() const;
-    void enterVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&amp;, WebCore::HTMLMediaElementEnums::VideoFullscreenMode);
-    void exitVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&amp;);
-    
-protected:
-    friend class WebVideoFullscreenInterfaceContext;
-
-    explicit WebVideoFullscreenManager(PassRefPtr&lt;WebPage&gt;);
-
-    typedef std::tuple&lt;RefPtr&lt;WebCore::WebVideoFullscreenModelVideoElement&gt;, RefPtr&lt;WebVideoFullscreenInterfaceContext&gt;&gt; ModelInterfaceTuple;
-    ModelInterfaceTuple createModelAndInterface(uint64_t contextId);
-    ModelInterfaceTuple&amp; ensureModelAndInterface(uint64_t contextId);
-    WebCore::WebVideoFullscreenModelVideoElement&amp; ensureModel(uint64_t contextId);
-    WebVideoFullscreenInterfaceContext&amp; ensureInterface(uint64_t contextId);
-
-    // Interface to WebVideoFullscreenInterfaceContext
-    void resetMediaState(uint64_t contextId);
-    void setDuration(uint64_t contextId, double);
-    void setCurrentTime(uint64_t contextId, double currentTime, double anchorTime);
-    void setBufferedTime(uint64_t contextId, double bufferedTime);
-    void setRate(uint64_t contextId, bool isPlaying, float playbackRate);
-    void setVideoDimensions(uint64_t contextId, bool hasVideo, float width, float height);
-    void setSeekableRanges(uint64_t contextId, const WebCore::TimeRanges&amp;);
-    void setCanPlayFastReverse(uint64_t contextId, bool value);
-    void setAudioMediaSelectionOptions(uint64_t contextId, const Vector&lt;String&gt;&amp; options, uint64_t selectedIndex);
-    void setLegibleMediaSelectionOptions(uint64_t contextId, const Vector&lt;String&gt;&amp; options, uint64_t selectedIndex);
-    void setExternalPlayback(uint64_t contextId, bool enabled, WebCore::WebVideoFullscreenInterface::ExternalPlaybackTargetType, String localizedDeviceName);
-    void setWirelessVideoPlaybackDisabled(uint64_t contextId, bool);
-
-    // Messages from WebVideoFullscreenManagerProxy
-    void play(uint64_t contextId);
-    void pause(uint64_t contextId);
-    void togglePlayState(uint64_t contextId);
-    void beginScrubbing(uint64_t contextId);
-    void endScrubbing(uint64_t contextId);
-    void seekToTime(uint64_t contextId, double time);
-    void fastSeek(uint64_t contextId, double time);
-    void beginScanningForward(uint64_t contextId);
-    void beginScanningBackward(uint64_t contextId);
-    void endScanning(uint64_t contextId);
-    void requestFullscreenMode(uint64_t contextId, WebCore::HTMLMediaElementEnums::VideoFullscreenMode);
-    void didSetupFullscreen(uint64_t contextId);
-    void didExitFullscreen(uint64_t contextId);
-    void didEnterFullscreen(uint64_t contextId);
-    void didCleanupFullscreen(uint64_t contextId);
-    void setVideoLayerFrameFenced(uint64_t contextId, WebCore::FloatRect bounds, IPC::Attachment fencePort);
-    void setVideoLayerGravityEnum(uint64_t contextId, unsigned gravity);
-    void selectAudioMediaOption(uint64_t contextId, uint64_t index);
-    void selectLegibleMediaOption(uint64_t contextId, uint64_t index);
-    void fullscreenModeChanged(uint64_t contextId, WebCore::HTMLMediaElementEnums::VideoFullscreenMode);
-    void fullscreenMayReturnToInline(uint64_t contextId, bool isPageVisible);
-    
-    WebPage* m_page;
-    HashMap&lt;WebCore::HTMLVideoElement*, uint64_t&gt; m_videoElements;
-    HashMap&lt;uint64_t, ModelInterfaceTuple&gt; m_contextMap;
-};
-    
-} // namespace WebKit
-
-#endif // PLATFORM(IOS)
-
-#endif // WebVideoFullscreenManager_h
</del></span></pre></div>
<a id="trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagermessagesin"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.messages.in (195599 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.messages.in        2016-01-26 18:46:44 UTC (rev 195599)
+++ trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.messages.in        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -1,47 +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.
-
-#if PLATFORM(IOS)
-messages -&gt; WebVideoFullscreenManager {
-    Play(uint64_t contextId)
-    Pause(uint64_t contextId)
-    TogglePlayState(uint64_t contextId)
-    BeginScrubbing(uint64_t contextId)
-    EndScrubbing(uint64_t contextId)
-    SeekToTime(uint64_t contextId, double time)
-    FastSeek(uint64_t contextId, double time)
-    BeginScanningForward(uint64_t contextId)
-    BeginScanningBackward(uint64_t contextId)
-    EndScanning(uint64_t contextId)
-    RequestFullscreenMode(uint64_t contextId, WebCore::HTMLMediaElementEnums::VideoFullscreenMode videoFullscreenMode)
-    DidSetupFullscreen(uint64_t contextId)
-    DidExitFullscreen(uint64_t contextId)
-    DidEnterFullscreen(uint64_t contextId)
-    DidCleanupFullscreen(uint64_t contextId)
-    SetVideoLayerFrameFenced(uint64_t contextId, WebCore::FloatRect bounds, IPC::Attachment fencePort)
-    SetVideoLayerGravityEnum(uint64_t contextId, unsigned gravity)
-    SelectAudioMediaOption(uint64_t contextId, uint64_t index)
-    SelectLegibleMediaOption(uint64_t contextId, uint64_t index)
-    FullscreenModeChanged(uint64_t contextId, WebCore::HTMLMediaElementEnums::VideoFullscreenMode videoFullscreenMode)
-    FullscreenMayReturnToInline(uint64_t contextId, bool isPageVisible)
-}
-#endif
</del></span></pre></div>
<a id="trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagermm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm (195599 => 195600)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm        2016-01-26 18:46:44 UTC (rev 195599)
+++ trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm        2016-01-26 18:56:00 UTC (rev 195600)
</span><span class="lines">@@ -1,561 +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.
- */
-#import &quot;config.h&quot;
-#import &quot;WebVideoFullscreenManager.h&quot;
-
-#if PLATFORM(IOS)
-
-#import &quot;Attachment.h&quot;
-#import &quot;WebCoreArgumentCoders.h&quot;
-#import &quot;WebPage.h&quot;
-#import &quot;WebProcess.h&quot;
-#import &quot;WebVideoFullscreenManagerMessages.h&quot;
-#import &quot;WebVideoFullscreenManagerProxyMessages.h&quot;
-#import &lt;QuartzCore/CoreAnimation.h&gt;
-#import &lt;WebCore/Color.h&gt;
-#import &lt;WebCore/Event.h&gt;
-#import &lt;WebCore/EventNames.h&gt;
-#import &lt;WebCore/FrameView.h&gt;
-#import &lt;WebCore/HTMLVideoElement.h&gt;
-#import &lt;WebCore/PlatformCALayer.h&gt;
-#import &lt;WebCore/RenderLayer.h&gt;
-#import &lt;WebCore/RenderLayerBacking.h&gt;
-#import &lt;WebCore/RenderView.h&gt;
-#import &lt;WebCore/Settings.h&gt;
-#import &lt;WebCore/TimeRanges.h&gt;
-#import &lt;WebCore/WebCoreThreadRun.h&gt;
-#import &lt;mach/mach_port.h&gt;
-
-using namespace WebCore;
-
-namespace WebKit {
-
-static IntRect clientRectForElement(HTMLElement* element)
-{
-    if (!element)
-        return IntRect();
-
-    return element-&gt;clientRect();
-}
-
-static uint64_t nextContextId()
-{
-    static uint64_t contextId = 0;
-    return ++contextId;
-}
-
-#pragma mark - WebVideoFullscreenInterfaceContext
-
-WebVideoFullscreenInterfaceContext::WebVideoFullscreenInterfaceContext(WebVideoFullscreenManager&amp; manager, uint64_t contextId)
-    : m_manager(&amp;manager)
-    , m_contextId(contextId)
-{
-}
-
-WebVideoFullscreenInterfaceContext::~WebVideoFullscreenInterfaceContext()
-{
-}
-
-void WebVideoFullscreenInterfaceContext::setLayerHostingContext(std::unique_ptr&lt;LayerHostingContext&gt;&amp;&amp; context)
-{
-    m_layerHostingContext = WTFMove(context);
-}
-
-void WebVideoFullscreenInterfaceContext::resetMediaState()
-{
-    if (m_manager)
-        m_manager-&gt;resetMediaState(m_contextId);
-}
-
-void WebVideoFullscreenInterfaceContext::setDuration(double duration)
-{
-    if (m_manager)
-        m_manager-&gt;setDuration(m_contextId, duration);
-}
-
-void WebVideoFullscreenInterfaceContext::setCurrentTime(double currentTime, double anchorTime)
-{
-    if (m_manager)
-        m_manager-&gt;setCurrentTime(m_contextId, currentTime, anchorTime);
-}
-
-void WebVideoFullscreenInterfaceContext::setBufferedTime(double bufferedTime)
-{
-    if (m_manager)
-        m_manager-&gt;setBufferedTime(m_contextId, bufferedTime);
-}
-
-void WebVideoFullscreenInterfaceContext::setRate(bool isPlaying, float playbackRate)
-{
-    if (m_manager)
-        m_manager-&gt;setRate(m_contextId, isPlaying, playbackRate);
-}
-
-void WebVideoFullscreenInterfaceContext::setVideoDimensions(bool hasVideo, float width, float height)
-{
-    if (m_manager)
-        m_manager-&gt;setVideoDimensions(m_contextId, hasVideo, width, height);
-}
-
-void WebVideoFullscreenInterfaceContext::setSeekableRanges(const WebCore::TimeRanges&amp; ranges)
-{
-    if (m_manager)
-        m_manager-&gt;setSeekableRanges(m_contextId, ranges);
-}
-
-void WebVideoFullscreenInterfaceContext::setCanPlayFastReverse(bool value)
-{
-    if (m_manager)
-        m_manager-&gt;setCanPlayFastReverse(m_contextId, value);
-}
-
-void WebVideoFullscreenInterfaceContext::setAudioMediaSelectionOptions(const Vector&lt;WTF::String&gt;&amp; options, uint64_t selectedIndex)
-{
-    if (m_manager)
-        m_manager-&gt;setAudioMediaSelectionOptions(m_contextId, options, selectedIndex);
-}
-
-void WebVideoFullscreenInterfaceContext::setLegibleMediaSelectionOptions(const Vector&lt;WTF::String&gt;&amp; options, uint64_t selectedIndex)
-{
-    if (m_manager)
-        m_manager-&gt;setLegibleMediaSelectionOptions(m_contextId, options, selectedIndex);
-}
-
-void WebVideoFullscreenInterfaceContext::setExternalPlayback(bool enabled, ExternalPlaybackTargetType type, WTF::String localizedDeviceName)
-{
-    if (m_manager)
-        m_manager-&gt;setExternalPlayback(m_contextId, enabled, type, localizedDeviceName);
-}
-
-void WebVideoFullscreenInterfaceContext::setWirelessVideoPlaybackDisabled(bool disabled)
-{
-    if (m_manager)
-        m_manager-&gt;setWirelessVideoPlaybackDisabled(m_contextId, disabled);
-}
-
-#pragma mark - WebVideoFullscreenManager
-
-Ref&lt;WebVideoFullscreenManager&gt; WebVideoFullscreenManager::create(PassRefPtr&lt;WebPage&gt; page)
-{
-    return adoptRef(*new WebVideoFullscreenManager(page));
-}
-
-WebVideoFullscreenManager::WebVideoFullscreenManager(PassRefPtr&lt;WebPage&gt; page)
-    : m_page(page.get())
-{
-    WebProcess::singleton().addMessageReceiver(Messages::WebVideoFullscreenManager::messageReceiverName(), page-&gt;pageID(), *this);
-}
-
-WebVideoFullscreenManager::~WebVideoFullscreenManager()
-{
-    for (auto&amp; tuple : m_contextMap.values()) {
-        RefPtr&lt;WebVideoFullscreenModelVideoElement&gt; model;
-        RefPtr&lt;WebVideoFullscreenInterfaceContext&gt; interface;
-        std::tie(model, interface) = tuple;
-
-        model-&gt;setWebVideoFullscreenInterface(nullptr);
-        model-&gt;setVideoElement(nullptr);
-
-        interface-&gt;invalidate();
-    }
-
-    m_contextMap.clear();
-    m_videoElements.clear();
-
-    WebProcess::singleton().removeMessageReceiver(Messages::WebVideoFullscreenManager::messageReceiverName(), m_page-&gt;pageID());
-}
-
-WebVideoFullscreenManager::ModelInterfaceTuple WebVideoFullscreenManager::createModelAndInterface(uint64_t contextId)
-{
-    RefPtr&lt;WebVideoFullscreenModelVideoElement&gt; model = WebVideoFullscreenModelVideoElement::create();
-    RefPtr&lt;WebVideoFullscreenInterfaceContext&gt; interface = WebVideoFullscreenInterfaceContext::create(*this, contextId);
-
-    interface-&gt;setLayerHostingContext(LayerHostingContext::createForExternalHostingProcess());
-    model-&gt;setWebVideoFullscreenInterface(interface.get());
-
-    return std::make_tuple(WTFMove(model), WTFMove(interface));
-}
-
-WebVideoFullscreenManager::ModelInterfaceTuple&amp; WebVideoFullscreenManager::ensureModelAndInterface(uint64_t contextId)
-{
-    auto addResult = m_contextMap.add(contextId, ModelInterfaceTuple());
-    if (addResult.isNewEntry)
-        addResult.iterator-&gt;value = createModelAndInterface(contextId);
-    return addResult.iterator-&gt;value;
-}
-
-WebCore::WebVideoFullscreenModelVideoElement&amp; WebVideoFullscreenManager::ensureModel(uint64_t contextId)
-{
-    return *std::get&lt;0&gt;(ensureModelAndInterface(contextId));
-}
-
-WebVideoFullscreenInterfaceContext&amp; WebVideoFullscreenManager::ensureInterface(uint64_t contextId)
-{
-    return *std::get&lt;1&gt;(ensureModelAndInterface(contextId));
-}
-
-#pragma mark Interface to ChromeClient:
-
-bool WebVideoFullscreenManager::supportsVideoFullscreen() const
-{
-    return Settings::avKitEnabled();
-}
-
-void WebVideoFullscreenManager::enterVideoFullscreenForVideoElement(HTMLVideoElement&amp; videoElement, HTMLMediaElementEnums::VideoFullscreenMode mode)
-{
-    ASSERT(mode != HTMLMediaElementEnums::VideoFullscreenModeNone);
-
-    uint64_t contextId;
-
-    auto addResult = m_videoElements.add(&amp;videoElement, 0);
-    if (addResult.isNewEntry)
-        addResult.iterator-&gt;value = nextContextId();
-    contextId = addResult.iterator-&gt;value;
-
-    RefPtr&lt;WebVideoFullscreenModelVideoElement&gt; model;
-    RefPtr&lt;WebVideoFullscreenInterfaceContext&gt; interface;
-    std::tie(model, interface) = ensureModelAndInterface(contextId);
-
-    FloatRect clientRect = clientRectForElement(&amp;videoElement);
-    FloatRect videoLayerFrame = FloatRect(0, 0, clientRect.width(), clientRect.height());
-
-    HTMLMediaElementEnums::VideoFullscreenMode oldMode = interface-&gt;fullscreenMode();
-    interface-&gt;setTargetIsFullscreen(true);
-    interface-&gt;setFullscreenMode(mode);
-    model-&gt;setVideoElement(&amp;videoElement);
-    if (oldMode == HTMLMediaElementEnums::VideoFullscreenModeNone)
-        model-&gt;setVideoLayerFrame(videoLayerFrame);
-
-    if (interface-&gt;isAnimating())
-        return;
-    interface-&gt;setIsAnimating(true);
-
-    bool allowsPictureInPicture = videoElement.mediaSession().allowsPictureInPicture(videoElement);
-    
-    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetupFullscreenWithID(contextId, interface-&gt;layerHostingContext()-&gt;contextID(), clientRectForElement(&amp;videoElement), m_page-&gt;deviceScaleFactor(), interface-&gt;fullscreenMode(), allowsPictureInPicture), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManager::exitVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&amp; videoElement)
-{
-    ASSERT(m_videoElements.contains(&amp;videoElement));
-
-    uint64_t contextId = m_videoElements.get(&amp;videoElement);
-    auto&amp; interface = ensureInterface(contextId);
-
-    interface.setTargetIsFullscreen(false);
-
-    if (interface.isAnimating())
-        return;
-
-    interface.setIsAnimating(true);
-    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::ExitFullscreen(contextId, clientRectForElement(&amp;videoElement)), m_page-&gt;pageID());
-}
-
-#pragma mark Interface to WebVideoFullscreenInterfaceContext:
-
-void WebVideoFullscreenManager::resetMediaState(uint64_t contextId)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::ResetMediaState(contextId), m_page-&gt;pageID());
-}
-    
-void WebVideoFullscreenManager::setDuration(uint64_t contextId, double duration)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetDuration(contextId, duration), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManager::setCurrentTime(uint64_t contextId, double currentTime, double anchorTime)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetCurrentTime(contextId, currentTime, anchorTime), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManager::setBufferedTime(uint64_t contextId, double bufferedTime)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetBufferedTime(contextId, bufferedTime), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManager::setRate(uint64_t contextId, bool isPlaying, float playbackRate)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetRate(contextId, isPlaying, playbackRate), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManager::setVideoDimensions(uint64_t contextId, bool hasVideo, float width, float height)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetVideoDimensions(contextId, hasVideo, width, height), m_page-&gt;pageID());
-}
-    
-void WebVideoFullscreenManager::setSeekableRanges(uint64_t contextId, const WebCore::TimeRanges&amp; timeRanges)
-{
-    Vector&lt;std::pair&lt;double, double&gt;&gt; rangesVector;
-    
-    for (unsigned i = 0; i &lt; timeRanges.length(); i++) {
-        ExceptionCode exceptionCode;
-        double start = timeRanges.start(i, exceptionCode);
-        double end = timeRanges.end(i, exceptionCode);
-        rangesVector.append(std::pair&lt;double,double&gt;(start, end));
-    }
-
-    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetSeekableRangesVector(contextId, WTFMove(rangesVector)), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManager::setCanPlayFastReverse(uint64_t contextId, bool value)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetCanPlayFastReverse(contextId, value), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManager::setAudioMediaSelectionOptions(uint64_t contextId, const Vector&lt;String&gt;&amp; options, uint64_t selectedIndex)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetAudioMediaSelectionOptions(contextId, options, selectedIndex), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManager::setLegibleMediaSelectionOptions(uint64_t contextId, const Vector&lt;String&gt;&amp; options, uint64_t selectedIndex)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetLegibleMediaSelectionOptions(contextId, options, selectedIndex), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManager::setExternalPlayback(uint64_t contextId, bool enabled, WebVideoFullscreenInterface::ExternalPlaybackTargetType targetType, String localizedDeviceName)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetExternalPlaybackProperties(contextId, enabled, static_cast&lt;uint32_t&gt;(targetType), localizedDeviceName), m_page-&gt;pageID());
-}
-
-void WebVideoFullscreenManager::setWirelessVideoPlaybackDisabled(uint64_t contextId, bool disabled)
-{
-    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetWirelessVideoPlaybackDisabled(contextId, disabled));
-}
-
-#pragma mark Messages from WebVideoFullscreenManagerProxy:
-
-void WebVideoFullscreenManager::play(uint64_t contextId)
-{
-    ensureModel(contextId).play();
-}
-
-void WebVideoFullscreenManager::pause(uint64_t contextId)
-{
-    ensureModel(contextId).pause();
-}
-
-void WebVideoFullscreenManager::togglePlayState(uint64_t contextId)
-{
-    ensureModel(contextId).togglePlayState();
-}
-
-void WebVideoFullscreenManager::beginScrubbing(uint64_t contextId)
-{
-    ensureModel(contextId).beginScrubbing();
-}
-
-void WebVideoFullscreenManager::endScrubbing(uint64_t contextId)
-{
-    ensureModel(contextId).endScrubbing();
-}
-
-void WebVideoFullscreenManager::seekToTime(uint64_t contextId, double time)
-{
-    ensureModel(contextId).seekToTime(time);
-}
-
-void WebVideoFullscreenManager::fastSeek(uint64_t contextId, double time)
-{
-    ensureModel(contextId).fastSeek(time);
-}
-
-void WebVideoFullscreenManager::beginScanningForward(uint64_t contextId)
-{
-    ensureModel(contextId).beginScanningForward();
-}
-
-void WebVideoFullscreenManager::beginScanningBackward(uint64_t contextId)
-{
-    ensureModel(contextId).beginScanningBackward();
-}
-
-void WebVideoFullscreenManager::endScanning(uint64_t contextId)
-{
-    ensureModel(contextId).endScanning();
-}
-
-void WebVideoFullscreenManager::requestFullscreenMode(uint64_t contextId, WebCore::HTMLMediaElementEnums::VideoFullscreenMode mode)
-{
-    ensureModel(contextId).requestFullscreenMode(mode);
-}
-
-void WebVideoFullscreenManager::selectAudioMediaOption(uint64_t contextId, uint64_t index)
-{
-    ensureModel(contextId).selectAudioMediaOption(index);
-}
-
-void WebVideoFullscreenManager::selectLegibleMediaOption(uint64_t contextId, uint64_t index)
-{
-    ensureModel(contextId).selectLegibleMediaOption(index);
-}
-
-void WebVideoFullscreenManager::fullscreenModeChanged(uint64_t contextId, WebCore::HTMLMediaElementEnums::VideoFullscreenMode videoFullscreenMode)
-{
-    ensureModel(contextId).fullscreenModeChanged(videoFullscreenMode);
-}
-
-#pragma mark Messages from WebVideoFullscreenManager:
-
-void WebVideoFullscreenManager::didSetupFullscreen(uint64_t contextId)
-{
-    PlatformLayer* videoLayer = [CALayer layer];
-#ifndef NDEBUG
-    [videoLayer setName:@&quot;Web video fullscreen manager layer&quot;];
-#endif
-
-    [CATransaction begin];
-    [CATransaction setDisableActions:YES];
-
-    [videoLayer setPosition:CGPointMake(0, 0)];
-    [videoLayer setBackgroundColor:cachedCGColor(WebCore::Color::transparent)];
-
-    // Set a scale factor here to make convertRect:toLayer:nil take scale factor into account. &lt;rdar://problem/18316542&gt;.
-    // This scale factor is inverted in the hosting process.
-    float hostingScaleFactor = m_page-&gt;deviceScaleFactor();
-    [videoLayer setTransform:CATransform3DMakeScale(hostingScaleFactor, hostingScaleFactor, 1)];
-
-    RefPtr&lt;WebVideoFullscreenModelVideoElement&gt; model;
-    RefPtr&lt;WebVideoFullscreenInterfaceContext&gt; interface;
-    std::tie(model, interface) = ensureModelAndInterface(contextId);
-
-    interface-&gt;layerHostingContext()-&gt;setRootLayer(videoLayer);
-    model-&gt;setVideoFullscreenLayer(videoLayer);
-
-    [CATransaction commit];
-
-    RefPtr&lt;WebVideoFullscreenManager&gt; strongThis(this);
-    dispatch_async(dispatch_get_main_queue(), [strongThis, this, contextId] {
-        m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::EnterFullscreen(contextId), m_page-&gt;pageID());
-    });
-}
-    
-void WebVideoFullscreenManager::didEnterFullscreen(uint64_t contextId)
-{
-    RefPtr&lt;WebVideoFullscreenModelVideoElement&gt; model;
-    RefPtr&lt;WebVideoFullscreenInterfaceContext&gt; interface;
-    std::tie(model, interface) = ensureModelAndInterface(contextId);
-
-    interface-&gt;setIsAnimating(false);
-    interface-&gt;setIsFullscreen(false);
-
-    if (interface-&gt;targetIsFullscreen())
-        return;
-
-    RefPtr&lt;HTMLVideoElement&gt; videoElement = model-&gt;videoElement();
-    if (!videoElement)
-        return;
-
-    // exit fullscreen now if it was previously requested during an animation.
-    RefPtr&lt;WebVideoFullscreenManager&gt; strongThis(this);
-    dispatch_async(dispatch_get_main_queue(), [strongThis, videoElement] {
-        strongThis-&gt;exitVideoFullscreenForVideoElement(*videoElement);
-    });
-}
-
-void WebVideoFullscreenManager::didExitFullscreen(uint64_t contextId)
-{
-    RefPtr&lt;WebVideoFullscreenModelVideoElement&gt; model;
-    RefPtr&lt;WebVideoFullscreenInterfaceContext&gt; interface;
-    std::tie(model, interface) = ensureModelAndInterface(contextId);
-
-    model-&gt;setVideoFullscreenLayer(nil);
-
-    RefPtr&lt;WebVideoFullscreenManager&gt; strongThis(this);
-    dispatch_async(dispatch_get_main_queue(), [strongThis, contextId, interface] {
-        if (interface-&gt;layerHostingContext()) {
-            interface-&gt;layerHostingContext()-&gt;setRootLayer(nullptr);
-            interface-&gt;setLayerHostingContext(nullptr);
-        }
-        if (strongThis-&gt;m_page)
-            strongThis-&gt;m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::CleanupFullscreen(contextId), strongThis-&gt;m_page-&gt;pageID());
-    });
-}
-    
-void WebVideoFullscreenManager::didCleanupFullscreen(uint64_t contextId)
-{
-    RefPtr&lt;WebVideoFullscreenModelVideoElement&gt; model;
-    RefPtr&lt;WebVideoFullscreenInterfaceContext&gt; interface;
-    std::tie(model, interface) = ensureModelAndInterface(contextId);
-
-    interface-&gt;setIsAnimating(false);
-    interface-&gt;setIsFullscreen(false);
-    HTMLMediaElementEnums::VideoFullscreenMode mode = interface-&gt;fullscreenMode();
-    bool targetIsFullscreen = interface-&gt;targetIsFullscreen();
-
-    model-&gt;setVideoFullscreenLayer(nil);
-    RefPtr&lt;HTMLVideoElement&gt; videoElement = model-&gt;videoElement();
-
-    model-&gt;setVideoElement(nullptr);
-    model-&gt;setWebVideoFullscreenInterface(nullptr);
-    interface-&gt;invalidate();
-    m_videoElements.remove(videoElement.get());
-    m_contextMap.remove(contextId);
-
-    if (!videoElement || !targetIsFullscreen)
-        return;
-
-    RefPtr&lt;WebVideoFullscreenManager&gt; strongThis(this);
-    dispatch_async(dispatch_get_main_queue(), [strongThis, videoElement, mode] {
-        strongThis-&gt;enterVideoFullscreenForVideoElement(*videoElement, mode);
-    });
-}
-    
-void WebVideoFullscreenManager::setVideoLayerGravityEnum(uint64_t contextId, unsigned gravity)
-{
-    ensureModel(contextId).setVideoLayerGravity((WebVideoFullscreenModel::VideoGravity)gravity);
-}
-    
-void WebVideoFullscreenManager::fullscreenMayReturnToInline(uint64_t contextId, bool isPageVisible)
-{
-    auto&amp; model = ensureModel(contextId);
-
-    if (!isPageVisible)
-        model.videoElement()-&gt;scrollIntoViewIfNotVisible(false);
-    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::PreparedToReturnToInline(contextId, true, clientRectForElement(model.videoElement())), m_page-&gt;pageID());
-}
-    
-void WebVideoFullscreenManager::setVideoLayerFrameFenced(uint64_t contextId, WebCore::FloatRect bounds, IPC::Attachment fencePort)
-{
-    RefPtr&lt;WebVideoFullscreenModelVideoElement&gt; model;
-    RefPtr&lt;WebVideoFullscreenInterfaceContext&gt; interface;
-    std::tie(model, interface) = ensureModelAndInterface(contextId);
-
-    if (std::isnan(bounds.x()) || std::isnan(bounds.y()) || std::isnan(bounds.width()) || std::isnan(bounds.height())) {
-        FloatRect clientRect = clientRectForElement(model-&gt;videoElement());
-        bounds = FloatRect(0, 0, clientRect.width(), clientRect.height());
-    }
-    
-    [CATransaction begin];
-    [CATransaction setAnimationDuration:0];
-    if (interface-&gt;layerHostingContext())
-        interface-&gt;layerHostingContext()-&gt;setFencePort(fencePort.port());
-    model-&gt;setVideoLayerFrame(bounds);
-    mach_port_deallocate(mach_task_self(), fencePort.port());
-    [CATransaction commit];
-}
-
-} // namespace WebKit
-
-#endif // PLATFORM(IOS)
</del></span></pre>
</div>
</div>

</body>
</html>