<!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>[182985] trunk</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/182985">182985</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2015-04-18 12:39:13 -0700 (Sat, 18 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>REGRESSION (<a href="http://trac.webkit.org/projects/webkit/changeset/181656">r181656</a>): Animated tiled layers are missing content
https://bugs.webkit.org/show_bug.cgi?id=143911
rdar://problem/20596328

Reviewed by Darin Adler.
Source/WebCore:

After <a href="http://trac.webkit.org/projects/webkit/changeset/181656">r181656</a>, all requestAnimationFrame was falling back to timers, and not
using the platform's DisplayRefreshMonitor, because of a Nullopt vs nullptr
fumble. As a result, GraphicsLayerUpdater (which updates tiled layers during
animations) was failing to do any updates.

Replace this confusing Optional&lt;&gt; code with simpler code that just forces the
clients to make a DisplayRefreshMonitor if they can, first asking
ChromeClient, and then falling back to createDefaultDisplayRefreshMonitor().

Make lots of things into references, and use C++11 initialization in some places.

Add Internals API to allow a test to get the number of layer flushes that have
occurred.

* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::ScriptedAnimationController):
(WebCore::ScriptedAnimationController::windowScreenDidChange):
(WebCore::ScriptedAnimationController::scheduleAnimation):
(WebCore::ScriptedAnimationController::createDisplayRefreshMonitor):
* dom/ScriptedAnimationController.h:
* page/ChromeClient.h:
* platform/graphics/DisplayRefreshMonitor.cpp:
(WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor):
(WebCore::DisplayRefreshMonitor::create):
(WebCore::DisplayRefreshMonitor::addClient):
(WebCore::DisplayRefreshMonitor::removeClient):
(WebCore::DisplayRefreshMonitor::displayDidRefresh):
* platform/graphics/DisplayRefreshMonitor.h:
* platform/graphics/DisplayRefreshMonitorClient.cpp:
(WebCore::DisplayRefreshMonitorClient::~DisplayRefreshMonitorClient):
* platform/graphics/DisplayRefreshMonitorClient.h:
* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::createMonitorForClient):
(WebCore::DisplayRefreshMonitorManager::registerClient):
(WebCore::DisplayRefreshMonitorManager::unregisterClient):
(WebCore::DisplayRefreshMonitorManager::scheduleAnimation):
(WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
(WebCore::DisplayRefreshMonitorManager::windowScreenDidChange):
* platform/graphics/DisplayRefreshMonitorManager.h:
* platform/graphics/GraphicsLayerUpdater.cpp:
(WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater):
(WebCore::GraphicsLayerUpdater::scheduleUpdate):
(WebCore::GraphicsLayerUpdater::screenDidChange):
(WebCore::GraphicsLayerUpdater::displayRefreshFired):
(WebCore::GraphicsLayerUpdater::createDisplayRefreshMonitor):
* platform/graphics/GraphicsLayerUpdater.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::RenderLayerCompositor):
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::notifyFlushBeforeDisplayRefresh):
(WebCore::RenderLayerCompositor::flushLayersSoon):
(WebCore::RenderLayerCompositor::createDisplayRefreshMonitor):
(WebCore::RenderLayerCompositor::startTrackingLayerFlushes):
(WebCore::RenderLayerCompositor::layerFlushCount):
* rendering/RenderLayerCompositor.h:
* testing/Internals.cpp:
(WebCore::Internals::startTrackingLayerFlushes):
(WebCore::Internals::layerFlushCount):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit2:

After <a href="http://trac.webkit.org/projects/webkit/changeset/181656">r181656</a>, all requestAnimationFrame was falling back to timers, and not
using the platform's DisplayRefreshMonitor, because of a Nullopt vs nullptr
fumble.

Replace this confusing Optional&lt;&gt; code with simpler code that just forces the
clients to make a DisplayRefreshMonitor if they can, first asking
ChromeClient, and then falling back to createDefaultDisplayRefreshMonitor().

Make lots of things into references, and use C++11 initialization in some places.

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createDisplayRefreshMonitor):
* WebProcess/WebCoreSupport/WebChromeClient.h:

LayoutTests:

Test that animates a tiled layer, and checks that layer flushes occur while the
animation is running.

