Add infrastructure to enable/disable ITP Debug Mode through Preferences
authorwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Jan 2019 21:36:48 +0000 (21:36 +0000)
committerwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Jan 2019 21:36:48 +0000 (21:36 +0000)
commitd4b9fae78ae8334598bce2c91d13954f9ef7d81c
tree35da5024cebf752ad662158665857505c0c4021f
parent0adc730a766124bd945dc688b7e4848b91e74762
Add infrastructure to enable/disable ITP Debug Mode through Preferences
https://bugs.webkit.org/show_bug.cgi?id=193510
<rdar://problem/47330969>

Reviewed by Dean Jackson.

Source/WebCore:

No new tests. These changes are purely for settings/preferences.

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setItpDebugModeEnabled):
(WebCore::RuntimeEnabledFeatures::itpDebugModeEnabled const):
(WebCore::RuntimeEnabledFeatures::setResourceLoadStatisticsDebugMode): Deleted.
(WebCore::RuntimeEnabledFeatures::resourceLoadStatisticsDebugMode const): Deleted.
    Renamed.
* page/Settings.yaml:
    Removed since this particular setting should not be persisted for privacy
    reasons.

Source/WebKit:

* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
(WebKit::ResourceLoadStatisticsMemoryStore::setResourceLoadStatisticsDebugMode):
(WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode):
    These functions are now suited for runtime switching of ITP Debug Mode.
* Shared/WebPreferences.yaml:
    Changed name from ResourceLoadStatisticsDebugMode to ItpDebugModeEnabled.
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setItpDebugModeEnabled:]):
(-[WKPreferences _itpDebugModeEnabled]):
    New private preferences functions.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
(WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
    Removed support for old experimental user default. Added a new one that's
    not connected to any UI, i.e. merely for command line debugging where
    ITP Debug Mode needs to be on all the time.

LayoutTests:

* http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode.html:
    Changed the order of function calls since testRunner.setStatisticsPrevalentResourceForDebugMode()
    now has to be called before testRunner.setStatisticsDebugMode().

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240129 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode.html
Source/WebCore/ChangeLog
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebCore/page/Settings.yaml
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm
Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h
Source/WebKit/UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm