Please sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WK2] ResourceLoadStatistics should batch its writes
https://bugs.webkit.org/show_bug.cgi?id=174111 <rdar://problem/33115894> Reviewed by Chris Dumez. Revise the data writing operation to only write on a specific interval (currently set to 5 minutes). Also make 'writeStoreToDisk' simpler to use by moving the deleting (before write) and creating (after write) of the FileMonitor into the method, rather than requiring this knowledge in multiple places. Make sure that we write our statistics file out before exiting so that we do not lose any data if we exit before the five-minute window has elapsed. * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::setWritePersistentStoreCallback): Deleted. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): Remove the stop and start monitoring into 'writeStoreToDisk'. Also check if enough time has elapsed since the last write to commit to disk. (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Remove the stop and start monitoring into 'writeStoreToDisk'. (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk): Add the stop and start monitoring commands here, so callers don't have to know to do so. Canonical link: https://commits.webkit.org/191063@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219220 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing with 68 additions and 21 deletions.
- +29 −0 Source/WebKit2/ChangeLog
- +0 −5 Source/WebKit2/UIProcess/Storage/ResourceLoadStatisticsStore.cpp
- +0 −2 Source/WebKit2/UIProcess/Storage/ResourceLoadStatisticsStore.h
- +34 −13 Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.cpp
- +5 −1 Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.h