WebKit Bugzilla
Attachment 359402 Details for
Bug 193510
: Add infrastructure to enable/disable ITP Debug Mode through Preferences
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193510-20190117121135.patch (text/plain), 13.45 KB, created by
John Wilander
on 2019-01-17 12:11:36 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
John Wilander
Created:
2019-01-17 12:11:36 PST
Size:
13.45 KB
patch
obsolete
>Subversion Revision: 239994 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index b238b0b7ba2a9658391a6c1875f321b16764ebe7..4bbf0cb5dfc8e429e955214104756b2c2b78f7fa 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2019-01-17 John Wilander <wilander@apple.com> >+ >+ Add infrastructure to enable/disable ITP Debug Mode through Preferences >+ https://bugs.webkit.org/show_bug.cgi?id=193510 >+ <rdar://problem/47330969> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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-15 Chris Dumez <cdumez@apple.com> > > Regression(PSON) View becomes blank after click a cross-site download link >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 90a1638097aaf38c734a9078bd8c2ee097899963..130f924a1318096e8785b11118484819a1f9769b 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,29 @@ >+2019-01-17 John Wilander <wilander@apple.com> >+ >+ Add infrastructure to enable/disable ITP Debug Mode through Preferences >+ https://bugs.webkit.org/show_bug.cgi?id=193510 >+ <rdar://problem/47330969> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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-15 Per Arne Vollan <pvollan@apple.com> > > Add allow directive for MTLCompilerService.xpc to PluginProcess and WebContent >diff --git a/Source/WebCore/page/RuntimeEnabledFeatures.h b/Source/WebCore/page/RuntimeEnabledFeatures.h >index 02face0d3574bdc3bb5a3318a2e721c20289e26d..fc47f9582ed0d3ae0767d2569315833c038116cd 100644 >--- a/Source/WebCore/page/RuntimeEnabledFeatures.h >+++ b/Source/WebCore/page/RuntimeEnabledFeatures.h >@@ -145,8 +145,8 @@ public: > 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 @@ private: > 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 }; >diff --git a/Source/WebCore/page/Settings.yaml b/Source/WebCore/page/Settings.yaml >index 2b187e13593b4679c15a3b3c3d048d3aa2ba024c..9b9a6e87c6acdf5b188e9dbc3c1ff3967db02a60 100644 >--- a/Source/WebCore/page/Settings.yaml >+++ b/Source/WebCore/page/Settings.yaml >@@ -765,9 +765,6 @@ shouldEnableTextAutosizingBoost: > mediaCapabilitiesEnabled: > initial: false > >-resourceLoadStatisticsDebugMode: >- initial: false >- > clientCoordinatesRelativeToLayoutViewport: > initial: false > onChange: setNeedsRecalcStyleInAllFrames >diff --git a/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp b/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp >index 8d62d68c1c49f49f79160dfebb6afa69087fee5a..5db459629d196258b9bc07c5946469149b444564 100644 >--- a/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp >+++ b/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp >@@ -534,6 +534,9 @@ Vector<String> ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDeb > 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 @@ void ResourceLoadStatisticsMemoryStore::setResourceLoadStatisticsDebugMode(bool > { > 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() >diff --git a/Source/WebKit/Shared/WebPreferences.yaml b/Source/WebKit/Shared/WebPreferences.yaml >index bbab0781933f1c7da044d0897dd235176cb0e790..82ddcbcc0c62ff68d949aa0a1be4c2fb6956d141 100644 >--- a/Source/WebKit/Shared/WebPreferences.yaml >+++ b/Source/WebKit/Shared/WebPreferences.yaml >@@ -1394,12 +1394,11 @@ ExperimentalPlugInSandboxProfilesEnabled: > 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: >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm b/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm >index 3b46ecd2da4cd081f555223e12e0d155decaf01e..9475df4a8b9428d86b14536d91a1bd5149244455 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm >@@ -839,6 +839,16 @@ - (BOOL)_needsSiteSpecificQuirks > return _preferences->needsSiteSpecificQuirks(); > } > >+- (void)_setItpDebugModeEnabled:(BOOL)enabled >+{ >+ _preferences->setItpDebugModeEnabled(enabled); >+} >+ >+- (BOOL)_itpDebugModeEnabled >+{ >+ return _preferences->itpDebugModeEnabled(); >+} >+ > #if PLATFORM(MAC) > - (void)_setJavaEnabledForLocalFiles:(BOOL)enabled > { >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h b/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h >index 63be4d523a15d8ab6cdd9e9b4938343943c6c714..d725f32b5089ec886ca010351313136f7dccfa56 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h >@@ -152,6 +152,7 @@ typedef NS_ENUM(NSInteger, _WKEditableLinkBehavior) { > @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)); >diff --git a/Source/WebKit/UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm b/Source/WebKit/UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm >index 652bc1d82d38e089419fe314b4c459485fd1da49..2e868d19a8cbf39c60ebe0d3844209f99b5d58a2 100644 >--- a/Source/WebKit/UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm >+++ b/Source/WebKit/UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm >@@ -46,12 +46,10 @@ void ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded() > 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) >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 0140f81025d64d305a8bf49fbe3bb37814eae1e2..ccb8f012669d1d3e961ed57efa5bdc128d1ad8e9 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2019-01-17 John Wilander <wilander@apple.com> >+ >+ Add infrastructure to enable/disable ITP Debug Mode through Preferences >+ https://bugs.webkit.org/show_bug.cgi?id=193510 >+ <rdar://problem/47330969> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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-15 Chris Dumez <cdumez@apple.com> > > Regression(PSON) View becomes blank after click a cross-site download link >diff --git a/LayoutTests/http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode.html b/LayoutTests/http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode.html >index 5aa7dd8c4b5253e51f7d485cc5b8ab7a3aefba79..8f511512d0f6cda853edd55ee4781414a28ce19e 100644 >--- a/LayoutTests/http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode.html >+++ b/LayoutTests/http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode.html >@@ -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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193510
:
359391
|
359393
| 359402