<!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>[213688] 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/213688">213688</a></dd>
<dt>Author</dt> <dd>wilander@apple.com</dd>
<dt>Date</dt> <dd>2017-03-09 16:46:25 -0800 (Thu, 09 Mar 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Resource Load Statistics: Remove statistics data as part of full website data removal
https://bugs.webkit.org/show_bug.cgi?id=169448

Reviewed by Alex Christensen.

Source/WebCore:

Test: http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store.html

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore):
    The version of this function that takes a modifiedSince parameter
    checks if it is equal to or less than the start of the Unix epoch.
    If so, it clears the store. This is to support clear all website
    data.
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatisticsStore.cpp:
(WebCore::ResourceLoadStatisticsStore::clearInMemoryAndPersistent):
(WebCore::ResourceLoadStatisticsStore::setWritePersistentStoreCallback):
* loader/ResourceLoadStatisticsStore.h:
    Added m_writePersistentStoreHandler, a setter for it, and
    ResourceLoadStatisticsStore::clearInMemoryAndPersistent().

Source/WebKit2:

* UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
(WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStore):
    Infrastructure for test.
* UIProcess/API/C/WKResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsManager.cpp:
(WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore):
    Infrastructure for test.
* UIProcess/WebResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
    Change due to the break-out of
    WebResourceLoadStatisticsStore::writeStoreToDisk().
(WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
    Now sets m_writePersistentStoreHandler in
    WebCore::ResourceLoadStatisticsStore.
(WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk):
    Separated out this function to make it available for the function set as
    m_writePersistentStoreHandler in WebCore::ResourceLoadStatisticsStore.
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):
    Both WebsiteDataStore::removeData() functions now cover resource load
    statistics.

Tools:

This patch adds infrastructure for the new TestRunner function
statisticsClearInMemoryAndPersistentStore().

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::statisticsClearInMemoryAndPersistentStore):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::statisticsClearInMemoryAndPersistentStore):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

LayoutTests:

