<!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>[164617] 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/164617">164617</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-02-24 16:40:06 -0800 (Mon, 24 Feb 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>WK2 AVKit fullscreen doesn't display video.
https://bugs.webkit.org/show_bug.cgi?id=128564
Patch by Jeremy Jones <jeremyj@apple.com> on 2014-02-24
Reviewed by Simon Fraser.
Source/WebCore:
* WebCore.exp.in:
Export WebCore::PlatformCALayer::platformCALayer()
* platform/ios/WebVideoFullscreenInterface.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
Remove SetVideoLayerID().
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::setVideoLayer):
Wrap make video layer look like an AVAVPlayerLayer with WebAVPlayerLayer
* platform/ios/WebVideoFullscreenModelMediaElement.mm:
(WebVideoFullscreenModelMediaElement::setMediaElement):
Pass along the videoLayer before borrowing it so the interface will be ready to
catch the transaction that removes it.
Source/WebKit2:
* Shared/mac/RemoteLayerTreeTransaction.h:
Add a property to track video layer pending fullscreen.
(WebKit::RemoteLayerTreeTransaction::isVideoLayerIDPendingFullscreen):
(WebKit::RemoteLayerTreeTransaction::addVideoLayerIDPendingFullscreen):
Add a property to track video layer pending fullscreen.
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode):
(WebKit::RemoteLayerTreeTransaction::decode):
Encode and decode m_videoLayerIDsPendingFullscreen.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didCommitLayerTree):
Let WebVideoFullscreenManagerProxy see the RemoteLayerTreeTransaction.
* UIProcess/ios/WebVideoFullscreenManagerProxy.cpp:
(WebKit::WebVideoFullscreenManagerProxy::didCommitLayerTree):
Look for video layer pending fullscreen on the transaction to initiate
fullscreen.
(WebKit::WebVideoFullscreenManagerProxy::setVideoLayerID):
Start looking for the video layer pending fullscreen in the transaction.
(WebKit::WebVideoFullscreenManagerProxy::enterFullscreen):
Override to prevent fullscreen from happening before the layer
is pending fullscreen.
* UIProcess/ios/WebVideoFullscreenManagerProxy.h:
* UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
Pass a more specific videoLayerID in SetVideoLayerID,
i.e. WebCore::GraphicsLayer::PlatformLayerID.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::willCommitLayerTree):
Move webPage specific transaction building here, including,
giving WebVideoFullscreenManager a chance to modify the transaction.
* WebProcess/WebPage/WebPage.h:
Add willCommitLayerTree();
* WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
(PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
(PlatformCALayerRemoteCustom::~PlatformCALayerRemoteCustom):
Make and break the connection from CALayer to PlatformCALayerRemoteCustom,
the same way it is done for PlatformCALayerMac.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
Move WebPage specific transaction building into WebPage::willCommitLayerTree.
* WebProcess/ios/WebVideoFullscreenManager.cpp:
(WebKit::WebVideoFullscreenManager::willCommitLayerTree):
addVideoLayerIDPendingFullscreen on RemoteLayerTreeTransaction when needed.
(WebKit::WebVideoFullscreenManager::setVideoLayer):
Pass along the video layerID.
* WebProcess/ios/WebVideoFullscreenManager.h:
Add willCommitLayerTree() and remove setVideoLayerID().
Add a member to retain the unparented PlatformCALayer.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenInterfaceh">trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterface.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKith">trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKitmm">trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenModelMediaElementmm">trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionh">trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h</a></li>
<li><a href="#trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionmm">trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm">trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxycpp">trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.cpp</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="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteCustommm">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreamm">trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagercpp">trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagerh">trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (164616 => 164617)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-02-25 00:29:28 UTC (rev 164616)
+++ trunk/Source/WebCore/ChangeLog        2014-02-25 00:40:06 UTC (rev 164617)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2014-02-24 Jeremy Jones <jeremyj@apple.com>
+
+ WK2 AVKit fullscreen doesn't display video.
+ https://bugs.webkit.org/show_bug.cgi?id=128564
+
+ Reviewed by Simon Fraser.
+
+ * WebCore.exp.in:
+ Export WebCore::PlatformCALayer::platformCALayer()
+
+ * platform/ios/WebVideoFullscreenInterface.h:
+ * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
+ Remove SetVideoLayerID().
+
+ * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
+ (WebVideoFullscreenInterfaceAVKit::setVideoLayer):
+ Wrap make video layer look like an AVAVPlayerLayer with WebAVPlayerLayer
+
+ * platform/ios/WebVideoFullscreenModelMediaElement.mm:
+ (WebVideoFullscreenModelMediaElement::setMediaElement):
+ Pass along the videoLayer before borrowing it so the interface will be ready to
+ catch the transaction that removes it.
+
</ins><span class="cx"> 2014-02-24 Samuel White <samuel_white@apple.com>
</span><span class="cx">
</span><span class="cx"> AX: AccessibilityObject::findMatchingObjects should never include 'this' in results.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (164616 => 164617)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-02-25 00:29:28 UTC (rev 164616)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-02-25 00:40:06 UTC (rev 164617)
</span><span class="lines">@@ -589,6 +589,7 @@
</span><span class="cx"> __ZN7WebCore15JSDOMWindowBase8commonVMEv
</span><span class="cx"> __ZN7WebCore15PasteboardImageC1Ev
</span><span class="cx"> __ZN7WebCore15PasteboardImageD1Ev
</span><ins>+__ZN7WebCore15PlatformCALayer15platformCALayerEPv
</ins><span class="cx"> __ZN7WebCore15PlatformCALayerC2ENS0_9LayerTypeEPNS_21PlatformCALayerClientE
</span><span class="cx"> __ZN7WebCore15PlatformCALayerD2Ev
</span><span class="cx"> __ZN7WebCore15ProtectionSpaceC1ERKN3WTF6StringEiNS_25ProtectionSpaceServerTypeES4_NS_35ProtectionSpaceAuthenticationSchemeE
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenInterfaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterface.h (164616 => 164617)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterface.h        2014-02-25 00:29:28 UTC (rev 164616)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterface.h        2014-02-25 00:40:06 UTC (rev 164617)
</span><span class="lines">@@ -41,7 +41,6 @@
</span><span class="cx"> virtual void setRate(bool isPlaying, float playbackRate) = 0;
</span><span class="cx"> virtual void setVideoDimensions(bool hasVideo, float width, float height) = 0;
</span><span class="cx"> virtual void setVideoLayer(PlatformLayer*) = 0;
</span><del>- virtual void setVideoLayerID(uint32_t) = 0;
</del><span class="cx"> virtual void enterFullscreen() = 0;
</span><span class="cx"> virtual void exitFullscreen() = 0;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKith"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h (164616 => 164617)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h        2014-02-25 00:29:28 UTC (rev 164616)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h        2014-02-25 00:40:06 UTC (rev 164617)
</span><span class="lines">@@ -66,7 +66,6 @@
</span><span class="cx"> void setRate(bool isPlaying, float playbackRate) override;
</span><span class="cx"> void setVideoDimensions(bool hasVideo, float width, float height) override;
</span><span class="cx"> void setVideoLayer(PlatformLayer*) override;
</span><del>- void setVideoLayerID(uint32_t) override { };
</del><span class="cx"> void enterFullscreen() override;
</span><span class="cx"> void enterFullscreenWithCompletionHandler(std::function<void()>);
</span><span class="cx"> void exitFullscreen() override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKitmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm (164616 => 164617)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm        2014-02-25 00:29:28 UTC (rev 164616)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm        2014-02-25 00:40:06 UTC (rev 164617)
</span><span class="lines">@@ -68,6 +68,9 @@
</span><span class="cx"> @end
</span><span class="cx">
</span><span class="cx"> @protocol AVPlayerLayer
</span><ins>+@property (nonatomic, copy) NSString *videoGravity;
+@property (nonatomic, readonly, getter = isReadyForDisplay) BOOL readyForDisplay;
+@property (nonatomic, readonly) CGRect videoRect;
</ins><span class="cx"> @end
</span><span class="cx">
</span><span class="cx"> @interface AVPlayerController : UIResponder
</span><span class="lines">@@ -202,6 +205,20 @@
</span><span class="cx">
</span><span class="cx"> @end
</span><span class="cx">
</span><ins>+@interface WebAVPlayerLayer : CALayer <AVPlayerLayer>
++(WebAVPlayerLayer *)playerLayer;
+@property (nonatomic, copy) NSString *videoGravity;
+@property (nonatomic, getter = isReadyForDisplay) BOOL readyForDisplay;
+@property (nonatomic) CGRect videoRect;
+@end
+
+@implementation WebAVPlayerLayer
++(WebAVPlayerLayer *)playerLayer
+{
+ return [[[WebAVPlayerLayer alloc] init] autorelease];
+}
+@end
+
</ins><span class="cx"> WebVideoFullscreenInterfaceAVKit::WebVideoFullscreenInterfaceAVKit()
</span><span class="cx"> : m_videoFullscreenModel(nullptr)
</span><span class="cx"> {
</span><span class="lines">@@ -278,10 +295,19 @@
</span><span class="cx"> {
</span><span class="cx"> [playerController().playerLayer removeFromSuperlayer];
</span><span class="cx"> [videoLayer removeFromSuperlayer];
</span><del>- ASSERT(!videoLayer
- || [videoLayer isKindOfClass:[classAVPlayerLayer class]]
- || ([videoLayer isKindOfClass:[CALayer class]] && [videoLayer conformsToProtocol:@protocol(AVPlayerLayer)]));
- playerController().playerLayer = (CALayer<AVPlayerLayer>*)videoLayer;
</del><ins>+
+ CALayer<AVPlayerLayer> *avPlayerLayer = nil;
+
+ // WebKit provides a AVPlayerLayer. WebKit2 provies a hosted layer.
+ if ([videoLayer isKindOfClass:[classAVPlayerLayer class]])
+ avPlayerLayer = (CALayer<AVPlayerLayer>*)videoLayer;
+ else if (videoLayer) {
+ ASSERT([videoLayer isKindOfClass:[CALayer class]]);
+ avPlayerLayer = [WebAVPlayerLayer playerLayer];
+ [avPlayerLayer addSublayer:videoLayer];
+ }
+
+ m_playerController.get().playerLayer = avPlayerLayer;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebVideoFullscreenInterfaceAVKit::enterFullscreenWithCompletionHandler(std::function<void()> completion)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenModelMediaElementmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm (164616 => 164617)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm        2014-02-25 00:29:28 UTC (rev 164616)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm        2014-02-25 00:40:06 UTC (rev 164617)
</span><span class="lines">@@ -94,8 +94,9 @@
</span><span class="cx"> m_videoFullscreenInterface->setDuration(m_mediaElement->duration());
</span><span class="cx"> m_videoFullscreenInterface->setRate(m_mediaElement->isPlaying(), m_mediaElement->playbackRate());
</span><span class="cx">
</span><ins>+ m_videoFullscreenInterface->setVideoLayer(m_mediaElement->platformLayer());
+
</ins><span class="cx"> m_borrowedVideoLayer = m_mediaElement->borrowPlatformLayer();
</span><del>- m_videoFullscreenInterface->setVideoLayer(m_borrowedVideoLayer.get());
</del><span class="cx">
</span><span class="cx"> m_videoFullscreenInterface->setCurrentTime(m_mediaElement->currentTime(), [[NSProcessInfo processInfo] systemUptime]);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (164616 => 164617)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-02-25 00:29:28 UTC (rev 164616)
+++ trunk/Source/WebKit2/ChangeLog        2014-02-25 00:40:06 UTC (rev 164617)
</span><span class="lines">@@ -1,3 +1,72 @@
</span><ins>+2014-02-24 Jeremy Jones <jeremyj@apple.com>
+
+ WK2 AVKit fullscreen doesn't display video.
+ https://bugs.webkit.org/show_bug.cgi?id=128564
+
+ Reviewed by Simon Fraser.
+
+ * Shared/mac/RemoteLayerTreeTransaction.h:
+ Add a property to track video layer pending fullscreen.
+
+ (WebKit::RemoteLayerTreeTransaction::isVideoLayerIDPendingFullscreen):
+ (WebKit::RemoteLayerTreeTransaction::addVideoLayerIDPendingFullscreen):
+ Add a property to track video layer pending fullscreen.
+
+ * Shared/mac/RemoteLayerTreeTransaction.mm:
+ (WebKit::RemoteLayerTreeTransaction::encode):
+ (WebKit::RemoteLayerTreeTransaction::decode):
+ Encode and decode m_videoLayerIDsPendingFullscreen.
+
+ * UIProcess/ios/WebPageProxyIOS.mm:
+ (WebKit::WebPageProxy::didCommitLayerTree):
+ Let WebVideoFullscreenManagerProxy see the RemoteLayerTreeTransaction.
+
+ * UIProcess/ios/WebVideoFullscreenManagerProxy.cpp:
+ (WebKit::WebVideoFullscreenManagerProxy::didCommitLayerTree):
+ Look for video layer pending fullscreen on the transaction to initiate
+ fullscreen.
+
+ (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerID):
+ Start looking for the video layer pending fullscreen in the transaction.
+
+ (WebKit::WebVideoFullscreenManagerProxy::enterFullscreen):
+ Override to prevent fullscreen from happening before the layer
+ is pending fullscreen.
+
+ * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
+ * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
+ Pass a more specific videoLayerID in SetVideoLayerID,
+ i.e. WebCore::GraphicsLayer::PlatformLayerID.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::willCommitLayerTree):
+ Move webPage specific transaction building here, including,
+ giving WebVideoFullscreenManager a chance to modify the transaction.
+
+ * WebProcess/WebPage/WebPage.h:
+ Add willCommitLayerTree();
+
+ * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
+ (PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
+ (PlatformCALayerRemoteCustom::~PlatformCALayerRemoteCustom):
+ Make and break the connection from CALayer to PlatformCALayerRemoteCustom,
+ the same way it is done for PlatformCALayerMac.
+
+ * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+ (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
+ Move WebPage specific transaction building into WebPage::willCommitLayerTree.
+
+ * WebProcess/ios/WebVideoFullscreenManager.cpp:
+ (WebKit::WebVideoFullscreenManager::willCommitLayerTree):
+ addVideoLayerIDPendingFullscreen on RemoteLayerTreeTransaction when needed.
+
+ (WebKit::WebVideoFullscreenManager::setVideoLayer):
+ Pass along the video layerID.
+
+ * WebProcess/ios/WebVideoFullscreenManager.h:
+ Add willCommitLayerTree() and remove setVideoLayerID().
+ Add a member to retain the unparented PlatformCALayer.
+
</ins><span class="cx"> 2014-02-24 Martin Hock <mhock@apple.com>
</span><span class="cx">
</span><span class="cx"> Create SessionID value-style class for session IDs.
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h (164616 => 164617)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h        2014-02-25 00:29:28 UTC (rev 164616)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h        2014-02-25 00:40:06 UTC (rev 164617)
</span><span class="lines">@@ -176,6 +176,9 @@
</span><span class="cx">
</span><span class="cx"> bool allowsUserScaling() const { return m_allowsUserScaling; }
</span><span class="cx"> void setAllowsUserScaling(bool allowsUserScaling) { m_allowsUserScaling = allowsUserScaling; }
</span><ins>+
+ bool isVideoLayerIDPendingFullscreen(WebCore::GraphicsLayer::PlatformLayerID layerID) const { return m_videoLayerIDsPendingFullscreen.contains(layerID); }
+ void addVideoLayerIDPendingFullscreen(WebCore::GraphicsLayer::PlatformLayerID layerID) { m_videoLayerIDsPendingFullscreen.append(layerID); }
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> WebCore::GraphicsLayer::PlatformLayerID m_rootLayerID;
</span><span class="lines">@@ -188,6 +191,7 @@
</span><span class="cx"> double m_minimumScaleFactor;
</span><span class="cx"> double m_maximumScaleFactor;
</span><span class="cx"> bool m_allowsUserScaling;
</span><ins>+ Vector<WebCore::GraphicsLayer::PlatformLayerID> m_videoLayerIDsPendingFullscreen;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (164616 => 164617)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm        2014-02-25 00:29:28 UTC (rev 164616)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm        2014-02-25 00:40:06 UTC (rev 164617)
</span><span class="lines">@@ -414,6 +414,7 @@
</span><span class="cx"> encoder << m_maximumScaleFactor;
</span><span class="cx"> encoder << m_allowsUserScaling;
</span><span class="cx"> encoder << m_renderTreeSize;
</span><ins>+ encoder << m_videoLayerIDsPendingFullscreen;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool RemoteLayerTreeTransaction::decode(IPC::ArgumentDecoder& decoder, RemoteLayerTreeTransaction& result)
</span><span class="lines">@@ -467,6 +468,9 @@
</span><span class="cx">
</span><span class="cx"> if (!decoder.decode(result.m_renderTreeSize))
</span><span class="cx"> return false;
</span><ins>+
+ if (!decoder.decode(result.m_videoLayerIDsPendingFullscreen))
+ return false;
</ins><span class="cx">
</span><span class="cx"> return true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (164616 => 164617)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2014-02-25 00:29:28 UTC (rev 164616)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2014-02-25 00:40:06 UTC (rev 164617)
</span><span class="lines">@@ -32,9 +32,10 @@
</span><span class="cx"> #import "WebKitSystemInterfaceIOS.h"
</span><span class="cx"> #import "WebPageMessages.h"
</span><span class="cx"> #import "WebProcessProxy.h"
</span><ins>+#import "WebVideoFullscreenManagerProxy.h"
</ins><span class="cx"> #import <WebCore/NotImplemented.h>
</span><ins>+#import <WebCore/SharedBuffer.h>
</ins><span class="cx"> #import <WebCore/UserAgent.h>
</span><del>-#import <WebCore/SharedBuffer.h>
</del><span class="cx">
</span><span class="cx"> using namespace WebCore;
</span><span class="cx">
</span><span class="lines">@@ -247,6 +248,8 @@
</span><span class="cx"> void WebPageProxy::didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction& layerTreeTransaction)
</span><span class="cx"> {
</span><span class="cx"> m_pageClient.didCommitLayerTree(layerTreeTransaction);
</span><ins>+ if (m_videoFullscreenManager)
+ m_videoFullscreenManager->didCommitLayerTree(layerTreeTransaction);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebPageProxy::selectWithGesture(const WebCore::IntPoint point, WebCore::TextGranularity granularity, uint32_t gestureType, uint32_t gestureState, PassRefPtr<GestureCallback> callback)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.cpp (164616 => 164617)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.cpp        2014-02-25 00:29:28 UTC (rev 164616)
+++ trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.cpp        2014-02-25 00:40:06 UTC (rev 164617)
</span><span class="lines">@@ -28,6 +28,9 @@
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">
</span><ins>+#include "DrawingAreaProxy.h"
+#include "RemoteLayerTreeDrawingAreaProxy.h"
+#include "RemoteLayerTreeTransaction.h"
</ins><span class="cx"> #include "WebPageProxy.h"
</span><span class="cx"> #include "WebProcessProxy.h"
</span><span class="cx"> #include "WebVideoFullscreenManagerMessages.h"
</span><span class="lines">@@ -44,6 +47,8 @@
</span><span class="cx">
</span><span class="cx"> WebVideoFullscreenManagerProxy::WebVideoFullscreenManagerProxy(WebPageProxy& page)
</span><span class="cx"> : m_page(&page)
</span><ins>+ , m_enterFullscreenAfterVideoLayerUnparentedTransaction(false)
+ , m_videoLayerID(0)
</ins><span class="cx"> {
</span><span class="cx"> m_page->process().addMessageReceiver(Messages::WebVideoFullscreenManagerProxy::messageReceiverName(), m_page->pageID(), *this);
</span><span class="cx"> setWebVideoFullscreenModel(this);
</span><span class="lines">@@ -54,12 +59,26 @@
</span><span class="cx"> m_page->process().removeMessageReceiver(Messages::WebVideoFullscreenManagerProxy::messageReceiverName(), m_page->pageID());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebVideoFullscreenManagerProxy::setVideoLayerID(uint32_t videoLayerID)
</del><ins>+void WebVideoFullscreenManagerProxy::didCommitLayerTree(const RemoteLayerTreeTransaction& layerTreeTransaction)
</ins><span class="cx"> {
</span><del>- // TODO: find a real video layer or make one that meets the necessary requirements.
- setVideoLayer(nullptr);
</del><ins>+ if (m_enterFullscreenAfterVideoLayerUnparentedTransaction && layerTreeTransaction.isVideoLayerIDPendingFullscreen(m_videoLayerID)) {
+ m_enterFullscreenAfterVideoLayerUnparentedTransaction = false;
+ WebCore::WebVideoFullscreenInterfaceAVKit::enterFullscreen();
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebVideoFullscreenManagerProxy::setVideoLayerID(GraphicsLayer::PlatformLayerID videoLayerID)
+{
+ RemoteLayerTreeDrawingAreaProxy* remoteDrawingAreaProxy = toRemoteLayerTreeDrawingAreaProxy(m_page->drawingArea());
+ setVideoLayer(remoteDrawingAreaProxy->remoteLayerTreeHost().getLayer(videoLayerID));
+ m_videoLayerID = videoLayerID;
+ m_enterFullscreenAfterVideoLayerUnparentedTransaction = true;
+}
+
+void WebVideoFullscreenManagerProxy::enterFullscreen()
+{
+}
+
</ins><span class="cx"> void WebVideoFullscreenManagerProxy::requestExitFullScreen()
</span><span class="cx"> {
</span><span class="cx"> m_page->send(Messages::WebVideoFullscreenManager::RequestExitFullScreen(), m_page->pageID());
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h (164616 => 164617)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h        2014-02-25 00:29:28 UTC (rev 164616)
+++ trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h        2014-02-25 00:40:06 UTC (rev 164617)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">
</span><span class="cx"> #include "MessageReceiver.h"
</span><ins>+#include <WebCore/GraphicsLayer.h>
</ins><span class="cx"> #include <WebCore/WebVideoFullscreenInterfaceAVKit.h>
</span><span class="cx"> #include <WebCore/WebVideoFullscreenModel.h>
</span><span class="cx"> #include <wtf/PassRefPtr.h>
</span><span class="lines">@@ -38,17 +39,21 @@
</span><span class="cx"> namespace WebKit {
</span><span class="cx">
</span><span class="cx"> class WebPageProxy;
</span><ins>+class RemoteLayerTreeTransaction;
</ins><span class="cx">
</span><span class="cx"> class WebVideoFullscreenManagerProxy : public WebCore::WebVideoFullscreenInterfaceAVKit, public WebCore::WebVideoFullscreenModel, private IPC::MessageReceiver {
</span><span class="cx"> public:
</span><span class="cx"> static PassRefPtr<WebVideoFullscreenManagerProxy> create(WebPageProxy&);
</span><span class="cx"> virtual ~WebVideoFullscreenManagerProxy();
</span><span class="cx">
</span><ins>+ void didCommitLayerTree(const RemoteLayerTreeTransaction&);
+
</ins><span class="cx"> private:
</span><span class="cx"> explicit WebVideoFullscreenManagerProxy(WebPageProxy&);
</span><span class="cx"> virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&) override;
</span><span class="cx">
</span><del>- virtual void setVideoLayerID(uint32_t) override;
</del><ins>+ virtual void setVideoLayerID(WebCore::GraphicsLayer::PlatformLayerID);
+ virtual void enterFullscreen() override;
</ins><span class="cx">
</span><span class="cx"> virtual void requestExitFullScreen() override;
</span><span class="cx"> virtual void play() override;
</span><span class="lines">@@ -58,6 +63,8 @@
</span><span class="cx"> virtual void didExitFullscreen() override;
</span><span class="cx">
</span><span class="cx"> WebPageProxy* m_page;
</span><ins>+ bool m_enterFullscreenAfterVideoLayerUnparentedTransaction;
+ WebCore::GraphicsLayer::PlatformLayerID m_videoLayerID;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in (164616 => 164617)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in        2014-02-25 00:29:28 UTC (rev 164616)
+++ trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in        2014-02-25 00:40:06 UTC (rev 164617)
</span><span class="lines">@@ -24,7 +24,7 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> messages -> WebVideoFullscreenManagerProxy {
</span><span class="cx"> SetCurrentTime(double currentTime, double hostTime)
</span><del>- SetVideoLayerID(uint32_t videoLayerID)
</del><ins>+ SetVideoLayerID(WebCore::GraphicsLayer::PlatformLayerID videoLayerID)
</ins><span class="cx"> SetVideoDimensions(bool hasVideo, unsigned width, unsigned height)
</span><span class="cx"> SetDuration(double duration)
</span><span class="cx"> SetRate(bool isPlaying, double rate)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (164616 => 164617)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-02-25 00:29:28 UTC (rev 164616)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-02-25 00:40:06 UTC (rev 164617)
</span><span class="lines">@@ -171,6 +171,7 @@
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> #include "PDFPlugin.h"
</span><ins>+#include "RemoteLayerTreeTransaction.h"
</ins><span class="cx"> #include <WebCore/LegacyWebArchive.h>
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="lines">@@ -2623,6 +2624,23 @@
</span><span class="cx"> m_drawingArea->updatePreferences(store);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#if PLATFORM(COCOA)
+void WebPage::willCommitLayerTree(RemoteLayerTreeTransaction& layerTransaction)
+{
+ layerTransaction.setContentsSize(corePage()->mainFrame().view()->contentsSize());
+ layerTransaction.setPageScaleFactor(corePage()->pageScaleFactor());
+ layerTransaction.setRenderTreeSize(corePage()->renderTreeSize());
+#if PLATFORM(IOS)
+ layerTransaction.setMinimumScaleFactor(minimumPageScaleFactor());
+ layerTransaction.setMaximumScaleFactor(maximumPageScaleFactor());
+ layerTransaction.setAllowsUserScaling(allowsUserScaling());
+ if (m_videoFullscreenManager)
+ m_videoFullscreenManager->willCommitLayerTree(layerTransaction);
+#endif
+}
+#endif
+
+
</ins><span class="cx"> #if ENABLE(INSPECTOR)
</span><span class="cx"> WebInspector* WebPage::inspector()
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (164616 => 164617)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-02-25 00:29:28 UTC (rev 164616)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-02-25 00:40:06 UTC (rev 164617)
</span><span class="lines">@@ -167,6 +167,10 @@
</span><span class="cx"> struct WebPageCreationParameters;
</span><span class="cx"> struct WebPreferencesStore;
</span><span class="cx">
</span><ins>+#if PLATFORM(COCOA)
+class RemoteLayerTreeTransaction;
+#endif
+
</ins><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="cx"> class WebTouchEvent;
</span><span class="cx"> #endif
</span><span class="lines">@@ -207,6 +211,10 @@
</span><span class="cx"> bool scrollBy(uint32_t scrollDirection, uint32_t scrollGranularity);
</span><span class="cx">
</span><span class="cx"> void centerSelectionInVisibleArea();
</span><ins>+
+#if PLATFORM(COCOA)
+ void willCommitLayerTree(RemoteLayerTreeTransaction&);
+#endif
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><span class="cx"> WebInspector* inspector();
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteCustommm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm (164616 => 164617)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm        2014-02-25 00:29:28 UTC (rev 164616)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm        2014-02-25 00:40:06 UTC (rev 164617)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> using namespace WebKit;
</span><span class="cx">
</span><ins>+static NSString * const platformCALayerPointer = @"WKPlatformCALayer";
</ins><span class="cx"> PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom(PlatformLayer* customLayer, PlatformCALayerClient* owner, RemoteLayerTreeContext* context)
</span><span class="cx"> : PlatformCALayerRemote(LayerTypeCustom, owner, context)
</span><span class="cx"> {
</span><span class="lines">@@ -54,6 +55,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> m_layerHostingContext->setRootLayer(customLayer);
</span><ins>+ [customLayer setValue:[NSValue valueWithPointer:this] forKey:platformCALayerPointer];
</ins><span class="cx">
</span><span class="cx"> m_platformLayer = customLayer;
</span><span class="cx"> [customLayer web_disableAllActions];
</span><span class="lines">@@ -63,6 +65,7 @@
</span><span class="cx">
</span><span class="cx"> PlatformCALayerRemoteCustom::~PlatformCALayerRemoteCustom()
</span><span class="cx"> {
</span><ins>+ [m_platformLayer setValue:nil forKey:platformCALayerPointer];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> uint32_t PlatformCALayerRemoteCustom::hostingContextID()
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm (164616 => 164617)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm        2014-02-25 00:29:28 UTC (rev 164616)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm        2014-02-25 00:40:06 UTC (rev 164617)
</span><span class="lines">@@ -321,14 +321,7 @@
</span><span class="cx"> // FIXME: minize these transactions if nothing changed.
</span><span class="cx"> RemoteLayerTreeTransaction layerTransaction;
</span><span class="cx"> m_remoteLayerTreeContext->buildTransaction(layerTransaction, *m_rootLayer);
</span><del>- layerTransaction.setContentsSize(m_webPage->corePage()->mainFrame().view()->contentsSize());
- layerTransaction.setPageScaleFactor(m_webPage->corePage()->pageScaleFactor());
- layerTransaction.setRenderTreeSize(m_webPage->corePage()->renderTreeSize());
-#if PLATFORM(IOS)
- layerTransaction.setMinimumScaleFactor(m_webPage->minimumPageScaleFactor());
- layerTransaction.setMaximumScaleFactor(m_webPage->maximumPageScaleFactor());
- layerTransaction.setAllowsUserScaling(m_webPage->allowsUserScaling());
-#endif
</del><ins>+ m_webPage->willCommitLayerTree(layerTransaction);
</ins><span class="cx">
</span><span class="cx"> RemoteScrollingCoordinatorTransaction scrollingTransaction;
</span><span class="cx"> #if ENABLE(ASYNC_SCROLLING)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.cpp (164616 => 164617)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.cpp        2014-02-25 00:29:28 UTC (rev 164616)
+++ trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.cpp        2014-02-25 00:40:06 UTC (rev 164617)
</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>+#include "RemoteLayerTreeTransaction.h"
</ins><span class="cx"> #include "WebPage.h"
</span><span class="cx"> #include "WebProcess.h"
</span><span class="cx"> #include "WebVideoFullscreenManagerMessages.h"
</span><span class="lines">@@ -35,6 +36,7 @@
</span><span class="cx"> #include <WebCore/EventNames.h>
</span><span class="cx"> #include <WebCore/HTMLVideoElement.h>
</span><span class="cx"> #include <WebCore/Settings.h>
</span><ins>+#include <Webcore/PlatformCALayer.h>
</ins><span class="cx">
</span><span class="cx"> using namespace WebCore;
</span><span class="cx">
</span><span class="lines">@@ -47,6 +49,7 @@
</span><span class="cx">
</span><span class="cx"> WebVideoFullscreenManager::WebVideoFullscreenManager(PassRefPtr<WebPage> page)
</span><span class="cx"> : m_page(page.get())
</span><ins>+ , m_sendUnparentVideoLayerTransaction(false)
</ins><span class="cx"> {
</span><span class="cx"> setWebVideoFullscreenInterface(this);
</span><span class="cx"> WebProcess::shared().addMessageReceiver(Messages::WebVideoFullscreenManager::messageReceiverName(), page->pageID(), *this);
</span><span class="lines">@@ -57,6 +60,14 @@
</span><span class="cx"> WebProcess::shared().removeMessageReceiver(Messages::WebVideoFullscreenManager::messageReceiverName(), m_page->pageID());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebVideoFullscreenManager::willCommitLayerTree(RemoteLayerTreeTransaction& transaction)
+{
+ if (m_sendUnparentVideoLayerTransaction) {
+ transaction.addVideoLayerIDPendingFullscreen(m_platformCALayer->layerID());
+ m_sendUnparentVideoLayerTransaction = false;
+ }
+}
+
</ins><span class="cx"> bool WebVideoFullscreenManager::supportsFullscreen(const Node* node) const
</span><span class="cx"> {
</span><span class="cx"> if (!Settings::avKitEnabled())
</span><span class="lines">@@ -98,15 +109,12 @@
</span><span class="cx"> m_page->send(Messages::WebVideoFullscreenManagerProxy::SetVideoDimensions(hasVideo, width, height), m_page->pageID());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebVideoFullscreenManager::setVideoLayer(PlatformLayer*)
</del><ins>+void WebVideoFullscreenManager::setVideoLayer(PlatformLayer* videoLayer)
</ins><span class="cx"> {
</span><del>- // TODO: implement with correct layer ID.
- m_page->send(Messages::WebVideoFullscreenManagerProxy::SetVideoLayerID(0), m_page->pageID());
-}
</del><ins>+ m_platformCALayer = PlatformCALayer::platformCALayer(videoLayer);
+ m_sendUnparentVideoLayerTransaction = !!m_platformCALayer;
</ins><span class="cx">
</span><del>-void WebVideoFullscreenManager::setVideoLayerID(uint32_t videoLayerID)
-{
- m_page->send(Messages::WebVideoFullscreenManagerProxy::SetVideoLayerID(videoLayerID), m_page->pageID());
</del><ins>+ m_page->send(Messages::WebVideoFullscreenManagerProxy::SetVideoLayerID(m_platformCALayer ? m_platformCALayer->layerID() : 0), m_page->pageID());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebVideoFullscreenManager::enterFullscreen()
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h (164616 => 164617)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h        2014-02-25 00:29:28 UTC (rev 164616)
+++ trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h        2014-02-25 00:40:06 UTC (rev 164617)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx">
</span><span class="cx"> #include "MessageReceiver.h"
</span><span class="cx"> #include <WebCore/EventListener.h>
</span><ins>+#include <WebCore/PlatformCALayer.h>
</ins><span class="cx"> #include <WebCore/WebVideoFullscreenInterface.h>
</span><span class="cx"> #include <WebCore/WebVideoFullscreenModelMediaElement.h>
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="lines">@@ -47,6 +48,7 @@
</span><span class="cx"> namespace WebKit {
</span><span class="cx">
</span><span class="cx"> class WebPage;
</span><ins>+class RemoteLayerTreeTransaction;
</ins><span class="cx">
</span><span class="cx"> class WebVideoFullscreenManager : public WebCore::WebVideoFullscreenModelMediaElement, public WebCore::WebVideoFullscreenInterface, private IPC::MessageReceiver {
</span><span class="cx"> public:
</span><span class="lines">@@ -55,6 +57,8 @@
</span><span class="cx">
</span><span class="cx"> void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&);
</span><span class="cx">
</span><ins>+ void willCommitLayerTree(RemoteLayerTreeTransaction&);
+
</ins><span class="cx"> bool supportsFullscreen(const WebCore::Node*) const;
</span><span class="cx"> void enterFullscreenForNode(WebCore::Node*);
</span><span class="cx"> void exitFullscreenForNode(WebCore::Node*);
</span><span class="lines">@@ -68,12 +72,13 @@
</span><span class="cx"> virtual void setRate(bool isPlaying, float playbackRate) override;
</span><span class="cx"> virtual void setVideoDimensions(bool hasVideo, float width, float height) override;
</span><span class="cx"> virtual void setVideoLayer(PlatformLayer*) override;
</span><del>- virtual void setVideoLayerID(uint32_t) override;
</del><span class="cx"> virtual void enterFullscreen() override;
</span><span class="cx"> virtual void exitFullscreen() override;
</span><span class="cx">
</span><span class="cx"> WebPage* m_page;
</span><span class="cx"> RefPtr<WebCore::Node> m_node;
</span><ins>+ RefPtr<WebCore::PlatformCALayer> m_platformCALayer;
+ bool m_sendUnparentVideoLayerTransaction;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebKit
</span></span></pre>
</div>
</div>
</body>
</html>