WebResourceLoadStatisticsStore should only be constructed when the feature is enabled
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Jul 2017 17:23:07 +0000 (17:23 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Jul 2017 17:23:07 +0000 (17:23 +0000)
commitff7a23d1a4dd1324613c4b498d8a0b9e5dc5da97
tree40f81a9e6e39c9bfaebab14e6a23da2e2714f8cf
parenta56e1f7ba97c19bd0e58310b846f16be1b556ec1
WebResourceLoadStatisticsStore should only be constructed when the feature is enabled
https://bugs.webkit.org/show_bug.cgi?id=174189

Reviewed by Brent Fulgham.

Delay the construction of the WebResourceLoadStatisticsStore until the feature gets
enabled via WebsiteDataStore::setResourceLoadStatisticsEnabled(). Previously, we would
always construct a store and then have a boolean on the store to indicate if it is
enabled or not.

Also simplify the initialization process of the WebResourceLoadStatisticsStore, we
used to have:
1. WebResourceLoadStatisticsStore constructor
2. WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver()
3. WebResourceLoadStatisticsStore::setResourceLoadStatisticsEnabled(true)

All 3 steps are now taken care of by the WebResourceLoadStatisticsStore constructor.

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitialize):
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
(WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::platformInitialize):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):
(WebKit::WebsiteDataStore::resourceLoadStatisticsEnabled):
(WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::resourceLoadStatistics):
* UIProcess/wpe/WebProcessPoolWPE.cpp:
(WebKit::WebProcessPool::platformInitialize):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm
Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.cpp
Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.h
Source/WebKit2/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm
Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp
Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h
Source/WebKit2/UIProcess/wpe/WebProcessPoolWPE.cpp