Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Align ITP client side cookie cap with other script-writable storage
https://bugs.webkit.org/show_bug.cgi?id=240248 rdar://90468671 Reviewed by Alex Christensen. * LayoutTests/http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-24-hours.html: Added. * LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration-js-cookie-checking.html: Added. * LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-without-user-interaction-js-cookie-checking.html: Added. * LayoutTests/platform/mac-wk2/TestExpectations: * LayoutTests/platform/wk2/TestExpectations: Add new tests for this behavior. Skip them for now because they rely on internal bits. This patch adds a slight behavior change for ITP with client side cookies set from a page that is a link decoration target in that it deletes client side cookies either 24 hours after they are set OR after 7 days of no user interaction, whichever comes first. This maintains the strictest level of privacy for client side cookies based on all heuristics. * Source/WTF/wtf/PlatformEnableCocoa.h: * Source/WebCore/platform/network/NetworkStorageSession.cpp: (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies): (WebCore::NetworkStorageSession::clientSideCookieCap const): Update client-side cookie cap code to only handle the 24 hour link-decoration case now that we no longer need the 7 day cap. (WebCore::NetworkStorageSession::deleteCookiesForHostnames): * Source/WebCore/platform/network/NetworkStorageSession.h: * Source/WebCore/platform/network/cf/NetworkStorageSessionCFNetWin.cpp: (WebCore::NetworkStorageSession::deleteCookiesForHostnames): * Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::parseDOMCookie): Update JS cookie code so that we mark cookies as set in javascript and can distinguish them from server side cookies. Since there are some underlying assumptions in CFNetwork code about NSHTTPCookie not being mutable, we need to re-create the cookie here with the JS bit set to true. (WebCore::NetworkStorageSession::deleteCookiesForHostnames): * Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp: (WebCore::NetworkStorageSession::deleteCookiesForHostnames): * Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp: (WebCore::NetworkStorageSession::deleteCookiesForHostnames): * Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::merge): (WebKit::ResourceLoadStatisticsDatabaseStore::logCrossSiteLoadWithLinkDecoration): (WebKit::ResourceLoadStatisticsDatabaseStore::setIsScheduledForAllScriptWrittenStorageRemoval): (WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToDeleteOrRestrictWebsiteDataFor): (WebKit::ResourceLoadStatisticsDatabaseStore::setIsScheduledForAllButCookieDataRemoval): Deleted. * Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: * Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp: (WebKit::domainsToString): (WebKit::ResourceLoadStatisticsStore::updateClientSideCookiesAgeCap): (WebKit::ResourceLoadStatisticsStore::setAgeCapForClientSideCookies): Deleted. * Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: * Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: (WebKit::RegistrableDomainsToDeleteOrRestrictWebsiteDataFor::isolatedCopy const): (WebKit::RegistrableDomainsToDeleteOrRestrictWebsiteDataFor::isolatedCopy): (WebKit::RegistrableDomainsToDeleteOrRestrictWebsiteDataFor::isEmpty const): Rename "non cookie website data" to "script written storage" now that we include client side cookies. This can't be done to the actual database entry without a migration to a new database due to SQLite restrictions around renames, so we will leave that one in place. * Source/WebKit/NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains): Use the values stored in domainsToDeleteAllScriptWritableStorageFor to know which domains to delete script-writable cookies for when deleting website data, instead of just looking at domainsToDeleteAllCookiesFor. (WebKit::NetworkProcess::setAgeCapForClientSideCookies): Deleted. * Source/WebKit/NetworkProcess/NetworkProcess.h: * Source/WebKit/NetworkProcess/NetworkProcess.messages.in: * Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies): Deleted. * Source/WebKit/UIProcess/Network/NetworkProcessProxy.h: Unused function. Canonical link: https://commits.webkit.org/251397@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295391 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information