[webkit-changes] [WebKit/WebKit] 450612: Introduce DataRemovalFrequency for scheduled data ...

Matthew Finkel noreply at github.com
Fri Feb 9 15:47:33 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 45061230013728ec9c4900b01b12af26dc592b4b
      https://github.com/WebKit/WebKit/commit/45061230013728ec9c4900b01b12af26dc592b4b
  Author: Matthew Finkel <sysrqb at apple.com>
  Date:   2024-02-09 (Fri, 09 Feb 2024)

  Changed paths:
    M LayoutTests/http/tests/resourceLoadStatistics/aggregate-sorted-data-no-storage-access-expected.txt
    M LayoutTests/http/tests/resourceLoadStatistics/count-third-party-script-import-in-worker-expected.txt
    M LayoutTests/http/tests/resourceLoadStatistics/count-third-party-script-loads-expected.txt
    M LayoutTests/http/tests/resourceLoadStatistics/dont-count-third-party-image-as-third-party-script-expected.txt
    M LayoutTests/http/tests/resourceLoadStatistics/log-cross-site-load-with-link-decoration-expected.txt
    M LayoutTests/http/tests/resourceLoadStatistics/log-delayed-client-side-redirects-expected.txt
    M LayoutTests/http/tests/resourceLoadStatistics/remove-website-data-for-origin-deletes-link-decoration-expected.txt
    M LayoutTests/http/tests/resourceLoadStatistics/remove-website-data-for-origin-deletes-third-party-script-loads-expected.txt
    A LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-filtered-link-decoration-after-long-deletion-expected.txt
    A LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-filtered-link-decoration-after-long-deletion.html
    A LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-filtered-link-decoration-after-short-deletion-expected.txt
    A LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-filtered-link-decoration-after-short-deletion.html
    A LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-filtered-link-decoration-before-short-deletion-expected.txt
    A LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-filtered-link-decoration-before-short-deletion.html
    R LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration-expected.txt
    R LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html
    A LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-unfiltered-link-decoration-after-short-deletion-expected.txt
    A LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-unfiltered-link-decoration-after-short-deletion.html
    A LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-unfiltered-link-decoration-before-short-deletion-expected.txt
    A LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-unfiltered-link-decoration-before-short-deletion.html
    A LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-without-link-decoration-expected.txt
    A LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-without-link-decoration.html
    M LayoutTests/http/tests/storageAccess/aggregate-sorted-data-with-storage-access-expected.txt
    M LayoutTests/http/tests/webAPIStatistics/canvas-read-and-write-data-collection-expected.txt
    M LayoutTests/http/tests/webAPIStatistics/font-load-data-collection-expected.txt
    M LayoutTests/http/tests/webAPIStatistics/navigator-functions-accessed-data-collection-expected.txt
    M LayoutTests/http/tests/webAPIStatistics/screen-functions-accessed-data-collection-expected.txt
    A LayoutTests/platform/glib/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-filtered-link-decoration-after-long-deletion-expected.txt
    R LayoutTests/platform/glib/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration-expected.txt
    A LayoutTests/platform/glib/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-unfiltered-link-decoration-after-short-deletion-expected.txt
    A LayoutTests/platform/glib/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-without-link-decoration-expected.txt
    M LayoutTests/platform/ios-wk2/TestExpectations
    A LayoutTests/platform/mac-monterey/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-filtered-link-decoration-after-long-deletion-expected.txt
    R LayoutTests/platform/mac-monterey/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration-expected.txt
    A LayoutTests/platform/mac-monterey/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-unfiltered-link-decoration-after-short-deletion-expected.txt
    A LayoutTests/platform/mac-monterey/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-without-link-decoration-expected.txt
    M LayoutTests/platform/wincairo/TestExpectations
    A Source/WebKit/NetworkProcess/Classifier/DidFilterKnownLinkDecoration.h
    M Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp
    M Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.h
    M Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp
    M Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h
    M Source/WebKit/NetworkProcess/NetworkProcess.cpp
    M Source/WebKit/NetworkProcess/NetworkProcess.h
    M Source/WebKit/NetworkProcess/NetworkProcess.messages.in
    M Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp
    M Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.h
    M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
    M Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
    M Source/WebKit/UIProcess/Network/NetworkProcessProxy.h
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
    M Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
    M Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
    M Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
    M Tools/WebKitTestRunner/TestController.cpp
    M Tools/WebKitTestRunner/TestController.h
    M Tools/WebKitTestRunner/TestInvocation.cpp
    M Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm

  Log Message:
  -----------
  Introduce DataRemovalFrequency for scheduled data removal in the NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=265598