* http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store.html: Added.
* platform/wk2/TestExpectations:
    Marked as [ Pass ] for WebKit2.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformwk2TestExpectations">trunk/LayoutTests/platform/wk2/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoadObservercpp">trunk/Source/WebCore/loader/ResourceLoadObserver.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoadObserverh">trunk/Source/WebCore/loader/ResourceLoadObserver.h</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoadStatisticsStorecpp">trunk/Source/WebCore/loader/ResourceLoadStatisticsStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoadStatisticsStoreh">trunk/Source/WebCore/loader/ResourceLoadStatisticsStore.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKResourceLoadStatisticsManagercpp">trunk/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKResourceLoadStatisticsManagerh">trunk/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebResourceLoadStatisticsManagercpp">trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebResourceLoadStatisticsManagerh">trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebResourceLoadStatisticsStorecpp">trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebResourceLoadStatisticsStoreh">trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebsiteDataWebsiteDataStorecpp">trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleBindingsTestRunneridl">trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleTestRunnercpp">trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleTestRunnerh">trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestControllercpp">trunk/Tools/WebKitTestRunner/TestController.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestControllerh">trunk/Tools/WebKitTestRunner/TestController.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestInvocationcpp">trunk/Tools/WebKitTestRunner/TestInvocation.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestsloadingresourceLoadStatisticsclearinmemoryandpersistentstoreexpectedtxt">trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsloadingresourceLoadStatisticsclearinmemoryandpersistentstorehtml">trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (213687 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-03-10 00:44:42 UTC (rev 213687)
+++ trunk/LayoutTests/ChangeLog        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2017-03-09  John Wilander  &lt;wilander@apple.com&gt;
+
+        Resource Load Statistics: Remove statistics data as part of full website data removal
+        https://bugs.webkit.org/show_bug.cgi?id=169448
+
+        Reviewed by Alex Christensen.
+
+        * http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store-expected.txt: Added.
+        * http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store.html: Added.
+        * platform/wk2/TestExpectations:
+            Marked as [ Pass ] for WebKit2.
+
</ins><span class="cx"> 2017-03-09  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Show HTTP protocol version and other Network Load Metrics (IP Address, Priority, Connection ID)
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsloadingresourceLoadStatisticsclearinmemoryandpersistentstoreexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store-expected.txt (0 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store-expected.txt        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+main frame - didStartProvisionalLoadForFrame
+main frame - didCommitLoadForFrame
+main frame - didReceiveTitle: Test Cleared Store
+main frame - didFinishDocumentLoadForFrame
+main frame - didHandleOnloadEventsForFrame
+main frame - didFinishLoadForFrame
+PASS Host classified as prevalent resource.
+PASS Host is no longer a prevalent resource after the store was cleared.
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsloadingresourceLoadStatisticsclearinmemoryandpersistentstorehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store.html (0 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store.html        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html lang=&quot;en&quot;&gt;
+&lt;head&gt;
+    &lt;meta charset=&quot;UTF-8&quot;&gt;
+    &lt;title&gt;Test Cleared Store&lt;/title&gt;
+    &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+    const hostUnderTest = &quot;127.0.0.1:8000&quot;;
+    const statisticsUrl = &quot;http://&quot; + hostUnderTest + &quot;/temp&quot;;
+    const topFrameOrigin1 = &quot;http://127.0.0.2:8000/temp&quot;;
+    const topFrameOrigin2 = &quot;http://127.0.0.3:8000/temp&quot;;
+    const topFrameOrigin3 = &quot;http://127.0.0.4:8000/temp&quot;;
+    function runTestRunnerTest() {
+        testRunner.setStatisticsPrevalentResource(statisticsUrl, false);
+        if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
+            testFailed(&quot;Host did not get set as non-prevalent resource.&quot;);
+
+        testRunner.setStatisticsSubframeUnderTopFrameOrigin(statisticsUrl, topFrameOrigin1);
+        testRunner.setStatisticsSubresourceUniqueRedirectTo(statisticsUrl, topFrameOrigin1);
+        testRunner.setStatisticsSubresourceUnderTopFrameOrigin(statisticsUrl, topFrameOrigin1);
+        testRunner.setStatisticsSubresourceUnderTopFrameOrigin(statisticsUrl, topFrameOrigin2);
+        testRunner.setStatisticsSubframeUnderTopFrameOrigin(statisticsUrl, topFrameOrigin2);
+        testRunner.setStatisticsSubresourceUniqueRedirectTo(statisticsUrl, topFrameOrigin3);
+        testRunner.setStatisticsSubresourceUnderTopFrameOrigin(statisticsUrl, topFrameOrigin3);
+
+        testRunner.statisticsFireDataModificationHandler();
+
+        if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
+            testPassed(&quot;Host classified as prevalent resource.&quot;);
+        else
+            testFailed(&quot;Host did not get classified as prevalent resource.&quot;);
+
+        testRunner.statisticsClearInMemoryAndPersistentStore();
+
+        if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
+            testFailed(&quot;Host is still a prevalent resource after the store was cleared.&quot;);
+        else
+            testPassed(&quot;Host is no longer a prevalent resource after the store was cleared.&quot;);
+
+        testRunner.statisticsResetToConsistentState();
+        internals.setResourceLoadStatisticsEnabled(false);
+        testRunner.notifyDone();
+    }
+
+    if (document.location.host === hostUnderTest &amp;&amp; window.testRunner &amp;&amp; window.internals) {
+        testRunner.waitUntilDone();
+        internals.setResourceLoadStatisticsEnabled(true);
+        runTestRunnerTest();
+    }
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsplatformwk2TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/wk2/TestExpectations (213687 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/wk2/TestExpectations        2017-03-10 00:44:42 UTC (rev 213687)
+++ trunk/LayoutTests/platform/wk2/TestExpectations        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -713,6 +713,7 @@
</span><span class="cx"> http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html [ Pass ]
</span><span class="cx"> http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html [ Pass ]
</span><span class="cx"> http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html [ Pass ]
</span><ins>+http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store.html [ Pass ]
</ins><span class="cx"> 
</span><span class="cx"> ### END OF (5) Progressions, expected successes that are expected failures in WebKit1.
</span><span class="cx"> ########################################
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (213687 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-03-10 00:44:42 UTC (rev 213687)
+++ trunk/Source/WebCore/ChangeLog        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2017-03-09  John Wilander  &lt;wilander@apple.com&gt;
+
+        Resource Load Statistics: Remove statistics data as part of full website data removal
+        https://bugs.webkit.org/show_bug.cgi?id=169448
+
+        Reviewed by Alex Christensen.
+
+        Test: http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store.html
+
+        * loader/ResourceLoadObserver.cpp:
+        (WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore):
+            The version of this function that takes a modifiedSince parameter
+            checks if it is equal to or less than the start of the Unix epoch.
+            If so, it clears the store. This is to support clear all website
+            data.
+        * loader/ResourceLoadObserver.h:
+        * loader/ResourceLoadStatisticsStore.cpp:
+        (WebCore::ResourceLoadStatisticsStore::clearInMemoryAndPersistent):
+        (WebCore::ResourceLoadStatisticsStore::setWritePersistentStoreCallback):
+        * loader/ResourceLoadStatisticsStore.h:
+            Added m_writePersistentStoreHandler, a setter for it, and
+            ResourceLoadStatisticsStore::clearInMemoryAndPersistent().
+
</ins><span class="cx"> 2017-03-09  Matt Rajca  &lt;mrajca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Only consider autoplay interference in the first 10 seconds of playback.
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoadObservercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoadObserver.cpp (213687 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoadObserver.cpp        2017-03-10 00:44:42 UTC (rev 213687)
+++ trunk/Source/WebCore/loader/ResourceLoadObserver.cpp        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -68,6 +68,18 @@
</span><span class="cx">     m_store = WTFMove(store);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ResourceLoadObserver::clearInMemoryAndPersistentStore()
+{
+    m_store-&gt;clearInMemoryAndPersistent();
+}
+
+void ResourceLoadObserver::clearInMemoryAndPersistentStore(std::chrono::system_clock::time_point modifiedSince)
+{
+    auto then = std::chrono::system_clock::to_time_t(modifiedSince);
+    if (then &lt;= 0)
+        clearInMemoryAndPersistentStore();
+}
+
</ins><span class="cx"> static inline bool is3xxRedirect(const ResourceResponse&amp; response)
</span><span class="cx"> {
</span><span class="cx">     return response.httpStatusCode() &gt;= 300 &amp;&amp; response.httpStatusCode() &lt;= 399;
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoadObserverh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoadObserver.h (213687 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoadObserver.h        2017-03-10 00:44:42 UTC (rev 213687)
+++ trunk/Source/WebCore/loader/ResourceLoadObserver.h        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -70,6 +70,8 @@
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT RefPtr&lt;ResourceLoadStatisticsStore&gt; statisticsStore();
</span><span class="cx">     WEBCORE_EXPORT void setStatisticsStore(Ref&lt;ResourceLoadStatisticsStore&gt;&amp;&amp;);
</span><ins>+    WEBCORE_EXPORT void clearInMemoryAndPersistentStore();
+    WEBCORE_EXPORT void clearInMemoryAndPersistentStore(std::chrono::system_clock::time_point modifiedSince);
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT String statisticsForOrigin(const String&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoadStatisticsStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoadStatisticsStore.cpp (213687 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoadStatisticsStore.cpp        2017-03-10 00:44:42 UTC (rev 213687)
+++ trunk/Source/WebCore/loader/ResourceLoadStatisticsStore.cpp        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -111,6 +111,13 @@
</span><span class="cx">     fireShouldPartitionCookiesHandler(prevalentResourceDomainsWithoutUserInteraction, true);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ResourceLoadStatisticsStore::clearInMemoryAndPersistent()
+{
+    clear();
+    if (m_writePersistentStoreHandler)
+        m_writePersistentStoreHandler();
+}
+
</ins><span class="cx"> String ResourceLoadStatisticsStore::statisticsForOrigin(const String&amp; origin)
</span><span class="cx"> {
</span><span class="cx">     auto iter = m_resourceStatisticsMap.find(origin);
</span><span class="lines">@@ -153,6 +160,11 @@
</span><span class="cx">     m_shouldPartitionCookiesForDomainsHandler = WTFMove(handler);
</span><span class="cx"> }
</span><span class="cx">     
</span><ins>+void ResourceLoadStatisticsStore::setWritePersistentStoreCallback(std::function&lt;void()&gt;&amp;&amp; handler)
+{
+    m_writePersistentStoreHandler = WTFMove(handler);
+}
+
</ins><span class="cx"> void ResourceLoadStatisticsStore::fireDataModificationHandler()
</span><span class="cx"> {
</span><span class="cx">     if (m_dataAddedHandler)
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoadStatisticsStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoadStatisticsStore.h (213687 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoadStatisticsStore.h        2017-03-10 00:44:42 UTC (rev 213687)
+++ trunk/Source/WebCore/loader/ResourceLoadStatisticsStore.h        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx">     bool isEmpty() const { return m_resourceStatisticsMap.isEmpty(); }
</span><span class="cx">     size_t size() const { return m_resourceStatisticsMap.size(); }
</span><span class="cx">     void clear() { m_resourceStatisticsMap.clear(); }
</span><ins>+    WEBCORE_EXPORT void clearInMemoryAndPersistent();
</ins><span class="cx"> 
</span><span class="cx">     ResourceLoadStatistics&amp; ensureResourceStatisticsForPrimaryDomain(const String&amp;);
</span><span class="cx">     void setResourceStatisticsForPrimaryDomain(const String&amp;, ResourceLoadStatistics&amp;&amp;);
</span><span class="lines">@@ -58,7 +59,9 @@
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT void setNotificationCallback(std::function&lt;void()&gt;);
</span><span class="cx">     WEBCORE_EXPORT void setShouldPartitionCookiesCallback(std::function&lt;void(const Vector&lt;String&gt;&amp; primaryDomains, bool value)&gt;&amp;&amp;);
</span><ins>+    WEBCORE_EXPORT void setWritePersistentStoreCallback(std::function&lt;void()&gt;&amp;&amp;);
</ins><span class="cx"> 
</span><ins>+
</ins><span class="cx">     void fireDataModificationHandler();
</span><span class="cx">     void setTimeToLiveUserInteraction(double seconds);
</span><span class="cx">     WEBCORE_EXPORT void fireShouldPartitionCookiesHandler(const String&amp; primaryDomain, bool value);
</span><span class="lines">@@ -75,6 +78,7 @@
</span><span class="cx">     HashMap&lt;String, ResourceLoadStatistics&gt; m_resourceStatisticsMap;
</span><span class="cx">     std::function&lt;void()&gt; m_dataAddedHandler;
</span><span class="cx">     std::function&lt;void(const Vector&lt;String&gt;&amp; primaryDomains, bool value)&gt; m_shouldPartitionCookiesForDomainsHandler;
</span><ins>+    std::function&lt;void()&gt; m_writePersistentStoreHandler;
</ins><span class="cx"> };
</span><span class="cx">     
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (213687 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2017-03-10 00:44:42 UTC (rev 213687)
+++ trunk/Source/WebKit2/ChangeLog        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2017-03-09  John Wilander  &lt;wilander@apple.com&gt;
+
+        Resource Load Statistics: Remove statistics data as part of full website data removal
+        https://bugs.webkit.org/show_bug.cgi?id=169448
+
+        Reviewed by Alex Christensen.
+
+        * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
+        (WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStore):
+            Infrastructure for test.
+        * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
+        * UIProcess/WebResourceLoadStatisticsManager.cpp:
+        (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore):
+            Infrastructure for test.
+        * UIProcess/WebResourceLoadStatisticsManager.h:
+        * UIProcess/WebResourceLoadStatisticsStore.cpp:
+        (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
+            Change due to the break-out of
+            WebResourceLoadStatisticsStore::writeStoreToDisk().
+        (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
+            Now sets m_writePersistentStoreHandler in
+            WebCore::ResourceLoadStatisticsStore.
+        (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk):
+            Separated out this function to make it available for the function set as
+            m_writePersistentStoreHandler in WebCore::ResourceLoadStatisticsStore.
+        * UIProcess/WebResourceLoadStatisticsStore.h:
+        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+        (WebKit::WebsiteDataStore::removeData):
+            Both WebsiteDataStore::removeData() functions now cover resource load
+            statistics.
+
</ins><span class="cx"> 2017-03-09  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add WKURLSchemeHandler API for handling custom protocols.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKResourceLoadStatisticsManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.cpp (213687 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.cpp        2017-03-10 00:44:42 UTC (rev 213687)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.cpp        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -101,6 +101,11 @@
</span><span class="cx">     WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval(seconds);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStore()
+{
+    WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore();
+}
+
</ins><span class="cx"> void WKResourceLoadStatisticsManagerResetToConsistentState()
</span><span class="cx"> {
</span><span class="cx">     WebResourceLoadStatisticsManager::resetToConsistentState();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKResourceLoadStatisticsManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.h (213687 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.h        2017-03-10 00:44:42 UTC (rev 213687)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.h        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx">     WK_EXPORT void WKResourceLoadStatisticsManagerSetNotifyPagesWhenDataRecordsWereScanned(bool value);
</span><span class="cx">     WK_EXPORT void WKResourceLoadStatisticsManagerSetShouldClassifyResourcesBeforeDataRecordsRemoval(bool value);
</span><span class="cx">     WK_EXPORT void WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval(double seconds);
</span><ins>+    WK_EXPORT void WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStore();
</ins><span class="cx">     WK_EXPORT void WKResourceLoadStatisticsManagerResetToConsistentState();
</span><span class="cx"> 
</span><span class="cx"> #ifdef __cplusplus
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebResourceLoadStatisticsManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.cpp (213687 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.cpp        2017-03-10 00:44:42 UTC (rev 213687)
+++ trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.cpp        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -106,6 +106,13 @@
</span><span class="cx">     WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval(seconds);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore()
+{
+    auto store = WebCore::ResourceLoadObserver::sharedObserver().statisticsStore();
+    if (store)
+        store-&gt;clearInMemoryAndPersistent();
+}
+
</ins><span class="cx"> void WebResourceLoadStatisticsManager::resetToConsistentState()
</span><span class="cx"> {
</span><span class="cx">     WebCore::ResourceLoadObserver::sharedObserver().setTimeToLiveUserInteraction(2592000);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebResourceLoadStatisticsManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.h (213687 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.h        2017-03-10 00:44:42 UTC (rev 213687)
+++ trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.h        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -52,6 +52,7 @@
</span><span class="cx">     static void setNotifyPagesWhenDataRecordsWereScanned(bool);
</span><span class="cx">     static void setShouldClassifyResourcesBeforeDataRecordsRemoval(bool value);
</span><span class="cx">     static void setMinimumTimeBetweeenDataRecordsRemoval(double seconds);
</span><ins>+    static void clearInMemoryAndPersistentStore();
</ins><span class="cx">     static void resetToConsistentState();
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebResourceLoadStatisticsStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.cpp (213687 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.cpp        2017-03-10 00:44:42 UTC (rev 213687)
+++ trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.cpp        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -146,10 +146,8 @@
</span><span class="cx">         });
</span><span class="cx">     }
</span><span class="cx">     removeDataRecords();
</span><del>-    
-    auto encoder = coreStore().createEncoderFromData();
-    
-    writeEncoderToDisk(*encoder.get(), &quot;full_browsing_session&quot;);
</del><ins>+
+    writeStoreToDisk();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated(const Vector&lt;WebCore::ResourceLoadStatistics&gt;&amp; origins)
</span><span class="lines">@@ -189,6 +187,9 @@
</span><span class="cx">     m_resourceLoadStatisticsStore-&gt;setShouldPartitionCookiesCallback([this, shouldPartitionCookiesForDomainsHandler = WTFMove(shouldPartitionCookiesForDomainsHandler)] (const Vector&lt;String&gt;&amp; primaryDomains, bool value) {
</span><span class="cx">         shouldPartitionCookiesForDomainsHandler(primaryDomains, value);
</span><span class="cx">     });
</span><ins>+    m_resourceLoadStatisticsStore-&gt;setWritePersistentStoreCallback([this]() {
+        writeStoreToDisk();
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded()
</span><span class="lines">@@ -236,6 +237,12 @@
</span><span class="cx">     return pathByAppendingComponent(m_statisticsStoragePath, label + &quot;_resourceLog.plist&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebResourceLoadStatisticsStore::writeStoreToDisk()
+{
+    auto encoder = coreStore().createEncoderFromData();
+    writeEncoderToDisk(*encoder.get(), &quot;full_browsing_session&quot;);
+}
+
</ins><span class="cx"> void WebResourceLoadStatisticsStore::writeEncoderToDisk(KeyedEncoder&amp; encoder, const String&amp; label) const
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;SharedBuffer&gt; rawData = encoder.finishEncoding();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebResourceLoadStatisticsStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.h (213687 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.h        2017-03-10 00:44:42 UTC (rev 213687)
+++ trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.h        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -89,6 +89,7 @@
</span><span class="cx">     // IPC::MessageReceiver
</span><span class="cx">     void didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;) override;
</span><span class="cx"> 
</span><ins>+    void writeStoreToDisk();
</ins><span class="cx">     void writeEncoderToDisk(WebCore::KeyedEncoder&amp;, const String&amp; label) const;
</span><span class="cx">     std::unique_ptr&lt;WebCore::KeyedDecoder&gt; createDecoderFromDisk(const String&amp; label) const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebsiteDataWebsiteDataStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp (213687 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp        2017-03-10 00:44:42 UTC (rev 213687)
+++ trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> #include &lt;WebCore/DatabaseTracker.h&gt;
</span><span class="cx"> #include &lt;WebCore/HTMLMediaElement.h&gt;
</span><span class="cx"> #include &lt;WebCore/OriginLock.h&gt;
</span><ins>+#include &lt;WebCore/ResourceLoadObserver.h&gt;
</ins><span class="cx"> #include &lt;WebCore/SecurityOrigin.h&gt;
</span><span class="cx"> #include &lt;WebCore/SecurityOriginData.h&gt;
</span><span class="cx"> #include &lt;wtf/RunLoop.h&gt;
</span><span class="lines">@@ -769,6 +770,9 @@
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    if (dataTypes.contains(WebsiteDataType::WebsiteDataTypeResourceLoadStatistics))
+        WebCore::ResourceLoadObserver::sharedObserver().clearInMemoryAndPersistentStore(modifiedSince);
+
</ins><span class="cx">     // There's a chance that we don't have any pending callbacks. If so, we want to dispatch the completion handler right away.
</span><span class="cx">     callbackAggregator-&gt;callIfNeeded();
</span><span class="cx"> }
</span><span class="lines">@@ -1035,6 +1039,9 @@
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    if (dataTypes.contains(WebsiteDataType::WebsiteDataTypeResourceLoadStatistics))
+        WebCore::ResourceLoadObserver::sharedObserver().clearInMemoryAndPersistentStore();
+
</ins><span class="cx">     // There's a chance that we don't have any pending callbacks. If so, we want to dispatch the completion handler right away.
</span><span class="cx">     callbackAggregator-&gt;callIfNeeded();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (213687 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2017-03-10 00:44:42 UTC (rev 213687)
+++ trunk/Tools/ChangeLog        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2017-03-09  John Wilander  &lt;wilander@apple.com&gt;
+
+        Resource Load Statistics: Remove statistics data as part of full website data removal
+        https://bugs.webkit.org/show_bug.cgi?id=169448
+
+        Reviewed by Alex Christensen.
+
+        This patch adds infrastructure for the new TestRunner function
+        statisticsClearInMemoryAndPersistentStore().
+
+        * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::TestRunner::statisticsClearInMemoryAndPersistentStore):
+        * WebKitTestRunner/InjectedBundle/TestRunner.h:
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::statisticsClearInMemoryAndPersistentStore):
+        * WebKitTestRunner/TestController.h:
+        * WebKitTestRunner/TestInvocation.cpp:
+        (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
+
</ins><span class="cx"> 2017-03-09  Dean Jackson  &lt;dino@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WebGPU: Backend - Buffers
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleBindingsTestRunneridl"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (213687 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl        2017-03-10 00:44:42 UTC (rev 213687)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -263,6 +263,7 @@
</span><span class="cx">     void setStatisticsNotifyPagesWhenDataRecordsWereScanned(boolean value);
</span><span class="cx">     void setStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval(boolean value);
</span><span class="cx">     void setStatisticsMinimumTimeBetweeenDataRecordsRemoval(double seconds);
</span><ins>+    void statisticsClearInMemoryAndPersistentStore();
</ins><span class="cx">     void statisticsResetToConsistentState();
</span><span class="cx"> 
</span><span class="cx">     // Open panel
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleTestRunnercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (213687 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp        2017-03-10 00:44:42 UTC (rev 213687)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -1382,6 +1382,12 @@
</span><span class="cx">     WKRetainPtr&lt;WKDoubleRef&gt; messageBody(AdoptWK, WKDoubleCreate(seconds));
</span><span class="cx">     WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
</span><span class="cx"> }
</span><ins>+
+void TestRunner::statisticsClearInMemoryAndPersistentStore()
+{
+    WKRetainPtr&lt;WKStringRef&gt; messageName(AdoptWK, WKStringCreateWithUTF8CString(&quot;StatisticsClearInMemoryAndPersistentStore&quot;));
+    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), 0, nullptr);
+}
</ins><span class="cx">     
</span><span class="cx"> void TestRunner::statisticsResetToConsistentState()
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleTestRunnerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (213687 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h        2017-03-10 00:44:42 UTC (rev 213687)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -364,6 +364,7 @@
</span><span class="cx">     void setStatisticsNotifyPagesWhenDataRecordsWereScanned(bool);
</span><span class="cx">     void setStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval(bool);
</span><span class="cx">     void setStatisticsMinimumTimeBetweeenDataRecordsRemoval(double);
</span><ins>+    void statisticsClearInMemoryAndPersistentStore();
</ins><span class="cx">     void statisticsResetToConsistentState();
</span><span class="cx"> 
</span><span class="cx">     // Open panel
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (213687 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.cpp        2017-03-10 00:44:42 UTC (rev 213687)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -2292,6 +2292,12 @@
</span><span class="cx"> {
</span><span class="cx">     WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval(seconds);
</span><span class="cx"> }
</span><ins>+
+void TestController::statisticsClearInMemoryAndPersistentStore()
+{
+    WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStore();
+}
+
</ins><span class="cx"> void TestController::statisticsResetToConsistentState()
</span><span class="cx"> {
</span><span class="cx">     WKResourceLoadStatisticsManagerResetToConsistentState();
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.h (213687 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.h        2017-03-10 00:44:42 UTC (rev 213687)
+++ trunk/Tools/WebKitTestRunner/TestController.h        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -161,6 +161,7 @@
</span><span class="cx">     void setStatisticsNotifyPagesWhenDataRecordsWereScanned(bool);
</span><span class="cx">     void setStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval(bool);
</span><span class="cx">     void setStatisticsMinimumTimeBetweeenDataRecordsRemoval(double);
</span><ins>+    void statisticsClearInMemoryAndPersistentStore();
</ins><span class="cx">     void statisticsResetToConsistentState();
</span><span class="cx"> 
</span><span class="cx">     WKArrayRef openPanelFileURLs() const { return m_openPanelFileURLs.get(); }
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestInvocationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestInvocation.cpp (213687 => 213688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestInvocation.cpp        2017-03-10 00:44:42 UTC (rev 213687)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.cpp        2017-03-10 00:46:25 UTC (rev 213688)
</span><span class="lines">@@ -1032,6 +1032,11 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx">     
</span><ins>+    if (WKStringIsEqualToUTF8CString(messageName, &quot;StatisticsClearInMemoryAndPersistentStore&quot;)) {
+        TestController::singleton().statisticsClearInMemoryAndPersistentStore();
+        return nullptr;
+    }
+    
</ins><span class="cx">     if (WKStringIsEqualToUTF8CString(messageName, &quot;StatisticsResetToConsistentState&quot;)) {
</span><span class="cx">         TestController::singleton().statisticsResetToConsistentState();
</span><span class="cx">         return nullptr;
</span></span></pre>
</div>
</div>

</body>
</html>