<!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>[186662] 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/186662">186662</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2015-07-09 20:45:10 -0700 (Thu, 09 Jul 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use CoreAnimation fences instead of synchronous IPC to synchronize resize
https://bugs.webkit.org/show_bug.cgi?id=146294
&lt;rdar://problem/21090193&gt;

Reviewed by Anders Carlsson.

Because of changes in underlying frameworks, we can no longer depend on
blocking the UI process main thread to be sufficient to synchronize
UI process CA commits with commits coming from the Web process.

Instead, we have to use CoreAnimation fences to perform this synchronization.
Instead of blocking inside waitForAndDispatchImmediately, we'll end up
blocking during the CA commit.

* Platform/mac/LayerHostingContext.mm:
Use HAVE(COREANIMATION_FENCES).

* Platform/IPC/Connection.cpp:
(IPC::Connection::Connection):
(IPC::Connection::processIncomingMessage):
(IPC::Connection::installIncomingSyncMessageCallback):
(IPC::Connection::uninstallIncomingSyncMessageCallback):
Keep track of a set of incoming sync message callbacks, and fire them
(on another queue) when a sync message arrives.

(IPC::Connection::hasIncomingSyncMessage):
* Platform/IPC/Connection.h:
Add a way to check if there are any sync messages in the queue.

* UIProcess/API/mac/WKView.mm:
(-[WKView forceAsyncDrawingAreaSizeUpdate:]):
(-[WKView waitForAsyncDrawingAreaSizeUpdate]):
These are no longer used; do nothing on 10.10+.

* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::updateGeometry):
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::scaleViewAndUpdateGeometryFenced):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
Add a MachSendRight parameter to UpdateGeometry, so that we can send along
a fence port with the geometry update if needed.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
Apply the incoming fence so that geometry changes will be synchronized between processes.

* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::waitForPossibleGeometryUpdate):
Don't wait for DidUpdateGeometry to come in if we're using fences to achieve the same thing.

(WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
Create and block us on a fence and send it along with the geometry update.
If a sync message is in the incoming message queue, don't create the fence;
if a sync message comes in at any point after we've installed the fence (but
before the relevant commit completes), invalidate the fence, so that we won't
end up temorarily deadlocked waiting for the fence timeout.

* platform/cocoa/MachSendRight.h:
Export some constructors.

* platform/spi/cocoa/QuartzCoreSPI.h:
Add some SPI.