rdar://118998314

Reviewed by Sihui Liu.

In the current implementation, first-party script-written web site storage is
deleted after 7 operational-days without user interaction on the web site. That
7-day operational period is important for limiting persistent cross-site
tracking, but it has a negative impact on usability by people who visit sites
semi-frequently but longer than 7-operational-days. This change introduces a
lower frequency deletion policy if a web site was always loaded with link
decoration filtering enabled (currently disabled by default).

This patch doesn't change the current behavior and it is backwards compatible
with the current database. It takes the current boolean value that indicates if
the domain is scheduled for data removal, and it converts that into an integer
that defines the data removal frequency. In the current implementation, 0
indicates that the domain is not scheduled for data removal, 1 indicates that
it is scheduled. This patch redefines the value 1 as indicating the web site
data should be removed on a short frequency (7 operational days), and it
defines the value 2 as indicating the web site data should be removed on a
longer frequency (30 operational days).

More precisely, a domain's data is deleted in two situations. In the first
case, when the current FirstPartyDataRemovalMode is AllButCookies, website data
is deleted after 7-operational days (without user interaction) regardless of
whether cross-site link decoration was detected. In the second case, the
website's data is deleted after 7-operational days when it is navigated to with
query parameters from a classified domain. If link decoration filtering is
enabled, then a sites ability to transfer a high-entropy identifier cross-site
is significantly reduced. Therefore, storing web site data for longer periods
of time should be safer.

This change combines the two existing scenarios for removing first-party data
(AllButCookies). When cross-site link decoration is detected and if link
decoration filtering is disabled, then the DataRemovalFrequency remains at
7-operational days. However, if we never load a page with cross-site link
decoration, or if we load a site with link decoration and link decoration
filtering is enabled (such that we filter known-problematic identifiers), then
the DataRemovalFrequency is set to 30-operational days.

* LayoutTests/http/tests/resourceLoadStatistics/aggregate-sorted-data-no-storage-access-expected.txt:
* LayoutTests/http/tests/resourceLoadStatistics/count-third-party-script-import-in-worker-expected.txt:
* LayoutTests/http/tests/resourceLoadStatistics/count-third-party-script-loads-expected.txt:
* LayoutTests/http/tests/resourceLoadStatistics/dont-count-third-party-image-as-third-party-script-expected.txt:
* LayoutTests/http/tests/resourceLoadStatistics/log-cross-site-load-with-link-decoration-expected.txt:
* LayoutTests/http/tests/resourceLoadStatistics/log-delayed-client-side-redirects-expected.txt:
* LayoutTests/http/tests/resourceLoadStatistics/remove-website-data-for-origin-deletes-link-decoration-expected.txt:
* LayoutTests/http/tests/resourceLoadStatistics/remove-website-data-for-origin-deletes-third-party-script-loads-expected.txt:

Rebaseline

 * LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-filtered-link-decoration-after-long-deletion-expected.txt: Added.
 * LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-filtered-link-decoration-after-long-deletion.html: Copied from LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html.
 * LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-filtered-link-decoration-after-short-deletion-expected.txt: Added.
 * LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-filtered-link-decoration-after-short-deletion.html: Copied from LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html.
 * LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-filtered-link-decoration-before-short-deletion-expected.txt: Added.
 * LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-filtered-link-decoration-before-short-deletion.html: Copied from LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html.
 * LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-unfiltered-link-decoration-after-short-deletion-expected.txt: Added.
 * LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-unfiltered-link-decoration-after-short-deletion.html: Copied from LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html.
 * LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-unfiltered-link-decoration-before-short-deletion-expected.txt: Added.
 * LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-unfiltered-link-decoration-before-short-deletion.html: Copied from LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html.
 * LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-without-link-decoration-expected.txt: Added.
 * LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-without-link-decoration.html: Renamed from LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html.

New tests.

* LayoutTests/http/tests/storageAccess/aggregate-sorted-data-with-storage-access-expected.txt:
* LayoutTests/http/tests/webAPIStatistics/canvas-read-and-write-data-collection-expected.txt:
* LayoutTests/http/tests/webAPIStatistics/font-load-data-collection-expected.txt:
* LayoutTests/http/tests/webAPIStatistics/screen-functions-accessed-data-collection-expected.txt:

