- Revision
- 240129
- Author
- [email protected]
- Date
- 2019-01-17 13:36:48 -0800 (Thu, 17 Jan 2019)
Log Message
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().
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (240128 => 240129)
--- trunk/LayoutTests/ChangeLog 2019-01-17 21:28:19 UTC (rev 240128)
+++ trunk/LayoutTests/ChangeLog 2019-01-17 21:36:48 UTC (rev 240129)
@@ -1,3 +1,15 @@
+2019-01-17 John Wilander <[email protected]>
+
+ 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.
+
+ * 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().
+
2019-01-16 Dean Jackson <[email protected]>
(iPad) Link tapping is sluggish on many sites
Modified: trunk/LayoutTests/http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode.html (240128 => 240129)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode.html 2019-01-17 21:28:19 UTC (rev 240128)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode.html 2019-01-17 21:36:48 UTC (rev 240129)
@@ -17,8 +17,8 @@
if (testRunner.isStatisticsPrevalentResource(thirdPartyOrigin))
testFailed(thirdPartyOrigin + " already set as prevalent resource.");
- testRunner.setStatisticsDebugMode(true, function() {
- testRunner.setStatisticsPrevalentResourceForDebugMode(thirdPartyOrigin, function() {
+ testRunner.setStatisticsPrevalentResourceForDebugMode(thirdPartyOrigin, function() {
+ testRunner.setStatisticsDebugMode(true, function() {
if (!testRunner.isStatisticsPrevalentResource(thirdPartyOrigin))
testFailed(thirdPartyOrigin + " didn't get set as prevalent resource.");
else
Modified: trunk/Source/WebCore/ChangeLog (240128 => 240129)
--- trunk/Source/WebCore/ChangeLog 2019-01-17 21:28:19 UTC (rev 240128)
+++ trunk/Source/WebCore/ChangeLog 2019-01-17 21:36:48 UTC (rev 240129)
@@ -1,3 +1,23 @@
+2019-01-17 John Wilander <[email protected]>
+
+ 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.
+
+ 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.
+
2019-01-17 Jer Noble <[email protected]>
SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
Modified: trunk/Source/WebCore/page/RuntimeEnabledFeatures.h (240128 => 240129)
--- trunk/Source/WebCore/page/RuntimeEnabledFeatures.h 2019-01-17 21:28:19 UTC (rev 240128)
+++ trunk/Source/WebCore/page/RuntimeEnabledFeatures.h 2019-01-17 21:36:48 UTC (rev 240129)
@@ -145,8 +145,8 @@
void setAriaReflectionEnabled(bool isEnabled) { m_ariaReflectionEnabled = isEnabled; }
bool ariaReflectionEnabled() const { return m_ariaReflectionEnabled; }
- void setResourceLoadStatisticsDebugMode(bool isEnabled) { m_resourceLoadStatisticsDebugMode = isEnabled; }
- bool resourceLoadStatisticsDebugMode() const { return m_resourceLoadStatisticsDebugMode; }
+ void setItpDebugModeEnabled(bool isEnabled) { m_itpDebugMode = isEnabled; }
+ bool itpDebugModeEnabled() const { return m_itpDebugMode; }
void setRestrictedHTTPResponseAccess(bool isEnabled) { m_isRestrictedHTTPResponseAccess = isEnabled; }
bool restrictedHTTPResponseAccess() const { return m_isRestrictedHTTPResponseAccess; }
@@ -375,7 +375,7 @@
bool m_webVREnabled { false };
bool m_accessibilityObjectModelEnabled { false };
bool m_ariaReflectionEnabled { true };
- bool m_resourceLoadStatisticsDebugMode { false };
+ bool m_itpDebugMode { false };
bool m_isRestrictedHTTPResponseAccess { true };
bool m_crossOriginResourcePolicyEnabled { true };
bool m_isWebGLCompressedTextureASTCSupportEnabled { false };
Modified: trunk/Source/WebCore/page/Settings.yaml (240128 => 240129)
--- trunk/Source/WebCore/page/Settings.yaml 2019-01-17 21:28:19 UTC (rev 240128)
+++ trunk/Source/WebCore/page/Settings.yaml 2019-01-17 21:36:48 UTC (rev 240129)
@@ -765,9 +765,6 @@
mediaCapabilitiesEnabled:
initial: false
-resourceLoadStatisticsDebugMode:
- initial: false
-
clientCoordinatesRelativeToLayoutViewport:
initial: false
onChange: setNeedsRecalcStyleInAllFrames
Modified: trunk/Source/WebKit/ChangeLog (240128 => 240129)
--- trunk/Source/WebKit/ChangeLog 2019-01-17 21:28:19 UTC (rev 240128)
+++ trunk/Source/WebKit/ChangeLog 2019-01-17 21:36:48 UTC (rev 240129)
@@ -1,3 +1,29 @@
+2019-01-17 John Wilander <[email protected]>
+
+ 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.
+
+ * 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.
+
2019-01-17 Tim Horton <[email protected]>
Adopt NSTextCheckingSuppressInitialCapitalizationKey
Modified: trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp (240128 => 240129)
--- trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp 2019-01-17 21:28:19 UTC (rev 240128)
+++ trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp 2019-01-17 21:36:48 UTC (rev 240129)
@@ -534,6 +534,9 @@
auto& manualResourceStatistic = ensureResourceStatisticsForPrimaryDomain(m_debugManualPrevalentResource);
setPrevalentResource(manualResourceStatistic, ResourceLoadPrevalence::High);
primaryDomainsToBlock.uncheckedAppend(m_debugManualPrevalentResource);
+#if !RELEASE_LOG_DISABLED
+ RELEASE_LOG_INFO(ResourceLoadStatisticsDebug, "Did set %{public}s as prevalent resource for the purposes of ITP Debug Mode.", m_debugManualPrevalentResource.utf8().data());
+#endif
}
return primaryDomainsToBlock;
@@ -543,24 +546,23 @@
{
ASSERT(!RunLoop::isMain());
+#if !RELEASE_LOG_DISABLED
+ if (enable)
+ RELEASE_LOG_INFO(ResourceLoadStatisticsDebug, "Turned ITP Debug Mode on.");
+#endif
+
m_debugModeEnabled = enable;
m_debugLoggingEnabled = enable;
ensurePrevalentResourcesForDebugMode();
+ // This will log the current cookie blocking state.
+ if (enable)
+ updateCookieBlocking([]() { });
}
void ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode(const String& domain)
{
- if (!m_debugModeEnabled)
- return;
-
m_debugManualPrevalentResource = domain;
- auto& resourceStatistic = ensureResourceStatisticsForPrimaryDomain(domain);
- setPrevalentResource(resourceStatistic, ResourceLoadPrevalence::High);
-
-#if !RELEASE_LOG_DISABLED
- RELEASE_LOG_INFO(ResourceLoadStatisticsDebug, "Did set %{public}s as prevalent resource for the purposes of ITP Debug Mode.", domain.utf8().data());
-#endif
}
void ResourceLoadStatisticsMemoryStore::scheduleStatisticsProcessingRequestIfNecessary()
Modified: trunk/Source/WebKit/Shared/WebPreferences.yaml (240128 => 240129)
--- trunk/Source/WebKit/Shared/WebPreferences.yaml 2019-01-17 21:28:19 UTC (rev 240128)
+++ trunk/Source/WebKit/Shared/WebPreferences.yaml 2019-01-17 21:36:48 UTC (rev 240129)
@@ -1394,12 +1394,11 @@
webcoreBinding: RuntimeEnabledFeatures
webcoreName: experimentalPlugInSandboxProfilesEnabled
-ResourceLoadStatisticsDebugMode:
+ItpDebugModeEnabled:
type: bool
defaultValue: false
humanReadableName: "ITP Debug Mode"
humanReadableDescription: "Intelligent Tracking Prevention Debug Mode"
- category: internal
webcoreBinding: RuntimeEnabledFeatures
ServiceWorkersEnabled:
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm (240128 => 240129)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm 2019-01-17 21:28:19 UTC (rev 240128)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm 2019-01-17 21:36:48 UTC (rev 240129)
@@ -839,6 +839,16 @@
return _preferences->needsSiteSpecificQuirks();
}
+- (void)_setItpDebugModeEnabled:(BOOL)enabled
+{
+ _preferences->setItpDebugModeEnabled(enabled);
+}
+
+- (BOOL)_itpDebugModeEnabled
+{
+ return _preferences->itpDebugModeEnabled();
+}
+
#if PLATFORM(MAC)
- (void)_setJavaEnabledForLocalFiles:(BOOL)enabled
{
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h (240128 => 240129)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h 2019-01-17 21:28:19 UTC (rev 240128)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h 2019-01-17 21:36:48 UTC (rev 240129)
@@ -152,6 +152,7 @@
@property (nonatomic, setter=_setWebAnimationsCSSIntegrationEnabled:) BOOL _webAnimationsCSSIntegrationEnabled WK_API_AVAILABLE(macosx(10.14), ios(WK_IOS_TBA));
@property (nonatomic, setter=_setDeviceOrientationEventEnabled:) BOOL _deviceOrientationEventEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
@property (nonatomic, setter=_setNeedsSiteSpecificQuirks:) BOOL _needsSiteSpecificQuirks WK_API_AVAILABLE(macosx(10.13.4), ios(WK_IOS_TBA));
+@property (nonatomic, setter=_setItpDebugModeEnabled:) BOOL _itpDebugModeEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
#if !TARGET_OS_IPHONE
@property (nonatomic, setter=_setWebGLEnabled:) BOOL _webGLEnabled WK_API_AVAILABLE(macosx(10.13.4));
Modified: trunk/Source/WebKit/UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm (240128 => 240129)
--- trunk/Source/WebKit/UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm 2019-01-17 21:28:19 UTC (rev 240128)
+++ trunk/Source/WebKit/UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm 2019-01-17 21:36:48 UTC (rev 240129)
@@ -46,12 +46,10 @@
if (grandfatheringTime > 0_s && grandfatheringTime <= 24_h * 7)
setGrandfatheringTime(grandfatheringTime);
- setDebugLogggingEnabled([[NSUserDefaults standardUserDefaults] boolForKey:@"ResourceLoadStatisticsDebugLoggingEnabled"]);
- setResourceLoadStatisticsDebugMode([[NSUserDefaults standardUserDefaults] boolForKey:@"ExperimentalResourceLoadStatisticsDebugMode"]);
+ setResourceLoadStatisticsDebugMode([[NSUserDefaults standardUserDefaults] boolForKey:@"ItpDebugMode"]);
auto* debugManualPrevalentResource = [[NSUserDefaults standardUserDefaults] stringForKey:@"ResourceLoadStatisticsManualPrevalentResource"];
if (debugManualPrevalentResource)
setPrevalentResourceForDebugMode(debugManualPrevalentResource);
- setStorageAccessPromptsEnabled([[NSUserDefaults standardUserDefaults] boolForKey:@"ExperimentalStorageAccessPromptsEnabled"]);
Seconds cacheMaxAgeCapForPrevalentResources([[NSUserDefaults standardUserDefaults] doubleForKey:@"ResourceLoadStatisticsCacheMaxAgeCap"]);
if (cacheMaxAgeCapForPrevalentResources > 0_s && cacheMaxAgeCapForPrevalentResources <= 24_h * 365)