* compositing/animation/animation-backing-expected.txt: Added.
* compositing/animation/animation-backing.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomScriptedAnimationControllercpp">trunk/Source/WebCore/dom/ScriptedAnimationController.cpp</a></li>
<li><a href="#trunkSourceWebCoredomScriptedAnimationControllerh">trunk/Source/WebCore/dom/ScriptedAnimationController.h</a></li>
<li><a href="#trunkSourceWebCorepageChromeClienth">trunk/Source/WebCore/page/ChromeClient.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsDisplayRefreshMonitorcpp">trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsDisplayRefreshMonitorh">trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsDisplayRefreshMonitorClientcpp">trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsDisplayRefreshMonitorClienth">trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsDisplayRefreshMonitorManagercpp">trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsDisplayRefreshMonitorManagerh">trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsLayerUpdatercpp">trunk/Source/WebCore/platform/graphics/GraphicsLayerUpdater.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsLayerUpdaterh">trunk/Source/WebCore/platform/graphics/GraphicsLayerUpdater.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerCompositorcpp">trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerCompositorh">trunk/Source/WebCore/rendering/RenderLayerCompositor.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsh">trunk/Source/WebCore/testing/Internals.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsidl">trunk/Source/WebCore/testing/Internals.idl</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClienth">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageDrawingAreacpp">trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageDrawingAreah">trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h</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>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscompositinganimationanimationbackingexpectedtxt">trunk/LayoutTests/compositing/animation/animation-backing-expected.txt</a></li>
<li><a href="#trunkLayoutTestscompositinganimationanimationbackinghtml">trunk/LayoutTests/compositing/animation/animation-backing.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/LayoutTests/ChangeLog        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-04-18  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        REGRESSION (r181656): Animated tiled layers are missing content
+        https://bugs.webkit.org/show_bug.cgi?id=143911
+        rdar://problem/20596328
+
+        Reviewed by Darin Adler.
+        
+        Test that animates a tiled layer, and checks that layer flushes occur while the
+        animation is running.
+
+        * compositing/animation/animation-backing-expected.txt: Added.
+        * compositing/animation/animation-backing.html: Added.
+
</ins><span class="cx"> 2015-04-17  Bem Jones-Bey  &lt;bjonesbe@adobe.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Large values for line-height cause integer overflow in RenderStyle::computedLineHeight
</span></span></pre></div>
<a id="trunkLayoutTestscompositinganimationanimationbackingexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/compositing/animation/animation-backing-expected.txt (0 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/compositing/animation/animation-backing-expected.txt                                (rev 0)
+++ trunk/LayoutTests/compositing/animation/animation-backing-expected.txt        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+Saw layer flushes during animation: PASS
</ins></span></pre></div>
<a id="trunkLayoutTestscompositinganimationanimationbackinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/compositing/animation/animation-backing.html (0 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/compositing/animation/animation-backing.html                                (rev 0)
+++ trunk/LayoutTests/compositing/animation/animation-backing.html        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        .mover {
+            height: 100px;
+            width: 3000px;
+            background-color: gray;
+            border: 1px solid black;
+        }
+        
+        .mover.animating {
+            animation: move 0.25s forwards linear;
+        }
+        
+        @keyframes move {
+            from { transform: translateX(1000px); }
+            to { transform: translateX(-2000px); }
+        }
+    &lt;/style&gt;
+    &lt;script&gt;
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+        function doTest()
+        {
+            window.setTimeout(function() {
+                var mover = document.getElementById('mover');
+                mover.addEventListener('animationstart', function() {
+                    if (window.internals)
+                        internals.startTrackingLayerFlushes();
+                });
+
+                mover.addEventListener('animationend', function() {
+                    if (window.internals) {
+                        var flushCount = internals.layerFlushCount();
+                        document.getElementById('result').textContent = flushCount ? &quot;Saw layer flushes during animation: PASS&quot; : &quot;No layer flushes during animation: FAIL&quot;;
+                    }
+                    if (window.testRunner)
+                        testRunner.notifyDone();
+                });
+                mover.classList.add('animating');
+            }, 0);
+        }
+        window.addEventListener('load', doTest, false);
+    &lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;div id=&quot;mover&quot; class=&quot;mover&quot;&gt;&lt;/div&gt;
+&lt;div id=&quot;result&quot;&gt;This test must be run in the test harness.&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebCore/ChangeLog        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -1,3 +1,72 @@
</span><ins>+2015-04-18  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        REGRESSION (r181656): Animated tiled layers are missing content
+        https://bugs.webkit.org/show_bug.cgi?id=143911
+        rdar://problem/20596328
+
+        Reviewed by Darin Adler.
+
+        After r181656, all requestAnimationFrame was falling back to timers, and not
+        using the platform's DisplayRefreshMonitor, because of a Nullopt vs nullptr
+        fumble. As a result, GraphicsLayerUpdater (which updates tiled layers during
+        animations) was failing to do any updates.
+        
+        Replace this confusing Optional&lt;&gt; code with simpler code that just forces the
+        clients to make a DisplayRefreshMonitor if they can, first asking
+        ChromeClient, and then falling back to createDefaultDisplayRefreshMonitor().
+        
+        Make lots of things into references, and use C++11 initialization in some places.
+        
+        Add Internals API to allow a test to get the number of layer flushes that have
+        occurred.
+        
+        * dom/ScriptedAnimationController.cpp:
+        (WebCore::ScriptedAnimationController::ScriptedAnimationController):
+        (WebCore::ScriptedAnimationController::windowScreenDidChange):
+        (WebCore::ScriptedAnimationController::scheduleAnimation):
+        (WebCore::ScriptedAnimationController::createDisplayRefreshMonitor):
+        * dom/ScriptedAnimationController.h:
+        * page/ChromeClient.h:
+        * platform/graphics/DisplayRefreshMonitor.cpp:
+        (WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor):
+        (WebCore::DisplayRefreshMonitor::create):
+        (WebCore::DisplayRefreshMonitor::addClient):
+        (WebCore::DisplayRefreshMonitor::removeClient):
+        (WebCore::DisplayRefreshMonitor::displayDidRefresh):
+        * platform/graphics/DisplayRefreshMonitor.h:
+        * platform/graphics/DisplayRefreshMonitorClient.cpp:
+        (WebCore::DisplayRefreshMonitorClient::~DisplayRefreshMonitorClient):
+        * platform/graphics/DisplayRefreshMonitorClient.h:
+        * platform/graphics/DisplayRefreshMonitorManager.cpp:
+        (WebCore::DisplayRefreshMonitorManager::createMonitorForClient):
+        (WebCore::DisplayRefreshMonitorManager::registerClient):
+        (WebCore::DisplayRefreshMonitorManager::unregisterClient):
+        (WebCore::DisplayRefreshMonitorManager::scheduleAnimation):
+        (WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
+        (WebCore::DisplayRefreshMonitorManager::windowScreenDidChange):
+        * platform/graphics/DisplayRefreshMonitorManager.h:
+        * platform/graphics/GraphicsLayerUpdater.cpp:
+        (WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater):
+        (WebCore::GraphicsLayerUpdater::scheduleUpdate):
+        (WebCore::GraphicsLayerUpdater::screenDidChange):
+        (WebCore::GraphicsLayerUpdater::displayRefreshFired):
+        (WebCore::GraphicsLayerUpdater::createDisplayRefreshMonitor):
+        * platform/graphics/GraphicsLayerUpdater.h:
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::RenderLayerCompositor):
+        (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
+        (WebCore::RenderLayerCompositor::notifyFlushBeforeDisplayRefresh):
+        (WebCore::RenderLayerCompositor::flushLayersSoon):
+        (WebCore::RenderLayerCompositor::createDisplayRefreshMonitor):
+        (WebCore::RenderLayerCompositor::startTrackingLayerFlushes):
+        (WebCore::RenderLayerCompositor::layerFlushCount):
+        * rendering/RenderLayerCompositor.h:
+        * testing/Internals.cpp:
+        (WebCore::Internals::startTrackingLayerFlushes):
+        (WebCore::Internals::layerFlushCount):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
</ins><span class="cx"> 2015-04-17  Bem Jones-Bey  &lt;bjonesbe@adobe.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Large values for line-height cause integer overflow in RenderStyle::computedLineHeight
</span></span></pre></div>
<a id="trunkSourceWebCoredomScriptedAnimationControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScriptedAnimationController.cpp (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScriptedAnimationController.cpp        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebCore/dom/ScriptedAnimationController.cpp        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -51,16 +51,9 @@
</span><span class="cx"> 
</span><span class="cx"> ScriptedAnimationController::ScriptedAnimationController(Document* document, PlatformDisplayID displayID)
</span><span class="cx">     : m_document(document)
</span><del>-    , m_nextCallbackId(0)
-    , m_suspendCount(0)
</del><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_TIMER)
</span><span class="cx">     , m_animationTimer(*this, &amp;ScriptedAnimationController::animationTimerFired)
</span><del>-    , m_lastAnimationFrameTimeMonotonic(0)
-#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
-    , m_isUsingTimer(false)
-    , m_isThrottled(false)
</del><span class="cx"> #endif
</span><del>-#endif
</del><span class="cx"> {
</span><span class="cx">     windowScreenDidChange(displayID);
</span><span class="cx"> }
</span><span class="lines">@@ -173,7 +166,7 @@
</span><span class="cx">     if (m_document-&gt;settings() &amp;&amp; !m_document-&gt;settings()-&gt;requestAnimationFrameEnabled())
</span><span class="cx">         return;
</span><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</span><del>-    DisplayRefreshMonitorManager::sharedManager().windowScreenDidChange(displayID, this);
</del><ins>+    DisplayRefreshMonitorManager::sharedManager().windowScreenDidChange(displayID, *this);
</ins><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(displayID);
</span><span class="cx"> #endif
</span><span class="lines">@@ -187,7 +180,7 @@
</span><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_TIMER)
</span><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</span><span class="cx">     if (!m_isUsingTimer &amp;&amp; !m_isThrottled) {
</span><del>-        if (DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(this))
</del><ins>+        if (DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(*this))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         m_isUsingTimer = true;
</span><span class="lines">@@ -226,11 +219,15 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</span><del>-Optional&lt;RefPtr&lt;DisplayRefreshMonitor&gt;&gt; ScriptedAnimationController::createDisplayRefreshMonitor(PlatformDisplayID displayID) const
</del><ins>+RefPtr&lt;DisplayRefreshMonitor&gt; ScriptedAnimationController::createDisplayRefreshMonitor(PlatformDisplayID displayID) const
</ins><span class="cx"> {
</span><span class="cx">     if (!m_document-&gt;page())
</span><del>-        return Optional&lt;RefPtr&lt;DisplayRefreshMonitor&gt;&gt;(nullptr);
-    return Optional&lt;RefPtr&lt;DisplayRefreshMonitor&gt;&gt;(m_document-&gt;page()-&gt;chrome().client().createDisplayRefreshMonitor(displayID));
</del><ins>+        return nullptr;
+
+    if (auto monitor = m_document-&gt;page()-&gt;chrome().client().createDisplayRefreshMonitor(displayID))
+        return monitor;
+
+    return DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor(displayID);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomScriptedAnimationControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScriptedAnimationController.h (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScriptedAnimationController.h        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebCore/dom/ScriptedAnimationController.h        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -78,23 +78,23 @@
</span><span class="cx">     CallbackList m_callbacks;
</span><span class="cx"> 
</span><span class="cx">     Document* m_document;
</span><del>-    CallbackId m_nextCallbackId;
-    int m_suspendCount;
</del><ins>+    CallbackId m_nextCallbackId { 0 };
+    int m_suspendCount { 0 };
</ins><span class="cx"> 
</span><span class="cx">     void scheduleAnimation();
</span><span class="cx"> 
</span><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_TIMER)
</span><span class="cx">     void animationTimerFired();
</span><span class="cx">     Timer m_animationTimer;
</span><del>-    double m_lastAnimationFrameTimeMonotonic;
</del><ins>+    double m_lastAnimationFrameTimeMonotonic { 0 };
</ins><span class="cx"> 
</span><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</span><span class="cx">     // Override for DisplayRefreshMonitorClient
</span><span class="cx">     virtual void displayRefreshFired(double timestamp) override;
</span><del>-    virtual Optional&lt;RefPtr&lt;DisplayRefreshMonitor&gt;&gt; createDisplayRefreshMonitor(PlatformDisplayID) const override;
</del><ins>+    virtual RefPtr&lt;DisplayRefreshMonitor&gt; createDisplayRefreshMonitor(PlatformDisplayID) const override;
</ins><span class="cx"> 
</span><del>-    bool m_isUsingTimer;
-    bool m_isThrottled;
</del><ins>+    bool m_isUsingTimer { false };
+    bool m_isThrottled { false };
</ins><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorepageChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ChromeClient.h (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ChromeClient.h        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebCore/page/ChromeClient.h        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -286,7 +286,7 @@
</span><span class="cx">     virtual GraphicsLayerFactory* graphicsLayerFactory() const { return nullptr; }
</span><span class="cx"> 
</span><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</span><del>-    virtual Optional&lt;RefPtr&lt;DisplayRefreshMonitor&gt;&gt; createDisplayRefreshMonitor(PlatformDisplayID) const { return Nullopt; }
</del><ins>+    virtual RefPtr&lt;DisplayRefreshMonitor&gt; createDisplayRefreshMonitor(PlatformDisplayID) const { return nullptr; }
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     // Pass 0 as the GraphicsLayer to detatch the root layer.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsDisplayRefreshMonitorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -35,23 +35,22 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-RefPtr&lt;DisplayRefreshMonitor&gt; DisplayRefreshMonitor::create(DisplayRefreshMonitorClient* client)
</del><ins>+RefPtr&lt;DisplayRefreshMonitor&gt; DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor(PlatformDisplayID displayID)
</ins><span class="cx"> {
</span><del>-    PlatformDisplayID displayID = client-&gt;displayID();
-
-    if (Optional&lt;RefPtr&lt;DisplayRefreshMonitor&gt;&gt; monitor = client-&gt;createDisplayRefreshMonitor(displayID))
-        return monitor.value();
-
-    // If ChromeClient returned Nullopt, we'll make one of the default type.
-
</del><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     return DisplayRefreshMonitorMac::create(displayID);
</span><span class="cx"> #endif
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     return DisplayRefreshMonitorIOS::create(displayID);
</span><span class="cx"> #endif
</span><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+RefPtr&lt;DisplayRefreshMonitor&gt; DisplayRefreshMonitor::create(DisplayRefreshMonitorClient&amp; client)
+{
+    return client.createDisplayRefreshMonitor(client.displayID());
+}
+
</ins><span class="cx"> DisplayRefreshMonitor::DisplayRefreshMonitor(PlatformDisplayID displayID)
</span><span class="cx">     : m_monotonicAnimationStartTime(0)
</span><span class="cx">     , m_active(true)
</span><span class="lines">@@ -73,16 +72,16 @@
</span><span class="cx">     monitor-&gt;displayDidRefresh();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DisplayRefreshMonitor::addClient(DisplayRefreshMonitorClient* client)
</del><ins>+void DisplayRefreshMonitor::addClient(DisplayRefreshMonitorClient&amp; client)
</ins><span class="cx"> {
</span><del>-    m_clients.add(client);
</del><ins>+    m_clients.add(&amp;client);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool DisplayRefreshMonitor::removeClient(DisplayRefreshMonitorClient* client)
</del><ins>+bool DisplayRefreshMonitor::removeClient(DisplayRefreshMonitorClient&amp; client)
</ins><span class="cx"> {
</span><span class="cx">     if (m_clientsToBeNotified)
</span><del>-        m_clientsToBeNotified-&gt;remove(client);
-    return m_clients.remove(client);
</del><ins>+        m_clientsToBeNotified-&gt;remove(&amp;client);
+    return m_clients.remove(&amp;client);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void DisplayRefreshMonitor::displayDidRefresh()
</span><span class="lines">@@ -126,7 +125,7 @@
</span><span class="cx">         m_previousFrameDone = true;
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    DisplayRefreshMonitorManager::sharedManager().displayDidRefresh(this);
</del><ins>+    DisplayRefreshMonitorManager::sharedManager().displayDidRefresh(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsDisplayRefreshMonitorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> 
</span><span class="cx"> class DisplayRefreshMonitor : public RefCounted&lt;DisplayRefreshMonitor&gt; {
</span><span class="cx"> public:
</span><del>-    static RefPtr&lt;DisplayRefreshMonitor&gt; create(DisplayRefreshMonitorClient*);
</del><ins>+    static RefPtr&lt;DisplayRefreshMonitor&gt; create(DisplayRefreshMonitorClient&amp;);
</ins><span class="cx">     WEBCORE_EXPORT virtual ~DisplayRefreshMonitor();
</span><span class="cx">     
</span><span class="cx">     // Return true if callback request was scheduled, false if it couldn't be
</span><span class="lines">@@ -50,8 +50,8 @@
</span><span class="cx">     void windowScreenDidChange(PlatformDisplayID);
</span><span class="cx">     
</span><span class="cx">     bool hasClients() const { return m_clients.size(); }
</span><del>-    void addClient(DisplayRefreshMonitorClient*);
-    bool removeClient(DisplayRefreshMonitorClient*);
</del><ins>+    void addClient(DisplayRefreshMonitorClient&amp;);
+    bool removeClient(DisplayRefreshMonitorClient&amp;);
</ins><span class="cx">     
</span><span class="cx">     PlatformDisplayID displayID() const { return m_displayID; }
</span><span class="cx"> 
</span><span class="lines">@@ -74,6 +74,8 @@
</span><span class="cx"> 
</span><span class="cx">     Mutex&amp; mutex() { return m_mutex; }
</span><span class="cx"> 
</span><ins>+    static RefPtr&lt;DisplayRefreshMonitor&gt; createDefaultDisplayRefreshMonitor(PlatformDisplayID);
+
</ins><span class="cx"> protected:
</span><span class="cx">     WEBCORE_EXPORT explicit DisplayRefreshMonitor(PlatformDisplayID);
</span><span class="cx">     WEBCORE_EXPORT static void handleDisplayRefreshedNotificationOnMainThread(void* data);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsDisplayRefreshMonitorClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.cpp (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.cpp        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.cpp        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> 
</span><span class="cx"> DisplayRefreshMonitorClient::~DisplayRefreshMonitorClient()
</span><span class="cx"> {
</span><del>-    DisplayRefreshMonitorManager::sharedManager().unregisterClient(this);
</del><ins>+    DisplayRefreshMonitorManager::sharedManager().unregisterClient(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void DisplayRefreshMonitorClient::fireDisplayRefreshIfNeeded(double timestamp)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsDisplayRefreshMonitorClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.h (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.h        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.h        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -44,10 +44,7 @@
</span><span class="cx">     // Always called on the main thread.
</span><span class="cx">     virtual void displayRefreshFired(double timestamp) = 0;
</span><span class="cx"> 
</span><del>-    // Returning nullopt indicates that WebCore should create whatever DisplayRefreshMonitor it deems
-    // most appropriate for the current platform. Returning nullptr indicates that we should not try to
-    // create a DisplayRefreshMonitor at all (and should instead fall back to using a timer).
-    virtual Optional&lt;RefPtr&lt;DisplayRefreshMonitor&gt;&gt; createDisplayRefreshMonitor(PlatformDisplayID) const = 0;
</del><ins>+    virtual RefPtr&lt;DisplayRefreshMonitor&gt; createDisplayRefreshMonitor(PlatformDisplayID) const = 0;
</ins><span class="cx"> 
</span><span class="cx">     PlatformDisplayID displayID() const { return m_displayID; }
</span><span class="cx">     bool hasDisplayID() const { return m_displayIDIsSet; }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsDisplayRefreshMonitorManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.cpp (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.cpp        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.cpp        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -44,9 +44,9 @@
</span><span class="cx">     return manager.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-DisplayRefreshMonitor* DisplayRefreshMonitorManager::createMonitorForClient(DisplayRefreshMonitorClient* client)
</del><ins>+DisplayRefreshMonitor* DisplayRefreshMonitorManager::createMonitorForClient(DisplayRefreshMonitorClient&amp; client)
</ins><span class="cx"> {
</span><del>-    PlatformDisplayID clientDisplayID = client-&gt;displayID();
</del><ins>+    PlatformDisplayID clientDisplayID = client.displayID();
</ins><span class="cx">     for (const RefPtr&lt;DisplayRefreshMonitor&gt;&amp; monitor : m_monitors) {
</span><span class="cx">         if (monitor-&gt;displayID() != clientDisplayID)
</span><span class="cx">             continue;
</span><span class="lines">@@ -57,26 +57,27 @@
</span><span class="cx">     RefPtr&lt;DisplayRefreshMonitor&gt; monitor = DisplayRefreshMonitor::create(client);
</span><span class="cx">     if (!monitor)
</span><span class="cx">         return nullptr;
</span><ins>+
</ins><span class="cx">     monitor-&gt;addClient(client);
</span><span class="cx">     DisplayRefreshMonitor* result = monitor.get();
</span><span class="cx">     m_monitors.append(monitor.release());
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DisplayRefreshMonitorManager::registerClient(DisplayRefreshMonitorClient* client)
</del><ins>+void DisplayRefreshMonitorManager::registerClient(DisplayRefreshMonitorClient&amp; client)
</ins><span class="cx"> {
</span><del>-    if (!client-&gt;hasDisplayID())
</del><ins>+    if (!client.hasDisplayID())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     createMonitorForClient(client);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DisplayRefreshMonitorManager::unregisterClient(DisplayRefreshMonitorClient* client)
</del><ins>+void DisplayRefreshMonitorManager::unregisterClient(DisplayRefreshMonitorClient&amp; client)
</ins><span class="cx"> {
</span><del>-    if (!client-&gt;hasDisplayID())
</del><ins>+    if (!client.hasDisplayID())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    PlatformDisplayID clientDisplayID = client-&gt;displayID();
</del><ins>+    PlatformDisplayID clientDisplayID = client.displayID();
</ins><span class="cx">     for (size_t i = 0; i &lt; m_monitors.size(); ++i) {
</span><span class="cx">         RefPtr&lt;DisplayRefreshMonitor&gt; monitor = m_monitors[i];
</span><span class="cx">         if (monitor-&gt;displayID() != clientDisplayID)
</span><span class="lines">@@ -89,38 +90,38 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool DisplayRefreshMonitorManager::scheduleAnimation(DisplayRefreshMonitorClient* client)
</del><ins>+bool DisplayRefreshMonitorManager::scheduleAnimation(DisplayRefreshMonitorClient&amp; client)
</ins><span class="cx"> {
</span><del>-    if (!client-&gt;hasDisplayID())
</del><ins>+    if (!client.hasDisplayID())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     DisplayRefreshMonitor* monitor = createMonitorForClient(client);
</span><span class="cx">     if (!monitor)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    client-&gt;setIsScheduled(true);
</del><ins>+    client.setIsScheduled(true);
</ins><span class="cx">     return monitor-&gt;requestRefreshCallback();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DisplayRefreshMonitorManager::displayDidRefresh(DisplayRefreshMonitor* monitor)
</del><ins>+void DisplayRefreshMonitorManager::displayDidRefresh(DisplayRefreshMonitor&amp; monitor)
</ins><span class="cx"> {
</span><del>-    if (!monitor-&gt;shouldBeTerminated())
</del><ins>+    if (!monitor.shouldBeTerminated())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    size_t monitorIndex = m_monitors.find(monitor);
</del><ins>+    size_t monitorIndex = m_monitors.find(&amp;monitor);
</ins><span class="cx">     ASSERT(monitorIndex != notFound);
</span><span class="cx">     m_monitors.remove(monitorIndex);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DisplayRefreshMonitorManager::windowScreenDidChange(PlatformDisplayID displayID, DisplayRefreshMonitorClient* client)
</del><ins>+void DisplayRefreshMonitorManager::windowScreenDidChange(PlatformDisplayID displayID, DisplayRefreshMonitorClient&amp; client)
</ins><span class="cx"> {
</span><del>-    if (client-&gt;hasDisplayID() &amp;&amp; client-&gt;displayID() == displayID)
</del><ins>+    if (client.hasDisplayID() &amp;&amp; client.displayID() == displayID)
</ins><span class="cx">         return;
</span><span class="cx">     
</span><span class="cx">     unregisterClient(client);
</span><del>-    client-&gt;setDisplayID(displayID);
</del><ins>+    client.setDisplayID(displayID);
</ins><span class="cx">     registerClient(client);
</span><del>-    if (client-&gt;isScheduled())
</del><ins>+    if (client.isScheduled())
</ins><span class="cx">         scheduleAnimation(client);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsDisplayRefreshMonitorManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.h (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.h        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.h        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -41,20 +41,20 @@
</span><span class="cx"> public:
</span><span class="cx">     static DisplayRefreshMonitorManager&amp; sharedManager();
</span><span class="cx">     
</span><del>-    void registerClient(DisplayRefreshMonitorClient*);
-    void unregisterClient(DisplayRefreshMonitorClient*);
</del><ins>+    void registerClient(DisplayRefreshMonitorClient&amp;);
+    void unregisterClient(DisplayRefreshMonitorClient&amp;);
</ins><span class="cx"> 
</span><del>-    bool scheduleAnimation(DisplayRefreshMonitorClient*);
-    void windowScreenDidChange(PlatformDisplayID, DisplayRefreshMonitorClient*);
</del><ins>+    bool scheduleAnimation(DisplayRefreshMonitorClient&amp;);
+    void windowScreenDidChange(PlatformDisplayID, DisplayRefreshMonitorClient&amp;);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     friend class DisplayRefreshMonitor;
</span><del>-    void displayDidRefresh(DisplayRefreshMonitor*);
</del><ins>+    void displayDidRefresh(DisplayRefreshMonitor&amp;);
</ins><span class="cx">     
</span><span class="cx">     DisplayRefreshMonitorManager() { }
</span><span class="cx">     virtual ~DisplayRefreshMonitorManager();
</span><span class="cx"> 
</span><del>-    DisplayRefreshMonitor* createMonitorForClient(DisplayRefreshMonitorClient*);
</del><ins>+    DisplayRefreshMonitor* createMonitorForClient(DisplayRefreshMonitorClient&amp;);
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;RefPtr&lt;DisplayRefreshMonitor&gt;&gt; m_monitors;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsLayerUpdatercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayerUpdater.cpp (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsLayerUpdater.cpp        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayerUpdater.cpp        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -31,14 +31,13 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-GraphicsLayerUpdater::GraphicsLayerUpdater(GraphicsLayerUpdaterClient* client, PlatformDisplayID displayID)
</del><ins>+GraphicsLayerUpdater::GraphicsLayerUpdater(GraphicsLayerUpdaterClient&amp; client, PlatformDisplayID displayID)
</ins><span class="cx">     : m_client(client)
</span><del>-    , m_scheduled(false)
</del><span class="cx"> {
</span><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</span><del>-    DisplayRefreshMonitorManager::sharedManager().registerClient(this);
-    DisplayRefreshMonitorManager::sharedManager().windowScreenDidChange(displayID, this);
-    DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(this);
</del><ins>+    DisplayRefreshMonitorManager::sharedManager().registerClient(*this);
+    DisplayRefreshMonitorManager::sharedManager().windowScreenDidChange(displayID, *this);
+    DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(*this);
</ins><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(displayID);
</span><span class="cx"> #endif
</span><span class="lines">@@ -55,7 +54,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</span><del>-    DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(this);
</del><ins>+    DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(*this);
</ins><span class="cx"> #endif
</span><span class="cx">     m_scheduled = true;
</span><span class="cx"> }
</span><span class="lines">@@ -63,7 +62,7 @@
</span><span class="cx"> void GraphicsLayerUpdater::screenDidChange(PlatformDisplayID displayID)
</span><span class="cx"> {
</span><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</span><del>-    DisplayRefreshMonitorManager::sharedManager().windowScreenDidChange(displayID, this);
</del><ins>+    DisplayRefreshMonitorManager::sharedManager().windowScreenDidChange(displayID, *this);
</ins><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(displayID);
</span><span class="cx"> #endif
</span><span class="lines">@@ -75,17 +74,14 @@
</span><span class="cx">     UNUSED_PARAM(timestamp);
</span><span class="cx">     m_scheduled = false;
</span><span class="cx">     
</span><del>-    if (m_client)
-        m_client-&gt;flushLayersSoon(this);
</del><ins>+    m_client.flushLayersSoon(*this);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</span><del>-Optional&lt;RefPtr&lt;DisplayRefreshMonitor&gt;&gt; GraphicsLayerUpdater::createDisplayRefreshMonitor(PlatformDisplayID displayID) const
</del><ins>+RefPtr&lt;DisplayRefreshMonitor&gt; GraphicsLayerUpdater::createDisplayRefreshMonitor(PlatformDisplayID displayID) const
</ins><span class="cx"> {
</span><del>-    if (!m_client)
-        return Optional&lt;RefPtr&lt;DisplayRefreshMonitor&gt;&gt;(nullptr);
-    return m_client-&gt;createDisplayRefreshMonitor(displayID);
</del><ins>+    return m_client.createDisplayRefreshMonitor(displayID);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsLayerUpdaterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayerUpdater.h (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsLayerUpdater.h        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayerUpdater.h        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -36,9 +36,9 @@
</span><span class="cx"> class GraphicsLayerUpdaterClient {
</span><span class="cx"> public:
</span><span class="cx">     virtual ~GraphicsLayerUpdaterClient() { }
</span><del>-    virtual void flushLayersSoon(GraphicsLayerUpdater*) = 0;
</del><ins>+    virtual void flushLayersSoon(GraphicsLayerUpdater&amp;) = 0;
</ins><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</span><del>-    virtual Optional&lt;RefPtr&lt;DisplayRefreshMonitor&gt;&gt; createDisplayRefreshMonitor(PlatformDisplayID) const = 0;
</del><ins>+    virtual RefPtr&lt;DisplayRefreshMonitor&gt; createDisplayRefreshMonitor(PlatformDisplayID) const = 0;
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -48,14 +48,14 @@
</span><span class="cx"> #endif
</span><span class="cx"> {
</span><span class="cx"> public:
</span><del>-    GraphicsLayerUpdater(GraphicsLayerUpdaterClient*, PlatformDisplayID);
</del><ins>+    GraphicsLayerUpdater(GraphicsLayerUpdaterClient&amp;, PlatformDisplayID);
</ins><span class="cx">     virtual ~GraphicsLayerUpdater();
</span><span class="cx"> 
</span><span class="cx">     void scheduleUpdate();
</span><span class="cx">     void screenDidChange(PlatformDisplayID);
</span><span class="cx"> 
</span><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</span><del>-    virtual Optional&lt;RefPtr&lt;DisplayRefreshMonitor&gt;&gt; createDisplayRefreshMonitor(PlatformDisplayID) const override;
</del><ins>+    virtual RefPtr&lt;DisplayRefreshMonitor&gt; createDisplayRefreshMonitor(PlatformDisplayID) const override;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -63,8 +63,8 @@
</span><span class="cx">     virtual void displayRefreshFired(double timestamp) override;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    GraphicsLayerUpdaterClient* m_client;
-    bool m_scheduled;
</del><ins>+    GraphicsLayerUpdaterClient&amp; m_client;
+    bool m_scheduled { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerCompositorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -280,7 +280,6 @@
</span><span class="cx">     , m_updateCompositingLayersTimer(*this, &amp;RenderLayerCompositor::updateCompositingLayersTimerFired)
</span><span class="cx">     , m_hasAcceleratedCompositing(true)
</span><span class="cx">     , m_compositingTriggers(static_cast&lt;ChromeClient::CompositingTriggerFlags&gt;(ChromeClient::AllTriggers))
</span><del>-    , m_compositedLayerCount(0)
</del><span class="cx">     , m_showDebugBorders(false)
</span><span class="cx">     , m_showRepaintCounter(false)
</span><span class="cx">     , m_acceleratedDrawingEnabled(false)
</span><span class="lines">@@ -293,20 +292,12 @@
</span><span class="cx">     , m_inPostLayoutUpdate(false)
</span><span class="cx">     , m_subframeScrollLayersNeedReattach(false)
</span><span class="cx">     , m_isTrackingRepaints(false)
</span><del>-    , m_layersWithTiledBackingCount(0)
</del><span class="cx">     , m_rootLayerAttachment(RootLayerUnattached)
</span><span class="cx">     , m_layerFlushTimer(*this, &amp;RenderLayerCompositor::layerFlushTimerFired)
</span><span class="cx">     , m_layerFlushThrottlingEnabled(false)
</span><span class="cx">     , m_layerFlushThrottlingTemporarilyDisabledForInteraction(false)
</span><span class="cx">     , m_hasPendingLayerFlush(false)
</span><span class="cx">     , m_paintRelatedMilestonesTimer(*this, &amp;RenderLayerCompositor::paintRelatedMilestonesTimerFired)
</span><del>-#if !LOG_DISABLED
-    , m_rootLayerUpdateCount(0)
-    , m_obligateCompositedLayerCount(0)
-    , m_secondaryCompositedLayerCount(0)
-    , m_obligatoryBackingStoreBytes(0)
-    , m_secondaryBackingStoreBytes(0)
-#endif
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -491,6 +482,7 @@
</span><span class="cx">         client-&gt;didFlushCompositingLayers();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    ++m_layerFlushCount;
</ins><span class="cx">     startLayerFlushTimerIfNeeded();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -608,13 +600,13 @@
</span><span class="cx">         if (Page* page = this-&gt;page())
</span><span class="cx">             displayID = page-&gt;chrome().displayID();
</span><span class="cx"> 
</span><del>-        m_layerUpdater = std::make_unique&lt;GraphicsLayerUpdater&gt;(this, displayID);
</del><ins>+        m_layerUpdater = std::make_unique&lt;GraphicsLayerUpdater&gt;(*this, displayID);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     m_layerUpdater-&gt;scheduleUpdate();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderLayerCompositor::flushLayersSoon(GraphicsLayerUpdater*)
</del><ins>+void RenderLayerCompositor::flushLayersSoon(GraphicsLayerUpdater&amp;)
</ins><span class="cx"> {
</span><span class="cx">     scheduleLayerFlush(true);
</span><span class="cx"> }
</span><span class="lines">@@ -4171,15 +4163,28 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</span><del>-Optional&lt;RefPtr&lt;DisplayRefreshMonitor&gt;&gt; RenderLayerCompositor::createDisplayRefreshMonitor(PlatformDisplayID displayID) const
</del><ins>+RefPtr&lt;DisplayRefreshMonitor&gt; RenderLayerCompositor::createDisplayRefreshMonitor(PlatformDisplayID displayID) const
</ins><span class="cx"> {
</span><span class="cx">     Frame&amp; frame = m_renderView.frameView().frame();
</span><span class="cx">     Page* page = frame.page();
</span><span class="cx">     if (!page)
</span><del>-        return Optional&lt;RefPtr&lt;DisplayRefreshMonitor&gt;&gt;(nullptr);
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><del>-    return Optional&lt;RefPtr&lt;DisplayRefreshMonitor&gt;&gt;(page-&gt;chrome().client().createDisplayRefreshMonitor(displayID));
</del><ins>+    if (auto monitor = page-&gt;chrome().client().createDisplayRefreshMonitor(displayID))
+        return monitor;
+
+    return DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor(displayID);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+void RenderLayerCompositor::startTrackingLayerFlushes()
+{
+    m_layerFlushCount = 0;
+}
+
+unsigned RenderLayerCompositor::layerFlushCount() const
+{
+    return m_layerFlushCount;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerCompositorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -307,6 +307,10 @@
</span><span class="cx">     void setRootExtendedBackgroundColor(const Color&amp;);
</span><span class="cx">     Color rootExtendedBackgroundColor() const { return m_rootExtendedBackgroundColor; }
</span><span class="cx"> 
</span><ins>+    // For testing.
+    WEBCORE_EXPORT void startTrackingLayerFlushes();
+    WEBCORE_EXPORT unsigned layerFlushCount() const;
+
</ins><span class="cx"> private:
</span><span class="cx">     class OverlapMap;
</span><span class="cx">     struct CompositingState;
</span><span class="lines">@@ -319,7 +323,7 @@
</span><span class="cx">     virtual bool isTrackingRepaints() const override;
</span><span class="cx">     
</span><span class="cx">     // GraphicsLayerUpdaterClient implementation
</span><del>-    virtual void flushLayersSoon(GraphicsLayerUpdater*) override;
</del><ins>+    virtual void flushLayersSoon(GraphicsLayerUpdater&amp;) override;
</ins><span class="cx"> 
</span><span class="cx">     // Whether the given RL needs a compositing layer.
</span><span class="cx">     bool needsToBeComposited(const RenderLayer&amp;, RenderLayer::ViewportConstrainedNotCompositedReason* = nullptr) const;
</span><span class="lines">@@ -399,7 +403,7 @@
</span><span class="cx">     ScrollingCoordinator* scrollingCoordinator() const;
</span><span class="cx"> 
</span><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</span><del>-    Optional&lt;RefPtr&lt;DisplayRefreshMonitor&gt;&gt; createDisplayRefreshMonitor(PlatformDisplayID) const override;
</del><ins>+    RefPtr&lt;DisplayRefreshMonitor&gt; createDisplayRefreshMonitor(PlatformDisplayID) const override;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     bool requiresCompositingForAnimation(RenderLayerModelObject&amp;) const;
</span><span class="lines">@@ -473,7 +477,6 @@
</span><span class="cx">     bool m_hasAcceleratedCompositing;
</span><span class="cx">     ChromeClient::CompositingTriggerFlags m_compositingTriggers;
</span><span class="cx"> 
</span><del>-    int m_compositedLayerCount;
</del><span class="cx">     bool m_showDebugBorders;
</span><span class="cx">     bool m_showRepaintCounter;
</span><span class="cx">     bool m_acceleratedDrawingEnabled;
</span><span class="lines">@@ -492,7 +495,9 @@
</span><span class="cx"> 
</span><span class="cx">     bool m_isTrackingRepaints; // Used for testing.
</span><span class="cx"> 
</span><del>-    unsigned m_layersWithTiledBackingCount;
</del><ins>+    int m_compositedLayerCount { 0 };
+    unsigned m_layersWithTiledBackingCount { 0 };
+    unsigned m_layerFlushCount { 0 };
</ins><span class="cx"> 
</span><span class="cx">     RootLayerAttachment m_rootLayerAttachment;
</span><span class="cx"> 
</span><span class="lines">@@ -533,11 +538,11 @@
</span><span class="cx">     Timer m_paintRelatedMilestonesTimer;
</span><span class="cx"> 
</span><span class="cx"> #if !LOG_DISABLED
</span><del>-    int m_rootLayerUpdateCount;
-    int m_obligateCompositedLayerCount; // count of layer that have to be composited.
-    int m_secondaryCompositedLayerCount; // count of layers that have to be composited because of stacking or overlap.
-    double m_obligatoryBackingStoreBytes;
-    double m_secondaryBackingStoreBytes;
</del><ins>+    int m_rootLayerUpdateCount { 0 };
+    int m_obligateCompositedLayerCount { 0 }; // count of layer that have to be composited.
+    int m_secondaryCompositedLayerCount { 0 }; // count of layers that have to be composited because of stacking or overlap.
+    double m_obligatoryBackingStoreBytes { 0 };
+    double m_secondaryBackingStoreBytes { 0 };
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     Color m_rootExtendedBackgroundColor;
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebCore/testing/Internals.cpp        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -90,6 +90,7 @@
</span><span class="cx"> #include &quot;PseudoElement.h&quot;
</span><span class="cx"> #include &quot;Range.h&quot;
</span><span class="cx"> #include &quot;RenderEmbeddedObject.h&quot;
</span><ins>+#include &quot;RenderLayerCompositor.h&quot;
</ins><span class="cx"> #include &quot;RenderMenuList.h&quot;
</span><span class="cx"> #include &quot;RenderTreeAsText.h&quot;
</span><span class="cx"> #include &quot;RenderView.h&quot;
</span><span class="lines">@@ -2066,6 +2067,28 @@
</span><span class="cx">     frameView-&gt;setTracksRepaints(false);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void Internals::startTrackingLayerFlushes(ExceptionCode&amp; ec)
+{
+    Document* document = contextDocument();
+    if (!document || !document-&gt;renderView()) {
+        ec = INVALID_ACCESS_ERR;
+        return;
+    }
+
+    document-&gt;renderView()-&gt;compositor().startTrackingLayerFlushes();
+}
+
+unsigned long Internals::layerFlushCount(ExceptionCode&amp; ec)
+{
+    Document* document = contextDocument();
+    if (!document || !document-&gt;renderView()) {
+        ec = INVALID_ACCESS_ERR;
+        return 0;
+    }
+
+    return document-&gt;renderView()-&gt;compositor().layerFlushCount();
+}
+
</ins><span class="cx"> void Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(nullptr, ec);
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebCore/testing/Internals.h        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -294,6 +294,10 @@
</span><span class="cx"> 
</span><span class="cx">     void startTrackingRepaints(ExceptionCode&amp;);
</span><span class="cx">     void stopTrackingRepaints(ExceptionCode&amp;);
</span><ins>+
+    void startTrackingLayerFlushes(ExceptionCode&amp;);
+    unsigned long layerFlushCount(ExceptionCode&amp;);
+    
</ins><span class="cx">     void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(ExceptionCode&amp;);
</span><span class="cx">     void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(Node*, ExceptionCode&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.idl (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.idl        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebCore/testing/Internals.idl        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -271,6 +271,9 @@
</span><span class="cx">     [RaisesException] void startTrackingRepaints();
</span><span class="cx">     [RaisesException] void stopTrackingRepaints();
</span><span class="cx"> 
</span><ins>+    [RaisesException] void startTrackingLayerFlushes();
+    [RaisesException] unsigned long layerFlushCount();
+
</ins><span class="cx">     // Query if a timer is currently throttled, to debug timer throttling.
</span><span class="cx">     [RaisesException] boolean isTimerThrottled(long timerHandle);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebKit2/ChangeLog        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2015-04-18  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        REGRESSION (r181656): Animated tiled layers are missing content
+        https://bugs.webkit.org/show_bug.cgi?id=143911
+        rdar://problem/20596328
+
+        Reviewed by Darin Adler.
+        
+        After r181656, all requestAnimationFrame was falling back to timers, and not
+        using the platform's DisplayRefreshMonitor, because of a Nullopt vs nullptr
+        fumble.
+        
+        Replace this confusing Optional&lt;&gt; code with simpler code that just forces the
+        clients to make a DisplayRefreshMonitor if they can, first asking
+        ChromeClient, and then falling back to createDefaultDisplayRefreshMonitor().
+        
+        Make lots of things into references, and use C++11 initialization in some places.
+
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::createDisplayRefreshMonitor):
+        * WebProcess/WebCoreSupport/WebChromeClient.h:
+
</ins><span class="cx"> 2015-04-18  Dan Bernstein  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         SwipeShadow images are installed on iOS
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -850,9 +850,9 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</span><del>-Optional&lt;RefPtr&lt;WebCore::DisplayRefreshMonitor&gt;&gt; WebChromeClient::createDisplayRefreshMonitor(PlatformDisplayID displayID) const
</del><ins>+RefPtr&lt;WebCore::DisplayRefreshMonitor&gt; WebChromeClient::createDisplayRefreshMonitor(PlatformDisplayID displayID) const
</ins><span class="cx"> {
</span><del>-    return Optional&lt;RefPtr&lt;WebCore::DisplayRefreshMonitor&gt;&gt;(m_page-&gt;drawingArea()-&gt;createDisplayRefreshMonitor(displayID));
</del><ins>+    return m_page-&gt;drawingArea()-&gt;createDisplayRefreshMonitor(displayID);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -217,7 +217,7 @@
</span><span class="cx">     virtual bool adjustLayerFlushThrottling(WebCore::LayerFlushThrottleState::Flags) override;
</span><span class="cx"> 
</span><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</span><del>-    virtual Optional&lt;RefPtr&lt;WebCore::DisplayRefreshMonitor&gt;&gt; createDisplayRefreshMonitor(PlatformDisplayID) const override;
</del><ins>+    virtual RefPtr&lt;WebCore::DisplayRefreshMonitor&gt; createDisplayRefreshMonitor(PlatformDisplayID) const override;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     virtual CompositingTriggerFlags allowedCompositingTriggers() const override
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageDrawingAreacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -96,7 +96,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</span><del>-PassRefPtr&lt;WebCore::DisplayRefreshMonitor&gt; DrawingArea::createDisplayRefreshMonitor(PlatformDisplayID)
</del><ins>+RefPtr&lt;WebCore::DisplayRefreshMonitor&gt; DrawingArea::createDisplayRefreshMonitor(PlatformDisplayID)
</ins><span class="cx"> {
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageDrawingAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -106,7 +106,7 @@
</span><span class="cx">     virtual void scheduleCompositingLayerFlushImmediately() = 0;
</span><span class="cx"> 
</span><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</span><del>-    virtual PassRefPtr&lt;WebCore::DisplayRefreshMonitor&gt; createDisplayRefreshMonitor(PlatformDisplayID);
</del><ins>+    virtual RefPtr&lt;WebCore::DisplayRefreshMonitor&gt; createDisplayRefreshMonitor(PlatformDisplayID);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void addTransactionCallbackID(uint64_t callbackID) override;
</span><span class="cx"> 
</span><del>-    virtual PassRefPtr&lt;WebCore::DisplayRefreshMonitor&gt; createDisplayRefreshMonitor(PlatformDisplayID) override;
</del><ins>+    virtual RefPtr&lt;WebCore::DisplayRefreshMonitor&gt; createDisplayRefreshMonitor(PlatformDisplayID) override;
</ins><span class="cx">     void willDestroyDisplayRefreshMonitor(WebCore::DisplayRefreshMonitor*);
</span><span class="cx"> 
</span><span class="cx">     virtual bool shouldUseTiledBackingForFrameView(const WebCore::FrameView*) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm (182984 => 182985)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm        2015-04-18 14:57:19 UTC (rev 182984)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm        2015-04-18 19:39:13 UTC (rev 182985)
</span><span class="lines">@@ -108,7 +108,7 @@
</span><span class="cx">     return m_remoteLayerTreeContext.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;DisplayRefreshMonitor&gt; RemoteLayerTreeDrawingArea::createDisplayRefreshMonitor(PlatformDisplayID displayID)
</del><ins>+RefPtr&lt;DisplayRefreshMonitor&gt; RemoteLayerTreeDrawingArea::createDisplayRefreshMonitor(PlatformDisplayID displayID)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;RemoteLayerTreeDisplayRefreshMonitor&gt; monitor = RemoteLayerTreeDisplayRefreshMonitor::create(displayID, *this);
</span><span class="cx">     m_displayRefreshMonitors.add(monitor.get());
</span></span></pre>
</div>
</div>

</body>
</html>