<!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>[178994] branches/safari-600.1.4.15-branch/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/178994">178994</a></dd>
<dt>Author</dt> <dd>ddkilzer@apple.com</dd>
<dt>Date</dt> <dd>2015-01-23 02:04:34 -0800 (Fri, 23 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/173741">r173741</a>.  rdar://problem/19420088</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6001415branchSourceWebCoreChangeLog">branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari6001415branchSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKitmm">branches/safari-600.1.4.15-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm</a></li>
<li><a href="#branchessafari6001415branchSourceWebCoreplatformiosWebVideoFullscreenModelMediaElementmm">branches/safari-600.1.4.15-branch/Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm</a></li>
<li><a href="#branchessafari6001415branchSourceWebKit2ChangeLog">branches/safari-600.1.4.15-branch/Source/WebKit2/ChangeLog</a></li>
<li><a href="#branchessafari6001415branchSourceWebKit2PlatformmacLayerHostingContexth">branches/safari-600.1.4.15-branch/Source/WebKit2/Platform/mac/LayerHostingContext.h</a></li>
<li><a href="#branchessafari6001415branchSourceWebKit2PlatformmacLayerHostingContextmm">branches/safari-600.1.4.15-branch/Source/WebKit2/Platform/mac/LayerHostingContext.mm</a></li>
<li><a href="#branchessafari6001415branchSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxymm">branches/safari-600.1.4.15-branch/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm</a></li>
<li><a href="#branchessafari6001415branchSourceWebKit2WebProcessiosWebVideoFullscreenManagerh">branches/safari-600.1.4.15-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h</a></li>
<li><a href="#branchessafari6001415branchSourceWebKit2WebProcessiosWebVideoFullscreenManagermessagesin">branches/safari-600.1.4.15-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.messages.in</a></li>
<li><a href="#branchessafari6001415branchSourceWebKit2WebProcessiosWebVideoFullscreenManagermm">branches/safari-600.1.4.15-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6001415branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog (178993 => 178994)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog        2015-01-23 09:18:43 UTC (rev 178993)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog        2015-01-23 10:04:34 UTC (rev 178994)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2015-01-22  David Kilzer  &lt;ddkilzer@apple.com&gt;
+
+        Merge r173741.
+
+    2014-09-18  Jeremy Jones  &lt;jeremyj@apple.com&gt;
+
+        Improve fullscreen video rotation animation.
+        https://bugs.webkit.org/show_bug.cgi?id=136870
+
+        Reviewed by Simon Fraser.
+
+        Instead of setting the frame on the video layer, set position and bounds separately. This allows the position to be synchronized with the rest of the animation.
+        When using a fencePort to synchronize animations, if the fence times out, pivoting around the center provides a better fallback.
+
+        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
+        (-[WebAVVideoLayer setVideoSublayer:]): added
+        (-[WebAVVideoLayer videoSublayer]): added
+        (-[WebAVVideoLayer setBounds:]):  set position and bounds insted of frame.
+        (WebVideoFullscreenInterfaceAVKit::setupFullscreen): use setVideoSublayer
+        * platform/ios/WebVideoFullscreenModelVideoElement.mm:
+        (WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer): set bounds and anchorPoint instead of frame
+        (WebVideoFullscreenModelVideoElement::setVideoLayerFrame): set bounds instead of frame.
+
</ins><span class="cx"> 2015-01-21  Babak Shafiei  &lt;bshafiei@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r178072.
</span></span></pre></div>
<a id="branchessafari6001415branchSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKitmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm (178993 => 178994)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm        2015-01-23 09:18:43 UTC (rev 178993)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm        2015-01-23 10:04:34 UTC (rev 178994)
</span><span class="lines">@@ -476,12 +476,14 @@
</span><span class="cx"> @property (nonatomic) CGRect videoRect;
</span><span class="cx"> - (void)setPlayerViewController:(AVPlayerViewController *)playerViewController;
</span><span class="cx"> - (void)setPlayerController:(AVPlayerController *)playerController;
</span><ins>+@property (nonatomic, retain) CALayer* videoSublayer;
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @implementation WebAVVideoLayer
</span><span class="cx"> {
</span><span class="cx">     RetainPtr&lt;WebAVPlayerController&gt; _avPlayerController;
</span><span class="cx">     RetainPtr&lt;AVPlayerViewController&gt; _avPlayerViewController;
</span><ins>+    RetainPtr&lt;CALayer&gt; _videoSublayer;
</ins><span class="cx">     AVVideoLayerGravity _videoLayerGravity;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -511,6 +513,17 @@
</span><span class="cx">     _avPlayerViewController = playerViewController;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)setVideoSublayer:(CALayer *)videoSublayer
+{
+    _videoSublayer = videoSublayer;
+    [self addSublayer:videoSublayer];
+}
+
+- (CALayer*)videoSublayer
+{
+    return _videoSublayer.get();
+}
+
</ins><span class="cx"> - (void)setBounds:(CGRect)bounds
</span><span class="cx"> {
</span><span class="cx">     [super setBounds:bounds];
</span><span class="lines">@@ -521,14 +534,22 @@
</span><span class="cx">     UIView* rootView = [[_avPlayerViewController view] window];
</span><span class="cx">     if (!rootView)
</span><span class="cx">         return;
</span><ins>+    
+    [CATransaction begin];
+    NSTimeInterval animationDuration = [self animationForKey:@&quot;bounds&quot;].duration;
+    if (!animationDuration) // a duration of 0 for CA means 0.25. This is a way to approximate 0.
+        animationDuration = 0.001;
+    [CATransaction setAnimationDuration:animationDuration];
+    [CATransaction setAnimationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
</ins><span class="cx"> 
</span><span class="cx">     FloatRect rootBounds = [rootView bounds];
</span><span class="cx">     [_avPlayerController delegate]-&gt;setVideoLayerFrame(rootBounds);
</span><span class="cx"> 
</span><span class="cx">     FloatRect sourceBounds = largestRectWithAspectRatioInsideRect(CGRectGetWidth(bounds) / CGRectGetHeight(bounds), rootBounds);
</span><span class="cx">     CATransform3D transform = CATransform3DMakeScale(bounds.size.width / sourceBounds.width(), bounds.size.height / sourceBounds.height(), 1);
</span><del>-    transform = CATransform3DTranslate(transform, bounds.origin.x - sourceBounds.x(), bounds.origin.y - sourceBounds.y(), 0);
-    [self setSublayerTransform:transform];
</del><ins>+    [_videoSublayer setPosition:CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds))];
+    [_videoSublayer setSublayerTransform:transform];
+    [CATransaction commit];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)setVideoLayerGravity:(AVVideoLayerGravity)videoLayerGravity
</span><span class="lines">@@ -756,7 +777,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_videoLayerContainer = [WebAVVideoLayer videoLayer];
</span><span class="cx">     [m_videoLayerContainer setHidden:playerController().externalPlaybackActive];
</span><del>-    [m_videoLayerContainer addSublayer:m_videoLayer.get()];
</del><ins>+    [m_videoLayerContainer setVideoSublayer:m_videoLayer.get()];
</ins><span class="cx"> 
</span><span class="cx">     CGSize videoSize = playerController().contentDimensions;
</span><span class="cx">     CGRect videoRect = CGRectMake(0, 0, videoSize.width, videoSize.height);
</span></span></pre></div>
<a id="branchessafari6001415branchSourceWebCoreplatformiosWebVideoFullscreenModelMediaElementmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm (178993 => 178994)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm        2015-01-23 09:18:43 UTC (rev 178993)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm        2015-01-23 10:04:34 UTC (rev 178994)
</span><span class="lines">@@ -158,7 +158,8 @@
</span><span class="cx">         return;
</span><span class="cx">     
</span><span class="cx">     m_videoFullscreenLayer = videoLayer;
</span><del>-    [m_videoFullscreenLayer setFrame:m_videoFrame];
</del><ins>+    [m_videoFullscreenLayer setAnchorPoint:CGPointMake(0.5, 0.5)];
+    [m_videoFullscreenLayer setBounds:m_videoFrame];
</ins><span class="cx">     
</span><span class="cx">     __block RefPtr&lt;WebVideoFullscreenModelMediaElement&gt; protect(this);
</span><span class="cx">     WebThreadRun(^{
</span><span class="lines">@@ -283,7 +284,7 @@
</span><span class="cx"> void WebVideoFullscreenModelMediaElement::setVideoLayerFrame(FloatRect rect)
</span><span class="cx"> {
</span><span class="cx">     m_videoFrame = rect;
</span><del>-    [m_videoFullscreenLayer setFrame:CGRect(rect)];
</del><ins>+    [m_videoFullscreenLayer setBounds:CGRect(rect)];
</ins><span class="cx">     m_mediaElement-&gt;setVideoFullscreenFrame(rect);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari6001415branchSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebKit2/ChangeLog (178993 => 178994)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebKit2/ChangeLog        2015-01-23 09:18:43 UTC (rev 178993)
+++ branches/safari-600.1.4.15-branch/Source/WebKit2/ChangeLog        2015-01-23 10:04:34 UTC (rev 178994)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2015-01-22  David Kilzer  &lt;ddkilzer@apple.com&gt;
+
+        Merge r173741.
+
+    2014-09-18  Jeremy Jones  &lt;jeremyj@apple.com&gt;
+
+        Improve fullscreen video rotation animation.
+        https://bugs.webkit.org/show_bug.cgi?id=136870
+
+        Reviewed by Simon Fraser.
+
+        Remove WKCAContext from LayerHostingContext and use a fencePort to synchronize animation between processes.
+
+        * Platform/mac/LayerHostingContext.h: add setFencePort. Remove WKCAContext.
+        * Platform/mac/LayerHostingContext.mm:
+        (WebKit::LayerHostingContext::createForPort): Remove WKCAContext.
+        (WebKit::LayerHostingContext::createForExternalHostingProcess): ditto
+        (WebKit::LayerHostingContext::setRootLayer): ditto
+        (WebKit::LayerHostingContext::rootLayer): ditto
+        (WebKit::LayerHostingContext::contextID): ditto
+        (WebKit::LayerHostingContext::invalidate): ditto
+        (WebKit::LayerHostingContext::setColorSpace): ditto
+        (WebKit::LayerHostingContext::colorSpace): ditto
+        (WebKit::LayerHostingContext::setFencePort): added
+        * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
+        (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame): 
+        * WebProcess/ios/WebVideoFullscreenManager.h:
+        * WebProcess/ios/WebVideoFullscreenManager.messages.in: add fence port parameter
+        * WebProcess/ios/WebVideoFullscreenManager.mm: ditto
+        (WebKit::WebVideoFullscreenManager::didSetupFullscreen): ditto
+        (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced): ditto
+
</ins><span class="cx"> 2015-01-21  Babak Shafiei  &lt;bshafiei@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r177329.
</span></span></pre></div>
<a id="branchessafari6001415branchSourceWebKit2PlatformmacLayerHostingContexth"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebKit2/Platform/mac/LayerHostingContext.h (178993 => 178994)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebKit2/Platform/mac/LayerHostingContext.h        2015-01-23 09:18:43 UTC (rev 178993)
+++ branches/safari-600.1.4.15-branch/Source/WebKit2/Platform/mac/LayerHostingContext.h        2015-01-23 10:04:34 UTC (rev 178994)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> OBJC_CLASS CALayer;
</span><del>-typedef struct __WKCAContextRef *WKCAContextRef;
</del><ins>+OBJC_CLASS CAContext;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="lines">@@ -57,10 +57,12 @@
</span><span class="cx"> 
</span><span class="cx">     void setColorSpace(CGColorSpaceRef);
</span><span class="cx">     CGColorSpaceRef colorSpace() const;
</span><ins>+    
+    void setFencePort(mach_port_t);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     LayerHostingMode m_layerHostingMode;
</span><del>-    RetainPtr&lt;WKCAContextRef&gt; m_context;
</del><ins>+    RetainPtr&lt;CAContext&gt; m_context;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="branchessafari6001415branchSourceWebKit2PlatformmacLayerHostingContextmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebKit2/Platform/mac/LayerHostingContext.mm (178993 => 178994)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebKit2/Platform/mac/LayerHostingContext.mm        2015-01-23 09:18:43 UTC (rev 178993)
+++ branches/safari-600.1.4.15-branch/Source/WebKit2/Platform/mac/LayerHostingContext.mm        2015-01-23 10:04:34 UTC (rev 178994)
</span><span class="lines">@@ -28,16 +28,21 @@
</span><span class="cx"> 
</span><span class="cx"> #import &lt;WebKitSystemInterface.h&gt;
</span><span class="cx"> 
</span><del>-#if __has_include(&lt;QuartzCore/QuartzCorePrivate.h&gt;)
-#import &lt;QuartzCore/QuartzCorePrivate.h&gt;
</del><ins>+#if __has_include(&lt;QuartzCore/CAContext.h&gt;)
+#import &lt;QuartzCore/CAContext.h&gt;
</ins><span class="cx"> #else
</span><span class="cx"> @interface CAContext : NSObject
</span><span class="cx"> @end
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> @interface CAContext (Details)
</span><ins>+- (void)invalidate;
+@property (readonly) uint32_t contextId;
+@property (strong) CALayer *layer;
+@property CGColorSpaceRef colorSpace;
+- (void)setFencePort:(mach_port_t)port;
</ins><span class="cx"> + (CAContext *)remoteContextWithOptions:(NSDictionary *)dict;
</span><span class="cx"> @end
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> extern NSString * const kCAContextIgnoresHitTest;
</span><span class="cx"> 
</span><span class="lines">@@ -48,7 +53,7 @@
</span><span class="cx">     auto layerHostingContext = std::make_unique&lt;LayerHostingContext&gt;();
</span><span class="cx"> 
</span><span class="cx">     layerHostingContext-&gt;m_layerHostingMode = LayerHostingMode::InProcess;
</span><del>-    layerHostingContext-&gt;m_context = WKCAContextMakeRemoteWithServerPort(serverPort);
</del><ins>+    layerHostingContext-&gt;m_context = (CAContext *)WKCAContextMakeRemoteWithServerPort(serverPort);
</ins><span class="cx"> 
</span><span class="cx">     return layerHostingContext;
</span><span class="cx"> }
</span><span class="lines">@@ -62,11 +67,11 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     // Use a very large display ID to ensure that the context is never put on-screen 
</span><span class="cx">     // without being explicitly parented. See &lt;rdar://problem/16089267&gt; for details.
</span><del>-    layerHostingContext-&gt;m_context = (WKCAContextRef)[CAContext remoteContextWithOptions:@{
</del><ins>+    layerHostingContext-&gt;m_context = [CAContext remoteContextWithOptions:@{
</ins><span class="cx">         kCAContextIgnoresHitTest : @YES,
</span><span class="cx">         kCAContextDisplayId : @10000 }];
</span><span class="cx"> #else
</span><del>-    layerHostingContext-&gt;m_context = WKCAContextMakeRemoteForWindowServer();
</del><ins>+    layerHostingContext-&gt;m_context = (CAContext *)WKCAContextMakeRemoteForWindowServer();
</ins><span class="cx"> #endif
</span><span class="cx">     
</span><span class="cx">     return layerHostingContext;
</span><span class="lines">@@ -83,32 +88,37 @@
</span><span class="cx"> 
</span><span class="cx"> void LayerHostingContext::setRootLayer(CALayer *rootLayer)
</span><span class="cx"> {
</span><del>-    WKCAContextSetLayer(m_context.get(), rootLayer);
</del><ins>+    [m_context setLayer:rootLayer];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CALayer *LayerHostingContext::rootLayer() const
</span><span class="cx"> {
</span><del>-    return WKCAContextGetLayer(m_context.get());
</del><ins>+    return [m_context layer];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> uint32_t LayerHostingContext::contextID() const
</span><span class="cx"> {
</span><del>-    return WKCAContextGetContextId(m_context.get());
</del><ins>+    return [m_context contextId];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void LayerHostingContext::invalidate()
</span><span class="cx"> {
</span><del>-    WKCAContextInvalidate(m_context.get());
</del><ins>+    [m_context invalidate];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void LayerHostingContext::setColorSpace(CGColorSpaceRef colorSpace)
</span><span class="cx"> {
</span><del>-    WKCAContextSetColorSpace(m_context.get(), colorSpace);
</del><ins>+    [m_context setColorSpace:colorSpace];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CGColorSpaceRef LayerHostingContext::colorSpace() const
</span><span class="cx"> {
</span><del>-    return WKCAContextGetColorSpace(m_context.get());
</del><ins>+    return [m_context colorSpace];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void LayerHostingContext::setFencePort(mach_port_t fencePort)
+{
+    [m_context setFencePort:fencePort];
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="branchessafari6001415branchSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxymm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm (178993 => 178994)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm        2015-01-23 09:18:43 UTC (rev 178993)
+++ branches/safari-600.1.4.15-branch/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm        2015-01-23 10:04:34 UTC (rev 178994)
</span><span class="lines">@@ -23,20 +23,29 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#include &quot;config.h&quot;
-#include &quot;WebVideoFullscreenManagerProxy.h&quot;
</del><ins>+#import &quot;config.h&quot;
+#import &quot;WebVideoFullscreenManagerProxy.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> 
</span><del>-#include &quot;RemoteLayerTreeDrawingAreaProxy.h&quot;
-#include &quot;WebPageProxy.h&quot;
-#include &quot;WebProcessProxy.h&quot;
-#include &quot;WebVideoFullscreenManagerMessages.h&quot;
-#include &quot;WebVideoFullscreenManagerProxyMessages.h&quot;
-#include &lt;QuartzCore/CoreAnimation.h&gt;
-#include &lt;WebKitSystemInterface.h&gt;
-#include &lt;WebCore/TimeRanges.h&gt;
</del><ins>+#import &quot;RemoteLayerTreeDrawingAreaProxy.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/TimeRanges.h&gt;
+#import &lt;WebKitSystemInterface.h&gt;
</ins><span class="cx"> 
</span><ins>+#if USE(APPLE_INTERNAL_SDK)
+#import &lt;UIKit/UIWindow_Private.h&gt;
+#else
+#import &lt;UIKit/UIWindow.h&gt;
+@interface UIWindow (Details)
++ (mach_port_t)_synchronizeDrawingAcrossProcesses;
+@end
+#endif
+
</ins><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -188,7 +197,8 @@
</span><span class="cx"> 
</span><span class="cx"> void WebVideoFullscreenManagerProxy::setVideoLayerFrame(WebCore::FloatRect frame)
</span><span class="cx"> {
</span><del>-    m_page-&gt;send(Messages::WebVideoFullscreenManager::SetVideoLayerFrame(frame), m_page-&gt;pageID());
</del><ins>+    IPC::Attachment fencePort([UIWindow _synchronizeDrawingAcrossProcesses], MACH_MSG_TYPE_MOVE_SEND);
+    m_page-&gt;send(Messages::WebVideoFullscreenManager::SetVideoLayerFrameFenced(frame, fencePort), m_page-&gt;pageID());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebVideoFullscreenManagerProxy::setVideoLayerGravity(WebCore::WebVideoFullscreenModel::VideoGravity gravity)
</span></span></pre></div>
<a id="branchessafari6001415branchSourceWebKit2WebProcessiosWebVideoFullscreenManagerh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h (178993 => 178994)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h        2015-01-23 09:18:43 UTC (rev 178993)
+++ branches/safari-600.1.4.15-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h        2015-01-23 10:04:34 UTC (rev 178994)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace IPC {
</span><ins>+class Attachment;
</ins><span class="cx"> class Connection;
</span><span class="cx"> class MessageDecoder;
</span><span class="cx"> class MessageReceiver;
</span><span class="lines">@@ -83,6 +84,7 @@
</span><span class="cx">     virtual void didExitFullscreen();
</span><span class="cx">     virtual void didCleanupFullscreen();
</span><span class="cx">     virtual void setVideoLayerGravityEnum(unsigned);
</span><ins>+    void setVideoLayerFrameFenced(WebCore::FloatRect bounds, IPC::Attachment fencePort);
</ins><span class="cx">     
</span><span class="cx">     WebPage* m_page;
</span><span class="cx">     RefPtr&lt;WebCore::Node&gt; m_node;
</span></span></pre></div>
<a id="branchessafari6001415branchSourceWebKit2WebProcessiosWebVideoFullscreenManagermessagesin"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.messages.in (178993 => 178994)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.messages.in        2015-01-23 09:18:43 UTC (rev 178993)
+++ branches/safari-600.1.4.15-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.messages.in        2015-01-23 10:04:34 UTC (rev 178994)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx">     DidExitFullscreen()
</span><span class="cx">     DidEnterFullscreen()
</span><span class="cx">     DidCleanupFullscreen()
</span><del>-    SetVideoLayerFrame(WebCore::FloatRect bounds)
</del><ins>+    SetVideoLayerFrameFenced(WebCore::FloatRect bounds, IPC::Attachment fencePort)
</ins><span class="cx">     SetVideoLayerGravityEnum(unsigned gravity)
</span><span class="cx">     SelectAudioMediaOption(uint64_t index)
</span><span class="cx">     SelectLegibleMediaOption(uint64_t index)
</span></span></pre></div>
<a id="branchessafari6001415branchSourceWebKit2WebProcessiosWebVideoFullscreenManagermm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm (178993 => 178994)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm        2015-01-23 09:18:43 UTC (rev 178993)
+++ branches/safari-600.1.4.15-branch/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm        2015-01-23 10:04:34 UTC (rev 178994)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> 
</span><ins>+#import &quot;Attachment.h&quot;
</ins><span class="cx"> #import &quot;WebCoreArgumentCoders.h&quot;
</span><span class="cx"> #import &quot;WebPage.h&quot;
</span><span class="cx"> #import &quot;WebProcess.h&quot;
</span><span class="lines">@@ -45,6 +46,7 @@
</span><span class="cx"> #import &lt;WebCore/Settings.h&gt;
</span><span class="cx"> #import &lt;WebCore/TimeRanges.h&gt;
</span><span class="cx"> #import &lt;WebCore/WebCoreThreadRun.h&gt;
</span><ins>+#import &lt;mach/mach_port.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="lines">@@ -176,6 +178,7 @@
</span><span class="cx">     [CATransaction begin];
</span><span class="cx">     [CATransaction setDisableActions:YES];
</span><span class="cx"> 
</span><ins>+    [videoLayer setPosition:CGPointMake(0, 0)];
</ins><span class="cx">     [videoLayer setBackgroundColor:cachedCGColor(WebCore::Color::transparent, WebCore::ColorSpaceDeviceRGB)];
</span><span class="cx"> 
</span><span class="cx">     // Set a scale factor here to make convertRect:toLayer:nil take scale factor into account. &lt;rdar://problem/18316542&gt;.
</span><span class="lines">@@ -241,6 +244,13 @@
</span><span class="cx"> {
</span><span class="cx">     setVideoLayerGravity((WebVideoFullscreenModel::VideoGravity)gravity);
</span><span class="cx"> }
</span><ins>+    
+void WebVideoFullscreenManager::setVideoLayerFrameFenced(WebCore::FloatRect bounds, IPC::Attachment fencePort)
+{
+    m_layerHostingContext-&gt;setFencePort(fencePort.port());
+    setVideoLayerFrame(bounds);
+    mach_port_deallocate(mach_task_self(), fencePort.port());
+}
</ins><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>