Title: [236071] trunk/Source/WebKit
Revision
236071
Author
[email protected]
Date
2018-09-17 10:18:27 -0700 (Mon, 17 Sep 2018)

Log Message

Clear pending resource load statistics' writes after tests
https://bugs.webkit.org/show_bug.cgi?id=189632
<rdar://problem/44469275>

Patch by Woodrow Wang <[email protected]> on 2018-09-17
Reviewed by Chris Dumez.

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreStatisticsResetToConsistentState):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (236070 => 236071)


--- trunk/Source/WebKit/ChangeLog	2018-09-17 17:15:56 UTC (rev 236070)
+++ trunk/Source/WebKit/ChangeLog	2018-09-17 17:18:27 UTC (rev 236071)
@@ -1,3 +1,14 @@
+2018-09-17  Woodrow Wang  <[email protected]>
+
+        Clear pending resource load statistics' writes after tests
+        https://bugs.webkit.org/show_bug.cgi?id=189632
+        <rdar://problem/44469275>
+
+        Reviewed by Chris Dumez.
+
+        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
+        (WKWebsiteDataStoreStatisticsResetToConsistentState):
+
 2018-09-17  Chris Dumez  <[email protected]>
 
         PSON: window.open() with 'noopener' should only process-swap cross-site, not cross-origin

Modified: trunk/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp (236070 => 236071)


--- trunk/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp	2018-09-17 17:15:56 UTC (rev 236070)
+++ trunk/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp	2018-09-17 17:18:27 UTC (rev 236071)
@@ -464,16 +464,19 @@
 
 void WKWebsiteDataStoreStatisticsResetToConsistentState(WKWebsiteDataStoreRef dataStoreRef, void* context, WKWebsiteDataStoreStatisticsResetToConsistentStateFunction completionHandler)
 {
-    auto* store = WebKit::toImpl(dataStoreRef)->websiteDataStore().resourceLoadStatistics();
-    if (!store)
-        return;
-
     auto callbackAggregator = CallbackAggregator::create([context, completionHandler]() {
         completionHandler(context);
     });
-    
-    store->resetParametersToDefaultValues([callbackAggregator = callbackAggregator.copyRef()] { });
-    store->scheduleClearInMemory([callbackAggregator = callbackAggregator.copyRef()] { });
+
+    auto& store = WebKit::toImpl(dataStoreRef)->websiteDataStore();
+    store.clearResourceLoadStatisticsInWebProcesses([callbackAggregator = callbackAggregator.copyRef()] { });
+
+    auto* statisticsStore = store.resourceLoadStatistics();
+    if (!statisticsStore)
+        return;
+
+    statisticsStore->resetParametersToDefaultValues([callbackAggregator = callbackAggregator.copyRef()] { });
+    statisticsStore->scheduleClearInMemory([callbackAggregator = callbackAggregator.copyRef()] { });
 }
 
 void WKWebsiteDataStoreRemoveAllFetchCaches(WKWebsiteDataStoreRef dataStoreRef, void* context, WKWebsiteDataStoreRemoveFetchCacheRemovalFunction callback)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to