* wtf/Platform.h:
Add HAVE(COREANIMATION_FENCES)</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfPlatformh">trunk/Source/WTF/wtf/Platform.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformcocoaMachSendRighth">trunk/Source/WebCore/platform/cocoa/MachSendRight.h</a></li>
<li><a href="#trunkSourceWebCoreplatformspicocoaQuartzCoreSPIh">trunk/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2PlatformIPCConnectioncpp">trunk/Source/WebKit2/Platform/IPC/Connection.cpp</a></li>
<li><a href="#trunkSourceWebKit2PlatformIPCConnectionh">trunk/Source/WebKit2/Platform/IPC/Connection.h</a></li>
<li><a href="#trunkSourceWebKit2PlatformmacLayerHostingContextmm">trunk/Source/WebKit2/Platform/mac/LayerHostingContext.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacWKViewmm">trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacRemoteLayerTreeDrawingAreaProxymm">trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacTiledCoreAnimationDrawingAreaProxyh">trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacTiledCoreAnimationDrawingAreaProxymm">trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageDrawingAreah">trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageDrawingAreamessagesin">trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreah">trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreamm">trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacTiledCoreAnimationDrawingAreah">trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacTiledCoreAnimationDrawingAreamm">trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (186661 => 186662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2015-07-10 00:45:20 UTC (rev 186661)
+++ trunk/Source/WTF/ChangeLog        2015-07-10 03:45:10 UTC (rev 186662)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-07-09  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        Use CoreAnimation fences instead of synchronous IPC to synchronize resize
+        https://bugs.webkit.org/show_bug.cgi?id=146294
+        &lt;rdar://problem/21090193&gt;
+
+        Reviewed by Anders Carlsson.
+
+        * wtf/Platform.h:
+        Add HAVE(COREANIMATION_FENCES)
+
</ins><span class="cx"> 2015-07-04  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Drop RefPtr::clear() method
</span></span></pre></div>
<a id="trunkSourceWTFwtfPlatformh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Platform.h (186661 => 186662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Platform.h        2015-07-10 00:45:20 UTC (rev 186661)
+++ trunk/Source/WTF/wtf/Platform.h        2015-07-10 03:45:10 UTC (rev 186662)
</span><span class="lines">@@ -1151,4 +1151,9 @@
</span><span class="cx"> #define ENABLE_VIDEO_PRESENTATION_MODE 1
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+/* While 10.10 has support for fences, it is missing some API important for our integration of them. */
+#if PLATFORM(IOS) || (PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100)
+#define HAVE_COREANIMATION_FENCES 1
+#endif
+
</ins><span class="cx"> #endif /* WTF_Platform_h */
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (186661 => 186662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-07-10 00:45:20 UTC (rev 186661)
+++ trunk/Source/WebCore/ChangeLog        2015-07-10 03:45:10 UTC (rev 186662)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-07-09  Timothy Horton  &lt;timothy_horton@apple.com&gt;
+
+        Use CoreAnimation fences instead of synchronous IPC to synchronize resize
+        https://bugs.webkit.org/show_bug.cgi?id=146294
+        &lt;rdar://problem/21090193&gt;
+
+        Reviewed by Anders Carlsson.
+
+        * platform/cocoa/MachSendRight.h:
+        Export some constructors.
+
+        * platform/spi/cocoa/QuartzCoreSPI.h:
+        Add some SPI.
+
</ins><span class="cx"> 2015-07-09  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Followup to r186647
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaMachSendRighth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cocoa/MachSendRight.h (186661 => 186662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/MachSendRight.h        2015-07-10 00:45:20 UTC (rev 186661)
+++ trunk/Source/WebCore/platform/cocoa/MachSendRight.h        2015-07-10 03:45:10 UTC (rev 186662)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx">     WEBCORE_EXPORT static MachSendRight create(mach_port_t);
</span><span class="cx"> 
</span><span class="cx">     MachSendRight() = default;
</span><del>-    MachSendRight(MachSendRight&amp;&amp;);
</del><ins>+    WEBCORE_EXPORT MachSendRight(MachSendRight&amp;&amp;);
</ins><span class="cx">     WEBCORE_EXPORT ~MachSendRight();
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT MachSendRight&amp; operator=(MachSendRight&amp;&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformspicocoaQuartzCoreSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h (186661 => 186662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h        2015-07-10 00:45:20 UTC (rev 186661)
+++ trunk/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h        2015-07-10 03:45:10 UTC (rev 186662)
</span><span class="lines">@@ -136,6 +136,14 @@
</span><span class="cx"> EXTERN_C void CARenderServerRenderLayerWithTransform(mach_port_t server_port, uint32_t client_id, uint64_t layer_id, IOSurfaceRef iosurface, int32_t ox, int32_t oy, const CATransform3D *matrix);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+
+// FIXME: Move this into the APPLE_INTERNAL_SDK block once it's in an SDK.
+@interface CAContext (AdditionalDetails)
+#if (PLATFORM(IOS) &amp;&amp; __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 90000) || (PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100)
+- (void)invalidateFences;
+#endif
+@end
+
</ins><span class="cx"> EXTERN_C NSString * const kCATiledLayerRemoveImmediately;
</span><span class="cx"> 
</span><span class="cx"> EXTERN_C NSString * const kCAFilterColorInvert;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (186661 => 186662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-07-10 00:45:20 UTC (rev 186661)
+++ trunk/Source/WebKit2/ChangeLog        2015-07-10 03:45:10 UTC (rev 186662)
</span><span class="lines">@@ -1,3 +1,68 @@
</span><ins>+2015-07-09  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        Use CoreAnimation fences instead of synchronous IPC to synchronize resize
+        https://bugs.webkit.org/show_bug.cgi?id=146294
+        &lt;rdar://problem/21090193&gt;
+
+        Reviewed by Anders Carlsson.
+
+        Because of changes in underlying frameworks, we can no longer depend on
+        blocking the UI process main thread to be sufficient to synchronize
+        UI process CA commits with commits coming from the Web process.
+
+        Instead, we have to use CoreAnimation fences to perform this synchronization.
+        Instead of blocking inside waitForAndDispatchImmediately, we'll end up
+        blocking during the CA commit.
+
+        * Platform/mac/LayerHostingContext.mm:
+        Use HAVE(COREANIMATION_FENCES).
+
+        * Platform/IPC/Connection.cpp:
+        (IPC::Connection::Connection):
+        (IPC::Connection::processIncomingMessage):
+        (IPC::Connection::installIncomingSyncMessageCallback):
+        (IPC::Connection::uninstallIncomingSyncMessageCallback):
+        Keep track of a set of incoming sync message callbacks, and fire them
+        (on another queue) when a sync message arrives.
+
+        (IPC::Connection::hasIncomingSyncMessage):
+        * Platform/IPC/Connection.h:
+        Add a way to check if there are any sync messages in the queue.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView forceAsyncDrawingAreaSizeUpdate:]):
+        (-[WKView waitForAsyncDrawingAreaSizeUpdate]):
+        These are no longer used; do nothing on 10.10+.
+
+        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
+        * WebProcess/WebPage/DrawingArea.h:
+        (WebKit::DrawingArea::updateGeometry):
+        * WebProcess/WebPage/DrawingArea.messages.in:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::scaleViewAndUpdateGeometryFenced):
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+        Add a MachSendRight parameter to UpdateGeometry, so that we can send along
+        a fence port with the geometry update if needed.
+
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
+        Apply the incoming fence so that geometry changes will be synchronized between processes.
+
+        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
+        (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForPossibleGeometryUpdate):
+        Don't wait for DidUpdateGeometry to come in if we're using fences to achieve the same thing.
+
+        (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
+        Create and block us on a fence and send it along with the geometry update.
+        If a sync message is in the incoming message queue, don't create the fence;
+        if a sync message comes in at any point after we've installed the fence (but
+        before the relevant commit completes), invalidate the fence, so that we won't
+        end up temorarily deadlocked waiting for the fence timeout.
+
</ins><span class="cx"> 2015-07-09  Michael Catanzaro  &lt;mcatanzaro@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Crash when spell checker returns no guesses
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformIPCConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Platform/IPC/Connection.cpp (186661 => 186662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/IPC/Connection.cpp        2015-07-10 00:45:20 UTC (rev 186661)
+++ trunk/Source/WebKit2/Platform/IPC/Connection.cpp        2015-07-10 03:45:10 UTC (rev 186662)
</span><span class="lines">@@ -669,6 +669,15 @@
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    if (message-&gt;isSyncMessage()) {
+        std::lock_guard&lt;std::mutex&gt; lock(m_incomingSyncMessageCallbackMutex);
+
+        for (auto&amp; callback : m_incomingSyncMessageCallbacks.values())
+            m_incomingSyncMessageCallbackQueue-&gt;dispatch(callback);
+
+        m_incomingSyncMessageCallbacks.clear();
+    }
+
</ins><span class="cx">     // Check if this is a sync message or if it's a message that should be dispatched even when waiting for
</span><span class="cx">     // a sync reply. If it is, and we're waiting for a sync reply this message needs to be dispatched.
</span><span class="cx">     // If we don't we'll end up with a deadlock where both sync message senders are stuck waiting for a reply.
</span><span class="lines">@@ -695,6 +704,38 @@
</span><span class="cx">     enqueueIncomingMessage(WTF::move(message));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+uint64_t Connection::installIncomingSyncMessageCallback(std::function&lt;void ()&gt; callback)
+{
+    std::lock_guard&lt;std::mutex&gt; lock(m_incomingSyncMessageCallbackMutex);
+
+    m_nextIncomingSyncMessageCallbackID++;
+
+    if (!m_incomingSyncMessageCallbackQueue)
+        m_incomingSyncMessageCallbackQueue = WorkQueue::create(&quot;com.apple.WebKit.IPC.IncomingSyncMessageCallbackQueue&quot;);
+
+    m_incomingSyncMessageCallbacks.add(m_nextIncomingSyncMessageCallbackID, callback);
+
+    return m_nextIncomingSyncMessageCallbackID;
+}
+
+void Connection::uninstallIncomingSyncMessageCallback(uint64_t callbackID)
+{
+    std::lock_guard&lt;std::mutex&gt; lock(m_incomingSyncMessageCallbackMutex);
+    m_incomingSyncMessageCallbacks.remove(callbackID);
+}
+
+bool Connection::hasIncomingSyncMessage()
+{
+    std::lock_guard&lt;std::mutex&gt; lock(m_incomingMessagesMutex);
+
+    for (auto&amp; message : m_incomingMessages) {
+        if (message-&gt;isSyncMessage())
+            return true;
+    }
+    
+    return false;
+}
+
</ins><span class="cx"> void Connection::postConnectionDidCloseOnConnectionWorkQueue()
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;Connection&gt; connection(this);
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformIPCConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Platform/IPC/Connection.h (186661 => 186662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/IPC/Connection.h        2015-07-10 00:45:20 UTC (rev 186661)
+++ trunk/Source/WebKit2/Platform/IPC/Connection.h        2015-07-10 03:45:10 UTC (rev 186662)
</span><span class="lines">@@ -200,6 +200,10 @@
</span><span class="cx">     void setShouldBoostMainThreadOnSyncMessage(bool b) { m_shouldBoostMainThreadOnSyncMessage = b; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    uint64_t installIncomingSyncMessageCallback(std::function&lt;void ()&gt;);
+    void uninstallIncomingSyncMessageCallback(uint64_t);
+    bool hasIncomingSyncMessage();
+
</ins><span class="cx"> private:
</span><span class="cx">     Connection(Identifier, bool isServer, Client&amp;);
</span><span class="cx">     void platformInitialize(Identifier);
</span><span class="lines">@@ -302,6 +306,11 @@
</span><span class="cx">     typedef HashMap&lt;uint64_t, SecondaryThreadPendingSyncReply*&gt; SecondaryThreadPendingSyncReplyMap;
</span><span class="cx">     SecondaryThreadPendingSyncReplyMap m_secondaryThreadPendingSyncReplyMap;
</span><span class="cx"> 
</span><ins>+    std::mutex m_incomingSyncMessageCallbackMutex;
+    HashMap&lt;uint64_t, std::function&lt;void ()&gt;&gt; m_incomingSyncMessageCallbacks;
+    RefPtr&lt;WorkQueue&gt; m_incomingSyncMessageCallbackQueue;
+    uint64_t m_nextIncomingSyncMessageCallbackID { 0 };
+
</ins><span class="cx"> #if HAVE(QOS_CLASSES)
</span><span class="cx">     pthread_t m_mainThread { 0 };
</span><span class="cx">     bool m_shouldBoostMainThreadOnSyncMessage { false };
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformmacLayerHostingContextmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Platform/mac/LayerHostingContext.mm (186661 => 186662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/mac/LayerHostingContext.mm        2015-07-10 00:45:20 UTC (rev 186661)
+++ trunk/Source/WebKit2/Platform/mac/LayerHostingContext.mm        2015-07-10 03:45:10 UTC (rev 186662)
</span><span class="lines">@@ -102,7 +102,7 @@
</span><span class="cx">     return [m_context colorSpace];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
</del><ins>+#if HAVE(COREANIMATION_FENCES)
</ins><span class="cx"> void LayerHostingContext::setFencePort(mach_port_t fencePort)
</span><span class="cx"> {
</span><span class="cx">     [m_context setFencePort:fencePort];
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (186661 => 186662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2015-07-10 00:45:20 UTC (rev 186661)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2015-07-10 03:45:10 UTC (rev 186662)
</span><span class="lines">@@ -4407,12 +4407,16 @@
</span><span class="cx">     return nsColor(color);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#pragma clang diagnostic push
+#pragma clang diagnostic ignored &quot;-Wmissing-noreturn&quot;
</ins><span class="cx"> // This method forces a drawing area geometry update, even if frame size updates are disabled.
</span><span class="cx"> // The updated is performed asynchronously; we don't wait for the geometry update before returning.
</span><span class="cx"> // The area drawn need not match the current frame size - if it differs it will be anchored to the
</span><span class="cx"> // frame according to the current contentAnchor.
</span><span class="cx"> - (void)forceAsyncDrawingAreaSizeUpdate:(NSSize)size
</span><span class="cx"> {
</span><ins>+    // This SPI is only used on 10.9 and below, and is incompatible with the fence-based drawing area size synchronization in 10.10+.
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &lt;= 1090
</ins><span class="cx">     if (_data-&gt;_clipsToVisibleRect)
</span><span class="cx">         [self _updateViewExposedRect];
</span><span class="cx">     [self _setDrawingAreaSize:size];
</span><span class="lines">@@ -4422,10 +4426,15 @@
</span><span class="cx">     // the drawing area size such that the latest update is sent.
</span><span class="cx">     if (DrawingAreaProxy* drawingArea = _data-&gt;_page-&gt;drawingArea())
</span><span class="cx">         drawingArea-&gt;waitForPossibleGeometryUpdate(std::chrono::milliseconds::zero());
</span><ins>+#else
+    ASSERT_NOT_REACHED();
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)waitForAsyncDrawingAreaSizeUpdate
</span><span class="cx"> {
</span><ins>+    // This SPI is only used on 10.9 and below, and is incompatible with the fence-based drawing area size synchronization in 10.10+.
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &lt;= 1090
</ins><span class="cx">     if (DrawingAreaProxy* drawingArea = _data-&gt;_page-&gt;drawingArea()) {
</span><span class="cx">         // If a geometry update is still pending then the action of receiving the
</span><span class="cx">         // first geometry update may result in another update being scheduled -
</span><span class="lines">@@ -4433,7 +4442,11 @@
</span><span class="cx">         drawingArea-&gt;waitForPossibleGeometryUpdate(DrawingAreaProxy::didUpdateBackingStoreStateTimeout() / 2);
</span><span class="cx">         drawingArea-&gt;waitForPossibleGeometryUpdate(DrawingAreaProxy::didUpdateBackingStoreStateTimeout() / 2);
</span><span class="cx">     }
</span><ins>+#else
+    ASSERT_NOT_REACHED();
+#endif
</ins><span class="cx"> }
</span><ins>+#pragma clang diagnostic pop
</ins><span class="cx"> 
</span><span class="cx"> - (BOOL)isUsingUISideCompositing
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacRemoteLayerTreeDrawingAreaProxymm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm (186661 => 186662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm        2015-07-10 00:45:20 UTC (rev 186661)
+++ trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm        2015-07-10 03:45:10 UTC (rev 186662)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #import &quot;WebProcessProxy.h&quot;
</span><span class="cx"> #import &lt;QuartzCore/QuartzCore.h&gt;
</span><span class="cx"> #import &lt;WebCore/IOSurfacePool.h&gt;
</span><ins>+#import &lt;WebCore/MachSendRight.h&gt;
</ins><span class="cx"> #import &lt;WebCore/WebActionDisablingCALayerDelegate.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace IPC;
</span><span class="lines">@@ -170,7 +171,7 @@
</span><span class="cx"> void RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry()
</span><span class="cx"> {
</span><span class="cx">     m_lastSentSize = m_size;
</span><del>-    m_webPageProxy.process().send(Messages::DrawingArea::UpdateGeometry(m_size, IntSize(), false), m_webPageProxy.pageID());
</del><ins>+    m_webPageProxy.process().send(Messages::DrawingArea::UpdateGeometry(m_size, IntSize(), false, MachSendRight()), m_webPageProxy.pageID());
</ins><span class="cx">     m_isWaitingForDidUpdateGeometry = true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacTiledCoreAnimationDrawingAreaProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h (186661 => 186662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h        2015-07-10 00:45:20 UTC (rev 186661)
+++ trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h        2015-07-10 03:45:10 UTC (rev 186662)
</span><span class="lines">@@ -61,6 +61,7 @@
</span><span class="cx">     virtual void intrinsicContentSizeDidChange(const WebCore::IntSize&amp;) override;
</span><span class="cx"> 
</span><span class="cx">     void sendUpdateGeometry();
</span><ins>+    WebCore::MachSendRight createFenceForGeometryUpdate();
</ins><span class="cx"> 
</span><span class="cx">     // Whether we're waiting for a DidUpdateGeometry message from the web process.
</span><span class="cx">     bool m_isWaitingForDidUpdateGeometry;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacTiledCoreAnimationDrawingAreaProxymm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm (186661 => 186662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm        2015-07-10 00:45:20 UTC (rev 186661)
+++ trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm        2015-07-10 03:45:10 UTC (rev 186662)
</span><span class="lines">@@ -34,6 +34,8 @@
</span><span class="cx"> #import &quot;LayerTreeContext.h&quot;
</span><span class="cx"> #import &quot;WebPageProxy.h&quot;
</span><span class="cx"> #import &quot;WebProcessProxy.h&quot;
</span><ins>+#import &lt;WebCore/MachSendRight.h&gt;
+#import &lt;WebCore/QuartzCoreSPI.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> using namespace IPC;
</span><span class="cx"> using namespace WebCore;
</span><span class="lines">@@ -70,6 +72,7 @@
</span><span class="cx"> 
</span><span class="cx"> void TiledCoreAnimationDrawingAreaProxy::waitForPossibleGeometryUpdate(std::chrono::milliseconds timeout)
</span><span class="cx"> {
</span><ins>+#if !HAVE(COREANIMATION_FENCES)
</ins><span class="cx">     if (!m_isWaitingForDidUpdateGeometry)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -77,6 +80,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     m_webPageProxy.process().connection()-&gt;waitForAndDispatchImmediately&lt;Messages::DrawingAreaProxy::DidUpdateGeometry&gt;(m_webPageProxy.pageID(), timeout, InterruptWaitingIfSyncMessageArrives);
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TiledCoreAnimationDrawingAreaProxy::colorSpaceDidChange()
</span><span class="lines">@@ -146,12 +150,45 @@
</span><span class="cx">     m_isWaitingForDidUpdateGeometry = true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+MachSendRight TiledCoreAnimationDrawingAreaProxy::createFenceForGeometryUpdate()
+{
+#if HAVE(COREANIMATION_FENCES)
+    RetainPtr&lt;CAContext&gt; rootLayerContext = [asLayer(m_webPageProxy.acceleratedCompositingRootLayer()) context];
+    if (!rootLayerContext)
+        return MachSendRight();
+
+    // Don't fence if we have incoming synchronous messages, because we may not
+    // be able to reply to the message until the fence times out.
+    if (m_webPageProxy.process().connection()-&gt;hasIncomingSyncMessage())
+        return MachSendRight();
+
+    MachSendRight fencePort = MachSendRight::adopt([rootLayerContext createFencePort]);
+    [rootLayerContext setFencePort:fencePort.sendRight()];
+
+    // Invalidate the fence if a synchronous message arrives while it's installed,
+    // because we won't be able to reply during the fence-wait.
+    uint64_t callbackID = m_webPageProxy.process().connection()-&gt;installIncomingSyncMessageCallback([rootLayerContext] {
+        if ([rootLayerContext respondsToSelector:@selector(invalidateFences)])
+            [rootLayerContext invalidateFences];
+    });
+    RefPtr&lt;WebPageProxy&gt; retainedPage = &amp;m_webPageProxy;
+    [CATransaction addCommitHandler:[callbackID, retainedPage] {
+        if (Connection* connection = retainedPage-&gt;process().connection())
+            connection-&gt;uninstallIncomingSyncMessageCallback(callbackID);
+    } forPhase:kCATransactionPhasePostCommit];
+
+    return fencePort;
+#else
+    return MachSendRight();
+#endif
+}
+
</ins><span class="cx"> void TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!m_isWaitingForDidUpdateGeometry);
</span><span class="cx"> 
</span><span class="cx">     willSendUpdateGeometry();
</span><del>-    m_webPageProxy.process().send(Messages::DrawingArea::UpdateGeometry(m_size, IntSize(), true), m_webPageProxy.pageID());
</del><ins>+    m_webPageProxy.process().send(Messages::DrawingArea::UpdateGeometry(m_size, m_layerPosition, true, createFenceForGeometryUpdate()), m_webPageProxy.pageID());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TiledCoreAnimationDrawingAreaProxy::adjustTransientZoom(double scale, FloatPoint origin)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageDrawingAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h (186661 => 186662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h        2015-07-10 00:45:20 UTC (rev 186661)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h        2015-07-10 03:45:10 UTC (rev 186662)
</span><span class="lines">@@ -131,7 +131,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     // Used by TiledCoreAnimationDrawingArea.
</span><del>-    virtual void updateGeometry(const WebCore::IntSize&amp; viewSize, const WebCore::IntSize&amp; layerPosition, bool flushSynchronously) { }
</del><ins>+    virtual void updateGeometry(const WebCore::IntSize&amp; viewSize, const WebCore::IntSize&amp; layerPosition, bool flushSynchronously, const WebCore::MachSendRight&amp; fencePort) { }
</ins><span class="cx"> 
</span><span class="cx">     virtual void replyWithFenceAfterNextFlush(uint64_t callbackID) { ASSERT_NOT_REACHED(); }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageDrawingAreamessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in (186661 => 186662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in        2015-07-10 00:45:20 UTC (rev 186661)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in        2015-07-10 03:45:10 UTC (rev 186662)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     // Used by TiledCoreAnimationDrawingArea.
</span><del>-    UpdateGeometry(WebCore::IntSize viewSize, WebCore::IntSize layerPosition, bool flushSynchronously)
</del><ins>+    UpdateGeometry(WebCore::IntSize viewSize, WebCore::IntSize layerPosition, bool flushSynchronously, WebCore::MachSendRight fencePort)
</ins><span class="cx">     SetDeviceScaleFactor(float deviceScaleFactor)
</span><span class="cx">     SetColorSpace(struct WebKit::ColorSpaceData colorSpace)
</span><span class="cx">     SetExposedRect(WebCore::FloatRect exposedRect)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (186661 => 186662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-07-10 00:45:20 UTC (rev 186661)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-07-10 03:45:10 UTC (rev 186662)
</span><span class="lines">@@ -1472,7 +1472,7 @@
</span><span class="cx"> void WebPage::scaleViewAndUpdateGeometryFenced(double scale, IntSize viewSize, uint64_t callbackID)
</span><span class="cx"> {
</span><span class="cx">     scaleView(scale);
</span><del>-    m_drawingArea-&gt;updateGeometry(viewSize, IntSize(), false);
</del><ins>+    m_drawingArea-&gt;updateGeometry(viewSize, IntSize(), false, MachSendRight());
</ins><span class="cx">     m_drawingArea-&gt;replyWithFenceAfterNextFlush(callbackID);
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h (186661 => 186662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h        2015-07-10 00:45:20 UTC (rev 186661)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h        2015-07-10 03:45:10 UTC (rev 186662)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx">     virtual void setNeedsDisplay() override;
</span><span class="cx">     virtual void setNeedsDisplayInRect(const WebCore::IntRect&amp;) override;
</span><span class="cx">     virtual void scroll(const WebCore::IntRect&amp; scrollRect, const WebCore::IntSize&amp; scrollDelta) override;
</span><del>-    virtual void updateGeometry(const WebCore::IntSize&amp; viewSize, const WebCore::IntSize&amp; layerPosition, bool flushSynchronously) override;
</del><ins>+    virtual void updateGeometry(const WebCore::IntSize&amp; viewSize, const WebCore::IntSize&amp; layerPosition, bool flushSynchronously, const WebCore::MachSendRight&amp; fencePort) override;
</ins><span class="cx"> 
</span><span class="cx">     virtual WebCore::GraphicsLayerFactory* graphicsLayerFactory() override;
</span><span class="cx">     virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm (186661 => 186662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm        2015-07-10 00:45:20 UTC (rev 186661)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm        2015-07-10 03:45:10 UTC (rev 186662)
</span><span class="lines">@@ -154,7 +154,7 @@
</span><span class="cx">     scheduleCompositingLayerFlush();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RemoteLayerTreeDrawingArea::updateGeometry(const IntSize&amp; viewSize, const IntSize&amp; layerPosition, bool flushSynchronously)
</del><ins>+void RemoteLayerTreeDrawingArea::updateGeometry(const IntSize&amp; viewSize, const IntSize&amp; layerPosition, bool flushSynchronously, const WebCore::MachSendRight&amp;)
</ins><span class="cx"> {
</span><span class="cx">     m_viewSize = viewSize;
</span><span class="cx">     m_webPage.setSize(viewSize);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacTiledCoreAnimationDrawingAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h (186661 => 186662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h        2015-07-10 00:45:20 UTC (rev 186661)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h        2015-07-10 03:45:10 UTC (rev 186662)
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx">     virtual bool flushLayers() override;
</span><span class="cx"> 
</span><span class="cx">     // Message handlers.
</span><del>-    virtual void updateGeometry(const WebCore::IntSize&amp; viewSize, const WebCore::IntSize&amp; layerPosition, bool flushSynchronously) override;
</del><ins>+    virtual void updateGeometry(const WebCore::IntSize&amp; viewSize, const WebCore::IntSize&amp; layerPosition, bool flushSynchronously, const WebCore::MachSendRight&amp; fencePort) override;
</ins><span class="cx">     virtual void setDeviceScaleFactor(float) override;
</span><span class="cx">     void suspendPainting();
</span><span class="cx">     void resumePainting();
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacTiledCoreAnimationDrawingAreamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (186661 => 186662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm        2015-07-10 00:45:20 UTC (rev 186661)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm        2015-07-10 03:45:10 UTC (rev 186662)
</span><span class="lines">@@ -501,7 +501,7 @@
</span><span class="cx">     frameView-&gt;setExposedRect(m_scrolledExposedRect);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TiledCoreAnimationDrawingArea::updateGeometry(const IntSize&amp; viewSize, const IntSize&amp; layerPosition, bool flushSynchronously)
</del><ins>+void TiledCoreAnimationDrawingArea::updateGeometry(const IntSize&amp; viewSize, const IntSize&amp; layerPosition, bool flushSynchronously, const WebCore::MachSendRight&amp; fencePort)
</ins><span class="cx"> {
</span><span class="cx">     m_inUpdateGeometry = true;
</span><span class="cx"> 
</span><span class="lines">@@ -535,12 +535,19 @@
</span><span class="cx"> 
</span><span class="cx">     if (flushSynchronously) {
</span><span class="cx">         [CATransaction flush];
</span><ins>+#if !HAVE(COREANIMATION_FENCES)
+        // We can't synchronize here if we're using fences or we'll blow the fence every time (and we don't need to).
</ins><span class="cx">         [CATransaction synchronize];
</span><ins>+#endif
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_webPage.send(Messages::DrawingAreaProxy::DidUpdateGeometry());
</span><span class="cx"> 
</span><span class="cx">     m_inUpdateGeometry = false;
</span><ins>+
+#if HAVE(COREANIMATION_FENCES)
+    m_layerHostingContext-&gt;setFencePort(fencePort.sendRight());
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TiledCoreAnimationDrawingArea::setDeviceScaleFactor(float deviceScaleFactor)
</span></span></pre>
</div>
</div>

</body>
</html>