<!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>[217737] 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/217737">217737</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2017-06-02 16:06:13 -0700 (Fri, 02 Jun 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>All scroll peformance logging should happen in the UI process
https://bugs.webkit.org/show_bug.cgi?id=172874
rdar://problem/24474830

Reviewed by Tim Horton.

Printing to stdout from the WebProcess doesn't show up anywhere in non-development builds,
so we have to log from the UI process.

Achieve this by adding a PerformanceLoggingClient to Page which forwards messages to
WebPageProxy, which prints them with the same format they had before. Some plumbing through
PlatformCALayerClient and GraphicsLayerClient is required to get messages from TileControllers
through to something that can get to Page.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::~Page):
* page/Page.h:
(WebCore::Page::performanceLoggingClient):
* page/PageConfiguration.cpp:
* page/PageConfiguration.h:
* page/PerformanceLoggingClient.cpp: Added.
(WebCore::PerformanceLoggingClient::synchronousScrollingReasonsAsString):
* page/PerformanceLoggingClient.h: Added.
(WebCore::PerformanceLoggingClient::~PerformanceLoggingClient):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::reportExposedUnfilledArea):
(WebCore::AsyncScrollingCoordinator::reportSynchronousScrollingReasonsChanged):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::reportSynchronousScrollingReasonsChanged):
(WebCore::ScrollingTree::reportExposedUnfilledArea):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::reportSynchronousScrollingReasonsChanged):
(WebCore::ThreadedScrollingTree::reportExposedUnfilledArea):
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
(WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea):
(WebCore::ScrollingTreeFrameScrollingNodeMac::logExposedUnfilledArea): Deleted.
(WebCore::logThreadedScrollingMode): Deleted.
* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::logFilledVisibleFreshTile):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::platformCALayerLogFilledVisibleFreshTile):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayerClient.h:
(WebCore::PlatformCALayerClient::platformCALayerLogFilledVisibleFreshTile):
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::logFilledVisibleFreshTile):
* platform/graphics/ca/TileController.h:
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::platformCALayerPaintContents):
* platform/graphics/ca/TileGrid.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::logFilledVisibleFreshTile):
* rendering/RenderLayerBacking.h:

Source/WebKit2:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::logScrollingEvent):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebPerformanceLoggingClient.cpp: Added.
(WebKit::WebPerformanceLoggingClient::WebPerformanceLoggingClient):
(WebKit::WebPerformanceLoggingClient::logScrollingEvent):
* WebProcess/WebCoreSupport/WebPerformanceLoggingClient.h: Added.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_cpuLimit):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageh">trunk/Source/WebCore/page/Page.h</a></li>
<li><a href="#trunkSourceWebCorepagePageConfigurationcpp">trunk/Source/WebCore/page/PageConfiguration.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageConfigurationh">trunk/Source/WebCore/page/PageConfiguration.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorcpp">trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorh">trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingTreeh">trunk/Source/WebCore/page/scrolling/ScrollingTree.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingThreadedScrollingTreecpp">trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingThreadedScrollingTreeh">trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingmacScrollingTreeFrameScrollingNodeMach">trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingmacScrollingTreeFrameScrollingNodeMacmm">trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsLayerClienth">trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAcpp">trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAh">trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaPlatformCALayerClienth">trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaTileControllercpp">trunk/Source/WebCore/platform/graphics/ca/TileController.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaTileControllerh">trunk/Source/WebCore/platform/graphics/ca/TileController.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaTileGridcpp">trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaTileGridh">trunk/Source/WebCore/platform/graphics/ca/TileGrid.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerBackingcpp">trunk/Source/WebCore/rendering/RenderLayerBacking.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerBackingh">trunk/Source/WebCore/rendering/RenderLayerBacking.h</a></li>
<li><a href="#trunkSourceWebKit2CMakeListstxt">trunk/Source/WebKit2/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxymessagesin">trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorepagePerformanceLoggingClientcpp">trunk/Source/WebCore/page/PerformanceLoggingClient.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceLoggingClienth">trunk/Source/WebCore/page/PerformanceLoggingClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebPerformanceLoggingClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPerformanceLoggingClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebPerformanceLoggingClienth">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPerformanceLoggingClient.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt      2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/CMakeLists.txt 2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -2085,6 +2085,7 @@
</span><span class="cx">     page/Performance.cpp
</span><span class="cx">     page/PerformanceEntry.cpp
</span><span class="cx">     page/PerformanceLogging.cpp
</span><ins>+    page/PerformanceLoggingClient.cpp
</ins><span class="cx">     page/PerformanceMonitor.cpp
</span><span class="cx">     page/PerformanceNavigation.cpp
</span><span class="cx">     page/PerformanceObserver.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/ChangeLog      2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -1,3 +1,66 @@
</span><ins>+2017-06-02  Simon Fraser  <simon.fraser@apple.com>
+
+        All scroll peformance logging should happen in the UI process
+        https://bugs.webkit.org/show_bug.cgi?id=172874
+        rdar://problem/24474830
+
+        Reviewed by Tim Horton.
+
+        Printing to stdout from the WebProcess doesn't show up anywhere in non-development builds,
+        so we have to log from the UI process.
+
+        Achieve this by adding a PerformanceLoggingClient to Page which forwards messages to
+        WebPageProxy, which prints them with the same format they had before. Some plumbing through
+        PlatformCALayerClient and GraphicsLayerClient is required to get messages from TileControllers
+        through to something that can get to Page.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * page/Page.cpp:
+        (WebCore::Page::Page):
+        (WebCore::Page::~Page):
+        * page/Page.h:
+        (WebCore::Page::performanceLoggingClient):
+        * page/PageConfiguration.cpp:
+        * page/PageConfiguration.h:
+        * page/PerformanceLoggingClient.cpp: Added.
+        (WebCore::PerformanceLoggingClient::synchronousScrollingReasonsAsString):
+        * page/PerformanceLoggingClient.h: Added.
+        (WebCore::PerformanceLoggingClient::~PerformanceLoggingClient):
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::reportExposedUnfilledArea):
+        (WebCore::AsyncScrollingCoordinator::reportSynchronousScrollingReasonsChanged):
+        * page/scrolling/AsyncScrollingCoordinator.h:
+        * page/scrolling/ScrollingTree.h:
+        (WebCore::ScrollingTree::reportSynchronousScrollingReasonsChanged):
+        (WebCore::ScrollingTree::reportExposedUnfilledArea):
+        * page/scrolling/ThreadedScrollingTree.cpp:
+        (WebCore::ThreadedScrollingTree::reportSynchronousScrollingReasonsChanged):
+        (WebCore::ThreadedScrollingTree::reportExposedUnfilledArea):
+        * page/scrolling/ThreadedScrollingTree.h:
+        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
+        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::logExposedUnfilledArea): Deleted.
+        (WebCore::logThreadedScrollingMode): Deleted.
+        * platform/graphics/GraphicsLayerClient.h:
+        (WebCore::GraphicsLayerClient::logFilledVisibleFreshTile):
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::platformCALayerLogFilledVisibleFreshTile):
+        * platform/graphics/ca/GraphicsLayerCA.h:
+        * platform/graphics/ca/PlatformCALayerClient.h:
+        (WebCore::PlatformCALayerClient::platformCALayerLogFilledVisibleFreshTile):
+        * platform/graphics/ca/TileController.cpp:
+        (WebCore::TileController::logFilledVisibleFreshTile):
+        * platform/graphics/ca/TileController.h:
+        * platform/graphics/ca/TileGrid.cpp:
+        (WebCore::TileGrid::platformCALayerPaintContents):
+        * platform/graphics/ca/TileGrid.h:
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::logFilledVisibleFreshTile):
+        * rendering/RenderLayerBacking.h:
+
</ins><span class="cx"> 2017-06-02  Eric Carlson  <eric.carlson@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [MediaStream iOS] Cleanup video muting/unmuting when tab visibility changes
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -486,6 +486,7 @@
</span><span class="cx">          0F6A12BE1A00923700C6DE72 /* DebugPageOverlays.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6A12BC1A00923700C6DE72 /* DebugPageOverlays.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          0F7D07331884C56C00B4AF86 /* PlatformTextTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = 072847E216EBC5B00043CFA4 /* PlatformTextTrack.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          0F7DF1481E2BF1B10095951B /* WebCoreJSClientData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F7DF1471E2BF1A60095951B /* WebCoreJSClientData.cpp */; };
</span><ins>+               0F850FE31ED7C18300FB77A7 /* PerformanceLoggingClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F850FE21ED7C18300FB77A7 /* PerformanceLoggingClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">           0F87166F1C869D83004FF0DE /* LengthPoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F87166D1C869D83004FF0DE /* LengthPoint.cpp */; };
</span><span class="cx">          0F8716701C869D83004FF0DE /* LengthPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F87166E1C869D83004FF0DE /* LengthPoint.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          0F8B45721DC3FBA300443C3F /* IntersectionObserverCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8B45711DC3FBA300443C3F /* IntersectionObserverCallback.h */; };
</span><span class="lines">@@ -556,6 +557,7 @@
</span><span class="cx">          0FEA3E88191B3BD7000F1B55 /* ScrollingTreeFrameScrollingNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA3E86191B3BD7000F1B55 /* ScrollingTreeFrameScrollingNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          0FEF20CE1BD4A24100128E5D /* LengthSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEF20CD1BD4A24100128E5D /* LengthSize.cpp */; };
</span><span class="cx">          0FEF20D01BD4A64F00128E5D /* RenderStyleConstants.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEF20CF1BD4A64F00128E5D /* RenderStyleConstants.cpp */; };
</span><ins>+               0FF2E80D1EE0D430009EABD4 /* PerformanceLoggingClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF2E80C1EE0D430009EABD4 /* PerformanceLoggingClient.cpp */; };
</ins><span class="cx">           0FF50269102BA9430066F39A /* JSStyleMedia.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF50267102BA9430066F39A /* JSStyleMedia.cpp */; };
</span><span class="cx">          0FF5026A102BA9430066F39A /* JSStyleMedia.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF50268102BA9430066F39A /* JSStyleMedia.h */; };
</span><span class="cx">          0FF50271102BA96A0066F39A /* StyleMedia.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF5026E102BA9660066F39A /* StyleMedia.cpp */; };
</span><span class="lines">@@ -7917,6 +7919,7 @@
</span><span class="cx">          0F6A12BB1A00923700C6DE72 /* DebugPageOverlays.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DebugPageOverlays.cpp; sourceTree = "<group>"; };
</span><span class="cx">          0F6A12BC1A00923700C6DE72 /* DebugPageOverlays.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugPageOverlays.h; sourceTree = "<group>"; };
</span><span class="cx">          0F7DF1471E2BF1A60095951B /* WebCoreJSClientData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreJSClientData.cpp; sourceTree = "<group>"; };
</span><ins>+               0F850FE21ED7C18300FB77A7 /* PerformanceLoggingClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceLoggingClient.h; sourceTree = "<group>"; };
</ins><span class="cx">           0F87166D1C869D83004FF0DE /* LengthPoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LengthPoint.cpp; sourceTree = "<group>"; };
</span><span class="cx">          0F87166E1C869D83004FF0DE /* LengthPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LengthPoint.h; sourceTree = "<group>"; };
</span><span class="cx">          0F8B456F1DC3FB1000443C3F /* IntersectionObserverCallback.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IntersectionObserverCallback.idl; sourceTree = "<group>"; };
</span><span class="lines">@@ -7990,6 +7993,7 @@
</span><span class="cx">          0FEA3E86191B3BD7000F1B55 /* ScrollingTreeFrameScrollingNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeFrameScrollingNode.h; sourceTree = "<group>"; };
</span><span class="cx">          0FEF20CD1BD4A24100128E5D /* LengthSize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LengthSize.cpp; sourceTree = "<group>"; };
</span><span class="cx">          0FEF20CF1BD4A64F00128E5D /* RenderStyleConstants.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderStyleConstants.cpp; sourceTree = "<group>"; };
</span><ins>+               0FF2E80C1EE0D430009EABD4 /* PerformanceLoggingClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceLoggingClient.cpp; sourceTree = "<group>"; };
</ins><span class="cx">           0FF50267102BA9430066F39A /* JSStyleMedia.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStyleMedia.cpp; sourceTree = "<group>"; };
</span><span class="cx">          0FF50268102BA9430066F39A /* JSStyleMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStyleMedia.h; sourceTree = "<group>"; };
</span><span class="cx">          0FF5026E102BA9660066F39A /* StyleMedia.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleMedia.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -19348,6 +19352,8 @@
</span><span class="cx">                          AD5A0C201DECA0B500707054 /* PerformanceLogging.h */,
</span><span class="cx">                          37C738E81EDBD2ED003F2B0B /* PerformanceMark.h */,
</span><span class="cx">                          37C738EA1EDBD381003F2B0B /* PerformanceMeasure.h */,
</span><ins>+                               0F850FE21ED7C18300FB77A7 /* PerformanceLoggingClient.h */,
+                               0FF2E80C1EE0D430009EABD4 /* PerformanceLoggingClient.cpp */,
</ins><span class="cx">                           83FE90251E307C1C003E9199 /* PerformanceMonitor.cpp */,
</span><span class="cx">                          83FE90261E307C1C003E9199 /* PerformanceMonitor.h */,
</span><span class="cx">                          8AF4E55211DC5A36000ED3DE /* PerformanceNavigation.cpp */,
</span><span class="lines">@@ -29973,6 +29979,7 @@
</span><span class="cx">                          9B2D8A7914997CCF00ECEF3E /* UndoStep.h in Headers */,
</span><span class="cx">                          A863E2011343412000274926 /* UnicodeBidi.h in Headers */,
</span><span class="cx">                          518864E11BBAF57400E540C9 /* UniqueIDBDatabase.h in Headers */,
</span><ins>+                               0F850FE31ED7C18300FB77A7 /* PerformanceLoggingClient.h in Headers */,
</ins><span class="cx">                           5198F7A51BBDB79300E2CC5F /* UniqueIDBDatabaseConnection.h in Headers */,
</span><span class="cx">                          5198F7A91BBDD38500E2CC5F /* UniqueIDBDatabaseTransaction.h in Headers */,
</span><span class="cx">                          E4AFCFA50DAF29A300F5F55C /* UnitBezier.h in Headers */,
</span><span class="lines">@@ -33208,6 +33215,7 @@
</span><span class="cx">                          FD31603512B0267600C1A359 /* ScriptProcessorNode.cpp in Sources */,
</span><span class="cx">                          8A413AE11207BBA50082016E /* ScriptRunner.cpp in Sources */,
</span><span class="cx">                          4127D5370F8AAB1D00E424F5 /* ScriptState.cpp in Sources */,
</span><ins>+                               0FF2E80D1EE0D430009EABD4 /* PerformanceLoggingClient.cpp in Sources */,
</ins><span class="cx">                           BC8AE34E12EA096A00EB3AE6 /* ScrollableArea.cpp in Sources */,
</span><span class="cx">                          5D925B670F64D4DD00B847F0 /* ScrollAlignment.cpp in Sources */,
</span><span class="cx">                          CA3BF67C10D99BAE00E6CE53 /* ScrollAnimator.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp       2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/page/Page.cpp  2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -70,6 +70,7 @@
</span><span class="cx"> #include "PageDebuggable.h"
</span><span class="cx"> #include "PageGroup.h"
</span><span class="cx"> #include "PageOverlayController.h"
</span><ins>+#include "PerformanceLoggingClient.h"
</ins><span class="cx"> #include "PerformanceMonitor.h"
</span><span class="cx"> #include "PlatformMediaSessionManager.h"
</span><span class="cx"> #include "PlugInClient.h"
</span><span class="lines">@@ -210,6 +211,7 @@
</span><span class="cx">     , m_plugInClient(pageConfiguration.plugInClient)
</span><span class="cx">     , m_validationMessageClient(WTFMove(pageConfiguration.validationMessageClient))
</span><span class="cx">     , m_diagnosticLoggingClient(WTFMove(pageConfiguration.diagnosticLoggingClient))
</span><ins>+    , m_performanceLoggingClient(WTFMove(pageConfiguration.performanceLoggingClient))
</ins><span class="cx">     , m_webGLStateTracker(WTFMove(pageConfiguration.webGLStateTracker))
</span><span class="cx">     , m_libWebRTCProvider(WTFMove(pageConfiguration.libWebRTCProvider))
</span><span class="cx">     , m_openedByDOM(false)
</span><span class="lines">@@ -307,6 +309,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_validationMessageClient = nullptr;
</span><span class="cx">     m_diagnosticLoggingClient = nullptr;
</span><ins>+    m_performanceLoggingClient = nullptr;
</ins><span class="cx">     m_mainFrame->setView(nullptr);
</span><span class="cx">     setGroupName(String());
</span><span class="cx">     allPages->remove(this);
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.h (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.h 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/page/Page.h    2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -109,6 +109,7 @@
</span><span class="cx"> class PageConsoleClient;
</span><span class="cx"> class PageDebuggable;
</span><span class="cx"> class PageGroup;
</span><ins>+class PerformanceLoggingClient;
</ins><span class="cx"> class PerformanceMonitor;
</span><span class="cx"> class PlugInClient;
</span><span class="cx"> class PluginData;
</span><span class="lines">@@ -370,6 +371,8 @@
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT DiagnosticLoggingClient& diagnosticLoggingClient() const;
</span><span class="cx"> 
</span><ins>+    PerformanceLoggingClient* performanceLoggingClient() const { return m_performanceLoggingClient.get(); }
+
</ins><span class="cx">     // Notifications when the Page starts and stops being presented via a native window.
</span><span class="cx">     WEBCORE_EXPORT void setActivityState(ActivityState::Flags);
</span><span class="cx">     ActivityState::Flags activityState() const { return m_activityState; }
</span><span class="lines">@@ -669,6 +672,8 @@
</span><span class="cx">     PlugInClient* m_plugInClient;
</span><span class="cx">     std::unique_ptr<ValidationMessageClient> m_validationMessageClient;
</span><span class="cx">     std::unique_ptr<DiagnosticLoggingClient> m_diagnosticLoggingClient;
</span><ins>+    std::unique_ptr<PerformanceLoggingClient> m_performanceLoggingClient;
+    
</ins><span class="cx">     std::unique_ptr<WebGLStateTracker> m_webGLStateTracker;
</span><span class="cx"> 
</span><span class="cx">     UniqueRef<LibWebRTCProvider> m_libWebRTCProvider;
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageConfigurationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageConfiguration.cpp (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageConfiguration.cpp  2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/page/PageConfiguration.cpp     2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include "DiagnosticLoggingClient.h"
</span><span class="cx"> #include "EditorClient.h"
</span><span class="cx"> #include "LibWebRTCProvider.h"
</span><ins>+#include "PerformanceLoggingClient.h"
</ins><span class="cx"> #include "PluginInfoProvider.h"
</span><span class="cx"> #include "SocketProvider.h"
</span><span class="cx"> #include "StorageNamespaceProvider.h"
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageConfigurationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageConfiguration.h (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageConfiguration.h    2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/page/PageConfiguration.h       2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> class InspectorClient;
</span><span class="cx"> class LibWebRTCProvider;
</span><span class="cx"> class PaymentCoordinatorClient;
</span><ins>+class PerformanceLoggingClient;
</ins><span class="cx"> class PlugInClient;
</span><span class="cx"> class PluginInfoProvider;
</span><span class="cx"> class ProgressTrackerClient;
</span><span class="lines">@@ -81,6 +82,7 @@
</span><span class="cx">     std::unique_ptr<ValidationMessageClient> validationMessageClient;
</span><span class="cx">     FrameLoaderClient* loaderClientForMainFrame { nullptr };
</span><span class="cx">     std::unique_ptr<DiagnosticLoggingClient> diagnosticLoggingClient;
</span><ins>+    std::unique_ptr<PerformanceLoggingClient> performanceLoggingClient;
</ins><span class="cx">     std::unique_ptr<WebGLStateTracker> webGLStateTracker;
</span><span class="cx"> 
</span><span class="cx">     RefPtr<ApplicationCacheStorage> applicationCacheStorage;
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceLoggingClientcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/page/PerformanceLoggingClient.cpp (0 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceLoggingClient.cpp                           (rev 0)
+++ trunk/Source/WebCore/page/PerformanceLoggingClient.cpp      2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PerformanceLoggingClient.h"
+
+#include "ScrollingCoordinator.h"
+#include <wtf/text/StringBuilder.h>
+
+namespace WebCore {
+
+String PerformanceLoggingClient::synchronousScrollingReasonsAsString(SynchronousScrollingReasons synchronousScrollingReasons)
+{
+    if (!synchronousScrollingReasons)
+        return emptyString();
+
+    StringBuilder reasons;
+
+    if (synchronousScrollingReasons & ScrollingCoordinator::ForcedOnMainThread)
+        reasons.appendLiteral("forced,");
+    if (synchronousScrollingReasons & ScrollingCoordinator::HasSlowRepaintObjects)
+        reasons.appendLiteral("slow-repaint objects,");
+    if (synchronousScrollingReasons & ScrollingCoordinator::HasViewportConstrainedObjectsWithoutSupportingFixedLayers)
+        reasons.appendLiteral("viewport-constrained objects,");
+    if (synchronousScrollingReasons & ScrollingCoordinator::HasNonLayerViewportConstrainedObjects)
+        reasons.appendLiteral("non-layer viewport-constrained objects,");
+    if (synchronousScrollingReasons & ScrollingCoordinator::IsImageDocument)
+        reasons.appendLiteral("image document,");
+
+    // Strip the trailing comma.
+    return reasons.toString().left(reasons.length() - 1);
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceLoggingClienth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/page/PerformanceLoggingClient.h (0 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceLoggingClient.h                             (rev 0)
+++ trunk/Source/WebCore/page/PerformanceLoggingClient.h        2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <wtf/FastMalloc.h>
+#include <wtf/MonotonicTime.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+typedef unsigned SynchronousScrollingReasons;
+
+class PerformanceLoggingClient {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    enum class ScrollingEvent {
+        ExposedTilelessArea,
+        FilledTile,
+        SwitchedScrollingMode,
+    };
+    virtual void logScrollingEvent(ScrollingEvent, MonotonicTime, uint64_t) = 0;
+
+    WEBCORE_EXPORT static String synchronousScrollingReasonsAsString(SynchronousScrollingReasons);
+
+    virtual ~PerformanceLoggingClient() { }
+};
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp        2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp   2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "MainFrame.h"
</span><span class="cx"> #include "Page.h"
</span><ins>+#include "PerformanceLoggingClient.h"
</ins><span class="cx"> #include "ScrollAnimator.h"
</span><span class="cx"> #include "ScrollingConstraints.h"
</span><span class="cx"> #include "ScrollingStateFixedNode.h"
</span><span class="lines">@@ -694,7 +695,19 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><del>-    
</del><ins>+
+void AsyncScrollingCoordinator::reportExposedUnfilledArea(MonotonicTime timestamp, unsigned unfilledArea)
+{
+    if (m_page && m_page->performanceLoggingClient())
+        m_page->performanceLoggingClient()->logScrollingEvent(PerformanceLoggingClient::ScrollingEvent::ExposedTilelessArea, timestamp, unfilledArea);
+}
+
+void AsyncScrollingCoordinator::reportSynchronousScrollingReasonsChanged(MonotonicTime timestamp, SynchronousScrollingReasons reasons)
+{
+    if (m_page && m_page->performanceLoggingClient())
+        m_page->performanceLoggingClient()->logScrollingEvent(PerformanceLoggingClient::ScrollingEvent::SwitchedScrollingMode, timestamp, reasons);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(ASYNC_SCROLLING)
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h  2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h     2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -65,6 +65,9 @@
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT void updateExpectsWheelEventTestTriggerWithFrameView(const FrameView&) override;
</span><span class="cx"> 
</span><ins>+    void reportExposedUnfilledArea(MonotonicTime, unsigned unfilledArea);
+    void reportSynchronousScrollingReasonsChanged(MonotonicTime, SynchronousScrollingReasons);
+
</ins><span class="cx"> protected:
</span><span class="cx">     WEBCORE_EXPORT AsyncScrollingCoordinator(Page*);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingTreeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.h (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingTree.h      2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.h 2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -93,6 +93,9 @@
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT virtual void currentSnapPointIndicesDidChange(ScrollingNodeID, unsigned horizontal, unsigned vertical) = 0;
</span><span class="cx"> 
</span><ins>+    WEBCORE_EXPORT virtual void reportSynchronousScrollingReasonsChanged(MonotonicTime, SynchronousScrollingReasons) { }
+    WEBCORE_EXPORT virtual void reportExposedUnfilledArea(MonotonicTime, unsigned /* unfilledArea */) { }
+
</ins><span class="cx">     FloatPoint mainFrameScrollPosition();
</span><span class="cx">     
</span><span class="cx"> #if PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingThreadedScrollingTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp    2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp       2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -105,6 +105,20 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ThreadedScrollingTree::reportSynchronousScrollingReasonsChanged(MonotonicTime timestamp, SynchronousScrollingReasons reasons)
+{
+    RunLoop::main().dispatch([scrollingCoordinator = m_scrollingCoordinator, timestamp, reasons] {
+        scrollingCoordinator->reportSynchronousScrollingReasonsChanged(timestamp, reasons);
+    });
+}
+
+void ThreadedScrollingTree::reportExposedUnfilledArea(MonotonicTime timestamp, unsigned unfilledArea)
+{
+    RunLoop::main().dispatch([scrollingCoordinator = m_scrollingCoordinator, timestamp, unfilledArea] {
+        scrollingCoordinator->reportExposedUnfilledArea(timestamp, unfilledArea);
+    });
+}
+
</ins><span class="cx"> void ThreadedScrollingTree::currentSnapPointIndicesDidChange(ScrollingNodeID nodeID, unsigned horizontal, unsigned vertical)
</span><span class="cx"> {
</span><span class="cx">     if (!m_scrollingCoordinator)
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingThreadedScrollingTreeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.h (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.h      2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.h 2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -66,6 +66,9 @@
</span><span class="cx">     void removeTestDeferralForReason(WheelEventTestTrigger::ScrollableAreaIdentifier, WheelEventTestTrigger::DeferTestTriggerReason) override;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    void reportExposedUnfilledArea(MonotonicTime, unsigned unfilledArea) override;
+    void reportSynchronousScrollingReasonsChanged(MonotonicTime, SynchronousScrollingReasons) override;
+
</ins><span class="cx"> private:
</span><span class="cx">     bool isThreadedScrollingTree() const override { return true; }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingmacScrollingTreeFrameScrollingNodeMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h     2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h        2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx">     FloatSize viewportSize() const override;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    void logExposedUnfilledArea();
</del><ins>+    unsigned exposedUnfilledArea() const;
</ins><span class="cx"> 
</span><span class="cx">     ScrollController m_scrollController;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingmacScrollingTreeFrameScrollingNodeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm    2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm       2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -44,13 +44,10 @@
</span><span class="cx"> #import <QuartzCore/QuartzCore.h>
</span><span class="cx"> #import <wtf/CurrentTime.h>
</span><span class="cx"> #import <wtf/Deque.h>
</span><del>-#import <wtf/text/StringBuilder.h>
</del><span class="cx"> #import <wtf/text/CString.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static void logThreadedScrollingMode(unsigned synchronousScrollingReasons);
-
</del><span class="cx"> Ref<ScrollingTreeFrameScrollingNode> ScrollingTreeFrameScrollingNodeMac::create(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
</span><span class="cx"> {
</span><span class="cx">     return adoptRef(*new ScrollingTreeFrameScrollingNodeMac(scrollingTree, nodeID));
</span><span class="lines">@@ -149,10 +146,8 @@
</span><span class="cx">         logScrollingMode = true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (logScrollingMode) {
-        if (scrollingTree().scrollingPerformanceLoggingEnabled())
-            logThreadedScrollingMode(synchronousScrollingReasons());
-    }
</del><ins>+    if (logScrollingMode && scrollingTree().scrollingPerformanceLoggingEnabled())
+        scrollingTree().reportSynchronousScrollingReasonsChanged(MonotonicTime::now(), synchronousScrollingReasons());
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_SCROLL_SNAP)
</span><span class="cx">     if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::HorizontalSnapOffsets) || scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::HorizontalSnapOffsetRanges))
</span><span class="lines">@@ -389,8 +384,13 @@
</span><span class="cx"> 
</span><span class="cx">     ScrollingTreeFrameScrollingNode::setScrollPosition(roundedPosition);
</span><span class="cx"> 
</span><del>-    if (scrollingTree().scrollingPerformanceLoggingEnabled())
-        logExposedUnfilledArea();
</del><ins>+    if (scrollingTree().scrollingPerformanceLoggingEnabled()) {
+        unsigned unfilledArea = exposedUnfilledArea();
+        if (unfilledArea || m_lastScrollHadUnfilledPixels)
+            scrollingTree().reportExposedUnfilledArea(MonotonicTime::now(), unfilledArea);
+
+        m_lastScrollHadUnfilledPixels = unfilledArea;
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints(const FloatPoint& scrollPosition)
</span><span class="lines">@@ -529,7 +529,7 @@
</span><span class="cx">     scrollingTree().setMainFramePinState(pinnedToTheLeft, pinnedToTheRight, pinnedToTheTop, pinnedToTheBottom);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScrollingTreeFrameScrollingNodeMac::logExposedUnfilledArea()
</del><ins>+unsigned ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea() const
</ins><span class="cx"> {
</span><span class="cx">     Region paintedVisibleTiles;
</span><span class="cx"> 
</span><span class="lines">@@ -555,38 +555,9 @@
</span><span class="cx"> 
</span><span class="cx">     FloatPoint scrollPosition = this->scrollPosition();
</span><span class="cx">     FloatRect viewPortRect(FloatPoint(), scrollableAreaSize());
</span><del>-    unsigned unfilledArea = TileController::blankPixelCountForTiles(tiles, viewPortRect, IntPoint(-scrollPosition.x(), -scrollPosition.y()));
-
-    if (unfilledArea || m_lastScrollHadUnfilledPixels)
-        WTFLogAlways("SCROLLING: Exposed tileless area. Time: %f Unfilled Pixels: %u\n", WTF::monotonicallyIncreasingTime(), unfilledArea);
-
-    m_lastScrollHadUnfilledPixels = unfilledArea;
</del><ins>+    return TileController::blankPixelCountForTiles(tiles, viewPortRect, IntPoint(-scrollPosition.x(), -scrollPosition.y()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void logThreadedScrollingMode(unsigned synchronousScrollingReasons)
-{
-    if (synchronousScrollingReasons) {
-        StringBuilder reasonsDescription;
-
-        if (synchronousScrollingReasons & ScrollingCoordinator::ForcedOnMainThread)
-            reasonsDescription.appendLiteral("forced,");
-        if (synchronousScrollingReasons & ScrollingCoordinator::HasSlowRepaintObjects)
-            reasonsDescription.appendLiteral("slow-repaint objects,");
-        if (synchronousScrollingReasons & ScrollingCoordinator::HasViewportConstrainedObjectsWithoutSupportingFixedLayers)
-            reasonsDescription.appendLiteral("viewport-constrained objects,");
-        if (synchronousScrollingReasons & ScrollingCoordinator::HasNonLayerViewportConstrainedObjects)
-            reasonsDescription.appendLiteral("non-layer viewport-constrained objects,");
-        if (synchronousScrollingReasons & ScrollingCoordinator::IsImageDocument)
-            reasonsDescription.appendLiteral("image document,");
-
-        // Strip the trailing comma.
-        String reasonsDescriptionTrimmed = reasonsDescription.toString().left(reasonsDescription.length() - 1);
-
-        WTFLogAlways("SCROLLING: Switching to main-thread scrolling mode. Time: %f Reason(s): %s\n", WTF::monotonicallyIncreasingTime(), reasonsDescriptionTrimmed.ascii().data());
-    } else
-        WTFLogAlways("SCROLLING: Switching to threaded scrolling mode. Time: %f\n", WTF::monotonicallyIncreasingTime());
-}
-
</del><span class="cx"> #if ENABLE(CSS_SCROLL_SNAP)
</span><span class="cx"> FloatPoint ScrollingTreeFrameScrollingNodeMac::scrollOffset() const
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsLayerClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h     2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h        2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -129,6 +129,8 @@
</span><span class="cx"> 
</span><span class="cx">     virtual bool needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack(const GraphicsLayer&) const { return false; }
</span><span class="cx"> 
</span><ins>+    virtual void logFilledVisibleFreshTile(unsigned) { };
+
</ins><span class="cx"> #ifndef NDEBUG
</span><span class="cx">     // RenderLayerBacking overrides this to verify that it is not
</span><span class="cx">     // currently painting contents. An ASSERT fails, if it is.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp    2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp       2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -1620,6 +1620,11 @@
</span><span class="cx">     return client().useGiantTiles();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void GraphicsLayerCA::platformCALayerLogFilledVisibleFreshTile(unsigned blankPixelCount)
+{
+    client().logFilledVisibleFreshTile(blankPixelCount);
+}
+
</ins><span class="cx"> static PlatformCALayer::LayerType layerTypeForCustomBackdropAppearance(GraphicsLayer::CustomAppearance appearance)
</span><span class="cx"> {
</span><span class="cx">     return appearance == GraphicsLayer::LightBackdropAppearance ? PlatformCALayer::LayerTypeLightSystemBackdropLayer : PlatformCALayer::LayerTypeDarkSystemBackdropLayer;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h      2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h 2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -201,6 +201,7 @@
</span><span class="cx">     WEBCORE_EXPORT bool platformCALayerShouldAggressivelyRetainTiles(PlatformCALayer*) const override;
</span><span class="cx">     WEBCORE_EXPORT bool platformCALayerShouldTemporarilyRetainTileCohorts(PlatformCALayer*) const override;
</span><span class="cx">     WEBCORE_EXPORT bool platformCALayerUseGiantTiles() const override;
</span><ins>+    WEBCORE_EXPORT void platformCALayerLogFilledVisibleFreshTile(unsigned) override;
</ins><span class="cx"> 
</span><span class="cx">     bool isCommittingChanges() const override { return m_isCommittingChanges; }
</span><span class="cx">     bool isUsingDisplayListDrawing(PlatformCALayer*) const override { return m_usesDisplayListDrawing; }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaPlatformCALayerClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h        2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h   2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -65,6 +65,8 @@
</span><span class="cx"> 
</span><span class="cx">     virtual bool isUsingDisplayListDrawing(PlatformCALayer*) const { return false; }
</span><span class="cx"> 
</span><ins>+    virtual void platformCALayerLogFilledVisibleFreshTile(unsigned /* blankPixelCount */) { }
+
</ins><span class="cx"> protected:
</span><span class="cx">     virtual ~PlatformCALayerClient() {}
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaTileControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.cpp (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/TileController.cpp     2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.cpp        2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -777,6 +777,11 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+void TileController::logFilledVisibleFreshTile(unsigned blankPixelCount)
+{
+    owningGraphicsLayer()->platformCALayerLogFilledVisibleFreshTile(blankPixelCount);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaTileControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.h (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/TileController.h       2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.h  2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef TileController_h
-#define TileController_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include "FloatRect.h"
</span><span class="cx"> #include "IntRect.h"
</span><span class="lines">@@ -138,6 +137,8 @@
</span><span class="cx">     const TileGrid& tileGrid() const { return *m_tileGrid; }
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT Vector<RefPtr<PlatformCALayer>> containerLayers();
</span><ins>+    
+    void logFilledVisibleFreshTile(unsigned blankPixelCount);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     TileGrid& tileGrid() { return *m_tileGrid; }
</span><span class="lines">@@ -212,13 +213,12 @@
</span><span class="cx"> 
</span><span class="cx">     int m_marginSize { kDefaultTileSize };
</span><span class="cx"> 
</span><ins>+    Scrollability m_scrollability { HorizontallyScrollable | VerticallyScrollable };
+
</ins><span class="cx">     // m_marginTop and m_marginBottom are the height in pixels of the top and bottom margin tiles. The width
</span><span class="cx">     // of those tiles will be equivalent to the width of the other tiles in the grid. m_marginRight and
</span><span class="cx">     // m_marginLeft are the width in pixels of the right and left margin tiles, respectively. The height of
</span><span class="cx">     // those tiles will be equivalent to the height of the other tiles in the grid.
</span><del>-    
-    Scrollability m_scrollability { HorizontallyScrollable | VerticallyScrollable };
-    
</del><span class="cx">     BoxExtent<bool> m_marginEdges;
</span><span class="cx">     
</span><span class="cx">     bool m_isInWindow { false };
</span><span class="lines">@@ -240,4 +240,3 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><del>-#endif // TileController_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaTileGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp   2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp      2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -739,7 +739,7 @@
</span><span class="cx">         visiblePart.intersect(m_controller.visibleRect());
</span><span class="cx"> 
</span><span class="cx">         if (repaintCount == 1 && !visiblePart.isEmpty())
</span><del>-            WTFLogAlways("SCROLLING: Filled visible fresh tile. Time: %f Unfilled Pixels: %u\n", WTF::monotonicallyIncreasingTime(), blankPixelCount());
</del><ins>+            m_controller.logFilledVisibleFreshTile(blankPixelCount());
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaTileGridh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/TileGrid.h (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/TileGrid.h     2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/platform/graphics/ca/TileGrid.h        2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef TileGrid_h
-#define TileGrid_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include "IntPointHash.h"
</span><span class="cx"> #include "IntRect.h"
</span><span class="lines">@@ -178,4 +177,4 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span><del>-#endif
</del><ins>+
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerBackingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp    2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp       2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "MainFrame.h"
</span><span class="cx"> #include "Page.h"
</span><ins>+#include "PerformanceLoggingClient.h"
</ins><span class="cx"> #include "PluginViewBase.h"
</span><span class="cx"> #include "ProgressTracker.h"
</span><span class="cx"> #include "RenderFlowThread.h"
</span><span class="lines">@@ -2695,6 +2696,12 @@
</span><span class="cx">     return renderer().settings().useGiantTiles();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RenderLayerBacking::logFilledVisibleFreshTile(unsigned blankPixelCount)
+{
+    if (PerformanceLoggingClient* loggingClient = renderer().page().performanceLoggingClient())
+        loggingClient->logScrollingEvent(PerformanceLoggingClient::ScrollingEvent::FilledTile, MonotonicTime::now(), blankPixelCount);
+}
+
</ins><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> void RenderLayerBacking::verifyNotPainting()
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerBackingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.h (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerBacking.h      2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.h 2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -216,6 +216,7 @@
</span><span class="cx">     bool shouldAggressivelyRetainTiles(const GraphicsLayer*) const override;
</span><span class="cx">     bool shouldTemporarilyRetainTileCohorts(const GraphicsLayer*) const override;
</span><span class="cx">     bool useGiantTiles() const override;
</span><ins>+    void logFilledVisibleFreshTile(unsigned) override;
</ins><span class="cx">     bool needsPixelAligment() const override { return !m_isMainFrameRenderViewLayer; }
</span><span class="cx"> 
</span><span class="cx">     LayoutSize subpixelOffsetFromRenderer() const { return m_subpixelOffsetFromRenderer; }
</span></span></pre></div>
<a id="trunkSourceWebKit2CMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/CMakeLists.txt (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/CMakeLists.txt      2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebKit2/CMakeLists.txt 2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -554,6 +554,7 @@
</span><span class="cx">     WebProcess/WebCoreSupport/WebGeolocationClient.cpp
</span><span class="cx">     WebProcess/WebCoreSupport/WebInspectorClient.cpp
</span><span class="cx">     WebProcess/WebCoreSupport/WebNotificationClient.cpp
</span><ins>+    WebProcess/WebCoreSupport/WebPerformanceLoggingClient.cpp
</ins><span class="cx">     WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
</span><span class="cx">     WebProcess/WebCoreSupport/WebPlugInClient.cpp
</span><span class="cx">     WebProcess/WebCoreSupport/WebPopupMenu.cpp
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog   2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebKit2/ChangeLog      2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2017-06-02  Simon Fraser  <simon.fraser@apple.com>
+
+        All scroll peformance logging should happen in the UI process
+        https://bugs.webkit.org/show_bug.cgi?id=172874
+        rdar://problem/24474830
+
+        Reviewed by Tim Horton.
+
+        Printing to stdout from the WebProcess doesn't show up anywhere in non-development builds,
+        so we have to log from the UI process.
+
+        Achieve this by adding a PerformanceLoggingClient to Page which forwards messages to
+        WebPageProxy, which prints them with the same format they had before. Some plumbing through
+        PlatformCALayerClient and GraphicsLayerClient is required to get messages from TileControllers
+        through to something that can get to Page.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::logScrollingEvent):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * WebKit2.xcodeproj/project.pbxproj:
+        * WebProcess/WebCoreSupport/WebPerformanceLoggingClient.cpp: Added.
+        (WebKit::WebPerformanceLoggingClient::WebPerformanceLoggingClient):
+        (WebKit::WebPerformanceLoggingClient::logScrollingEvent):
+        * WebProcess/WebCoreSupport/WebPerformanceLoggingClient.h: Added.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::m_cpuLimit):
+
</ins><span class="cx"> 2017-06-02  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r206386): Xactimate Website Crashes @ com.apple.WebKit: WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant + 255
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp  2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp     2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -124,6 +124,7 @@
</span><span class="cx"> #include <WebCore/JSDOMExceptionHandling.h>
</span><span class="cx"> #include <WebCore/LengthBox.h>
</span><span class="cx"> #include <WebCore/MIMETypeRegistry.h>
</span><ins>+#include <WebCore/PerformanceLoggingClient.h>
</ins><span class="cx"> #include <WebCore/PublicSuffix.h>
</span><span class="cx"> #include <WebCore/RenderEmbeddedObject.h>
</span><span class="cx"> #include <WebCore/SerializedCryptoKeyWrap.h>
</span><span class="lines">@@ -5211,6 +5212,26 @@
</span><span class="cx">     m_diagnosticLoggingClient->logDiagnosticMessageWithEnhancedPrivacy(this, message, description);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPageProxy::logScrollingEvent(uint32_t eventType, MonotonicTime timestamp, uint64_t data)
+{
+    PerformanceLoggingClient::ScrollingEvent event = static_cast<PerformanceLoggingClient::ScrollingEvent>(eventType);
+
+    switch (event) {
+    case PerformanceLoggingClient::ScrollingEvent::ExposedTilelessArea:
+        WTFLogAlways("SCROLLING: Exposed tileless area. Time: %f Unfilled Pixels: %llu\n", timestamp.secondsSinceEpoch().value(), (unsigned long long)data);
+        break;
+    case PerformanceLoggingClient::ScrollingEvent::FilledTile:
+        WTFLogAlways("SCROLLING: Filled visible fresh tile. Time: %f Unfilled Pixels: %llu\n", timestamp.secondsSinceEpoch().value(), (unsigned long long)data);
+        break;
+    case PerformanceLoggingClient::ScrollingEvent::SwitchedScrollingMode:
+        if (data)
+            WTFLogAlways("SCROLLING: Switching to main-thread scrolling mode. Time: %f Reason(s): %s\n", timestamp.secondsSinceEpoch().value(), PerformanceLoggingClient::synchronousScrollingReasonsAsString(data).utf8().data());
+        else
+            WTFLogAlways("SCROLLING: Switching to threaded scrolling mode. Time: %f\n", timestamp.secondsSinceEpoch().value());
+        break;
+    }
+}
+
</ins><span class="cx"> void WebPageProxy::rectForCharacterRangeCallback(const IntRect& rect, const EditingRange& actualRange, uint64_t callbackID)
</span><span class="cx"> {
</span><span class="cx">     MESSAGE_CHECK(actualRange.isValid());
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h    2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h       2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -82,6 +82,7 @@
</span><span class="cx"> #include <memory>
</span><span class="cx"> #include <wtf/HashMap.h>
</span><span class="cx"> #include <wtf/HashSet.h>
</span><ins>+#include <wtf/MonotonicTime.h>
</ins><span class="cx"> #include <wtf/Ref.h>
</span><span class="cx"> #include <wtf/RefPtr.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="lines">@@ -1108,6 +1109,9 @@
</span><span class="cx">     void logDiagnosticMessageWithValue(const String& message, const String& description, double value, unsigned significantFigures, WebCore::ShouldSample);
</span><span class="cx">     void logDiagnosticMessageWithEnhancedPrivacy(const String& message, const String& description, WebCore::ShouldSample);
</span><span class="cx"> 
</span><ins>+    // Performance logging.
+    void logScrollingEvent(uint32_t eventType, MonotonicTime, uint64_t);
+
</ins><span class="cx">     // Form validation messages.
</span><span class="cx">     void showValidationMessage(const WebCore::IntRect& anchorClientRect, const String& message);
</span><span class="cx">     void hideValidationMessage();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in  2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in     2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -230,6 +230,9 @@
</span><span class="cx">     LogDiagnosticMessageWithValue(String message, String description, double value, unsigned significantFigures, enum WebCore::ShouldSample shouldSample)
</span><span class="cx">     LogDiagnosticMessageWithEnhancedPrivacy(String message, String description, enum WebCore::ShouldSample shouldSample)
</span><span class="cx"> 
</span><ins>+    # Performance logging
+    LogScrollingEvent(uint32_t eventType, MonotonicTime timestamp, uint64_t data)
+
</ins><span class="cx">     # Editor notifications
</span><span class="cx">     EditorStateChanged(struct WebKit::EditorState editorState)
</span><span class="cx">     CompositionWasCanceled()
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj   2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj      2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -86,6 +86,8 @@
</span><span class="cx">          0F5947A8187B517600437857 /* RemoteScrollingCoordinatorMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5947A6187B517600437857 /* RemoteScrollingCoordinatorMessages.h */; };
</span><span class="cx">          0F5E200318E77051003EC3E5 /* PlatformCAAnimationRemote.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F5E200118E77051003EC3E5 /* PlatformCAAnimationRemote.mm */; };
</span><span class="cx">          0F5E200418E77051003EC3E5 /* PlatformCAAnimationRemote.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5E200218E77051003EC3E5 /* PlatformCAAnimationRemote.h */; };
</span><ins>+               0F850FE61ED7C39F00FB77A7 /* WebPerformanceLoggingClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F850FE41ED7C39F00FB77A7 /* WebPerformanceLoggingClient.cpp */; };
+               0F850FE71ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F850FE51ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h */; };
</ins><span class="cx">           0F931C1C18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F931C1A18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h */; };
</span><span class="cx">          0F931C1D18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F931C1B18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm */; };
</span><span class="cx">          0FB659231208B4DB0044816C /* DrawingAreaInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB659221208B4DB0044816C /* DrawingAreaInfo.h */; };
</span><span class="lines">@@ -2240,6 +2242,8 @@
</span><span class="cx">          0F5E200218E77051003EC3E5 /* PlatformCAAnimationRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformCAAnimationRemote.h; sourceTree = "<group>"; };
</span><span class="cx">          0F707C771A1FEE8300DA7A45 /* RemoteLayerTreeScrollingPerformanceData.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteLayerTreeScrollingPerformanceData.mm; sourceTree = "<group>"; };
</span><span class="cx">          0F707C791A1FEEA300DA7A45 /* RemoteLayerTreeScrollingPerformanceData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerTreeScrollingPerformanceData.h; sourceTree = "<group>"; };
</span><ins>+               0F850FE41ED7C39F00FB77A7 /* WebPerformanceLoggingClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPerformanceLoggingClient.cpp; sourceTree = "<group>"; };
+               0F850FE51ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPerformanceLoggingClient.h; sourceTree = "<group>"; };
</ins><span class="cx">           0F931C1A18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScrollingTreeOverflowScrollingNodeIOS.h; path = Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h; sourceTree = "<group>"; };
</span><span class="cx">          0F931C1B18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ScrollingTreeOverflowScrollingNodeIOS.mm; path = Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm; sourceTree = "<group>"; };
</span><span class="cx">          0FB659221208B4DB0044816C /* DrawingAreaInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingAreaInfo.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -6592,6 +6596,8 @@
</span><span class="cx">                          31099968146C71F50029DEB9 /* WebNotificationClient.h */,
</span><span class="cx">                          512127C11908239A00DAF35C /* WebPasteboardOverrides.cpp */,
</span><span class="cx">                          512127C21908239A00DAF35C /* WebPasteboardOverrides.h */,
</span><ins>+                               0F850FE41ED7C39F00FB77A7 /* WebPerformanceLoggingClient.cpp */,
+                               0F850FE51ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h */,
</ins><span class="cx">                           1A3E736011CC2659007BD539 /* WebPlatformStrategies.cpp */,
</span><span class="cx">                          1A3E735F11CC2659007BD539 /* WebPlatformStrategies.h */,
</span><span class="cx">                          31D5929C166E05FF00E6BF02 /* WebPlugInClient.cpp */,
</span><span class="lines">@@ -8603,6 +8609,7 @@
</span><span class="cx">                          1AA9BAE1184FFAC7003B6BC6 /* WeakObjCPtr.h in Headers */,
</span><span class="cx">                          CEDA12E3152CD1B300D9E08D /* WebAlternativeTextClient.h in Headers */,
</span><span class="cx">                          9955A6EC1C7980C200EB6A93 /* WebAutomationSession.h in Headers */,
</span><ins>+                               0F850FE71ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h in Headers */,
</ins><span class="cx">                           99C3AE2D1DADA6AD00AF5C16 /* WebAutomationSessionMacros.h in Headers */,
</span><span class="cx">                          1C0A19581C90068F00FE0EBB /* WebAutomationSessionMessages.h in Headers */,
</span><span class="cx">                          1C0A19471C8FF1A800FE0EBB /* WebAutomationSessionProxy.h in Headers */,
</span><span class="lines">@@ -10288,6 +10295,7 @@
</span><span class="cx">                          BC9BA5041697C45300E44616 /* WebKit2Initialize.cpp in Sources */,
</span><span class="cx">                          51FB08FF1639DE1A00EC324A /* WebLoaderStrategy.cpp in Sources */,
</span><span class="cx">                          CD003A5219D49B5D005ABCE0 /* WebMediaKeyStorageManager.cpp in Sources */,
</span><ins>+                               0F850FE61ED7C39F00FB77A7 /* WebPerformanceLoggingClient.cpp in Sources */,
</ins><span class="cx">                           C98C48A51B6FD4C300145103 /* WebMediaSessionFocusManager.cpp in Sources */,
</span><span class="cx">                          C9C1833B1B74026A007036A7 /* WebMediaSessionFocusManagerClient.cpp in Sources */,
</span><span class="cx">                          C9CD43971B4B001900239E33 /* WebMediaSessionMetadata.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebPerformanceLoggingClientcppfromrev217736trunkSourceWebCorepagePageConfigurationcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPerformanceLoggingClient.cpp (from rev 217736, trunk/Source/WebCore/page/PageConfiguration.cpp) (0 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPerformanceLoggingClient.cpp                           (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPerformanceLoggingClient.cpp      2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+#include "WebPerformanceLoggingClient.h"
+
+#include "WebCoreArgumentCoders.h"
+#include "WebPage.h"
+#include "WebPageProxyMessages.h"
+
+namespace WebKit {
+
+using namespace WebCore;
+
+WebPerformanceLoggingClient::WebPerformanceLoggingClient(WebPage& page)
+    : m_page(page)
+{
+}
+
+void WebPerformanceLoggingClient::logScrollingEvent(ScrollingEvent event, MonotonicTime timestamp, uint64_t data)
+{
+    m_page.send(Messages::WebPageProxy::LogScrollingEvent(static_cast<uint32_t>(event), timestamp, data));
+}
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebPerformanceLoggingClienthfromrev217736trunkSourceWebCorepagePageConfigurationcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPerformanceLoggingClient.h (from rev 217736, trunk/Source/WebCore/page/PageConfiguration.cpp) (0 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPerformanceLoggingClient.h                             (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPerformanceLoggingClient.h        2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#pragma once
+
+#include <WebCore/PerformanceLoggingClient.h>
+#include <wtf/Forward.h>
+
+namespace WebKit {
+
+class WebPage;
+
+class WebPerformanceLoggingClient : public WebCore::PerformanceLoggingClient {
+public:
+    WebPerformanceLoggingClient(WebPage&);
+    virtual ~WebPerformanceLoggingClient() = default;
+
+private:
+    void logScrollingEvent(ScrollingEvent, MonotonicTime, uint64_t) override;
+
+    WebPage& m_page;
+};
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (217736 => 217737)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp      2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2017-06-02 23:06:13 UTC (rev 217737)
</span><span class="lines">@@ -102,6 +102,7 @@
</span><span class="cx"> #include "WebPageOverlay.h"
</span><span class="cx"> #include "WebPageProxyMessages.h"
</span><span class="cx"> #include "WebPaymentCoordinator.h"
</span><ins>+#include "WebPerformanceLoggingClient.h"
</ins><span class="cx"> #include "WebPlugInClient.h"
</span><span class="cx"> #include "WebPluginInfoProvider.h"
</span><span class="cx"> #include "WebPopupMenu.h"
</span><span class="lines">@@ -395,6 +396,8 @@
</span><span class="cx">     pageConfiguration.loaderClientForMainFrame = new WebFrameLoaderClient;
</span><span class="cx">     pageConfiguration.progressTrackerClient = new WebProgressTrackerClient(*this);
</span><span class="cx">     pageConfiguration.diagnosticLoggingClient = std::make_unique<WebDiagnosticLoggingClient>(*this);
</span><ins>+    pageConfiguration.performanceLoggingClient = std::make_unique<WebPerformanceLoggingClient>(*this);
+
</ins><span class="cx">     pageConfiguration.webGLStateTracker = std::make_unique<WebGLStateTracker>([this](bool isUsingHighPerformanceWebGL) {
</span><span class="cx">         send(Messages::WebPageProxy::SetIsUsingHighPerformanceWebGL(isUsingHighPerformanceWebGL));
</span><span class="cx">     });
</span></span></pre>
</div>
</div>

</body>
</html>