Rebaseline

* LayoutTests/platform/glib/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-filtered-link-decoration-after-long-deletion-expected.txt: Added.
* LayoutTests/platform/glib/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration-expected.txt: Removed.
* LayoutTests/platform/glib/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-unfiltered-link-decoration-after-short-deletion-expected.txt: Added.
* LayoutTests/platform/glib/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-without-link-decoration-expected.txt: Copied from LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-without-link-decoration-expected.txt.
* LayoutTests/platform/mac-monterey/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-filtered-link-decoration-after-long-deletion-expected.txt: Added.
* LayoutTests/platform/mac-monterey/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration-expected.txt: Removed.
* LayoutTests/platform/mac-monterey/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-unfiltered-link-decoration-after-short-deletion-expected.txt: Added.
* LayoutTests/platform/mac-monterey/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-without-link-decoration-expected.txt: Copied from LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-without-link-decoration-expected.txt.

These platform exceptions are necessary because they don't support deleting only script-written cookies while keeping server-written cookies.

* LayoutTests/platform/ios-wk2/TestExpectations:
* LayoutTests/platform/wincairo/TestExpectations:
* Source/WebKit/NetworkProcess/Classifier/DidFilterKnownLinkDecoration.h: Added.
* Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
(WebKit::dataRemovalFrequencyToString):
(WebKit::toDataRemovalFrequency):
(WebKit::ResourceLoadStatisticsStore::resetParametersToDefaultValues):
(WebKit::ResourceLoadStatisticsStore::destroyStatements):
(WebKit::ResourceLoadStatisticsStore::merge):
(WebKit::ResourceLoadStatisticsStore::logCrossSiteLoadWithLinkDecoration):
(WebKit::ResourceLoadStatisticsStore::predicateValueForDomain const):
(WebKit::ResourceLoadStatisticsStore::isPrevalentResource const):
(WebKit::ResourceLoadStatisticsStore::isVeryPrevalentResource const):
(WebKit::ResourceLoadStatisticsStore::dataRemovalFrequency const):
(WebKit::ResourceLoadStatisticsStore::setIsScheduledForAllScriptWrittenStorageRemoval):
(WebKit::ResourceLoadStatisticsStore::isGrandfathered const):
(WebKit::ResourceLoadStatisticsStore::domains const):
(WebKit::ResourceLoadStatisticsStore::shouldRemoveAllButCookiesFor):
(WebKit::ResourceLoadStatisticsStore::registrableDomainsToDeleteOrRestrictWebsiteDataFor):
(WebKit::ResourceLoadStatisticsStore::resourceToString const):
* Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
* Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::logCrossSiteLoadWithLinkDecoration):
* Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* Source/WebKit/NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::didCommitCrossSiteLoadWithDataTransfer):
(WebKit::NetworkProcess::setCrossSiteLoadWithLinkDecorationForTesting):
* Source/WebKit/NetworkProcess/NetworkProcess.h:
* Source/WebKit/NetworkProcess/NetworkProcess.messages.in:
* Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetStatisticsCrossSiteLoadWithLinkDecoration):
* Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setStatisticsCrossSiteLoadWithLinkDecorationForTesting:withToHost:withWasFiltered:withCompletionHandler:]):
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:
* Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didCommitCrossSiteLoadWithDataTransfer):
(WebKit::NetworkProcessProxy::setCrossSiteLoadWithLinkDecorationForTesting):
* Source/WebKit/UIProcess/Network/NetworkProcessProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::setCrossSiteLoadWithLinkDecorationForTesting):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setCrossSiteLoadWithLinkDecorationForTesting):
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setStatisticsCrossSiteLoadWithLinkDecoration):
* Tools/WebKitTestRunner/InjectedBundle/TestRunner.h:
* Tools/WebKitTestRunner/TestController.cpp:
(WTR::TestController::setStatisticsCrossSiteLoadWithLinkDecoration):
* Tools/WebKitTestRunner/TestController.h:
* Tools/WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
* Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::platformSetStatisticsCrossSiteLoadWithLinkDecoration):

Canonical link: https://commits.webkit.org/274398@main




More information about the webkit-changes mailing list