Skip to content
Permalink
Browse files
Rename RESOURCE_LOAD_STATISTICS to INTELLIGENT_TRACKING_PREVENTION
https://bugs.webkit.org/show_bug.cgi?id=230279
<rdar://problem/83118683>

Reviewed by Darin Adler.

.:

* Source/cmake/OptionsFTW.cmake:
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsMac.cmake:
* Source/cmake/OptionsPlayStation.cmake:
* Source/cmake/OptionsWPE.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:

Source/WebCore:

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect):
* dom/BroadcastChannel.cpp:
(WebCore::shouldPartitionOrigin):
* dom/Document+StorageAccess.idl:
* dom/Document.cpp:
(WebCore::Document::referrer):
* dom/Document.h:
* dom/DocumentStorageAccess.cpp:
* dom/DocumentStorageAccess.h:
* history/CachedPage.cpp:
(WebCore::CachedPage::CachedPage):
(WebCore::CachedPage::restore):
(WebCore::CachedPage::clear):
* history/CachedPage.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
* loader/EmptyClients.cpp:
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoaderClient.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::willSendRequestInternal):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
* page/ChromeClient.h:
* page/CrossSiteNavigationDataTransfer.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::open):
* page/Quirks.cpp:
(WebCore::Quirks::triggerOptionalStorageAccessQuirk const):
* page/Quirks.h:
* platform/network/NetworkStorageSession.cpp:
* platform/network/NetworkStorageSession.h:
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::cookiesForURL const):
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
* platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
(WebCore::NetworkStorageSession::getRawCookies const):
(WebCore::cookiesForSession):

Source/WebKit:

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
(WebKit::ResourceLoadStatisticsStore::updateClientSideCookiesAgeCap):
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
(WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
(WebKit::NetworkConnectionToWebProcess::clearPageSpecificData):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::restrictRequestReferrerToOriginIfNeeded):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcess::prepareToSuspend):
(WebKit::NetworkProcess::resume):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::retrieveCacheEntryInternal):
(WebKit::NetworkResourceLoader::didFinishLoading):
(WebKit::NetworkResourceLoader::validateCacheEntryForMaxAgeCapValidation):
(WebKit::NetworkResourceLoader::sendResultForCacheEntry):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession):
(WebKit::NetworkSession::~NetworkSession):
(WebKit::NetworkSession::invalidateAndCancel):
* NetworkProcess/NetworkSession.h:
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::storeRedirect):
* NetworkProcess/cache/NetworkCacheEntry.cpp:
* NetworkProcess/cache/NetworkCacheEntry.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
(WebKit::NetworkSessionCocoa::sessionWrapperForTask):
* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl):
(WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
(WebKit::NetworkDataTaskCurl::blockCookies):
(WebKit::NetworkDataTaskCurl::unblockCookies):
(WebKit::NetworkDataTaskCurl::shouldBlockCookies):
* NetworkProcess/curl/NetworkSessionCurl.cpp:
(WebKit::NetworkSessionCurl::NetworkSessionCurl):
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::createRequest):
* Shared/ResourceLoadStatisticsParameters.h:
(WebKit::ResourceLoadStatisticsParameters::encode const):
(WebKit::ResourceLoadStatisticsParameters::decode):
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* Shared/WebProcessDataStoreParameters.h:
(WebKit::WebProcessDataStoreParameters::encode const):
(WebKit::WebProcessDataStoreParameters::decode):
* Shared/WebsiteData/WebsiteData.cpp:
(WebKit::WebsiteData::encode const):
(WebKit::WebsiteData::decode):
(WebKit::WebsiteData::isolatedCopy const):
* Shared/WebsiteData/WebsiteData.h:
* UIProcess/API/C/WKPage.cpp:
(WKPageLoadedSubresourceDomains):
(WKPageClearLoadedSubresourceDomains):
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreRemoveITPDataForDomain):
(WKWebsiteDataStoreDoesStatisticsDomainIDExistInDatabase):
(WKWebsiteDataStoreSetResourceLoadStatisticsEnabled):
(WKWebsiteDataStoreIsStatisticsEphemeral):
(WKWebsiteDataStoreSetResourceLoadStatisticsDebugModeWithCompletionHandler):
(WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode):
(WKWebsiteDataStoreSetStatisticsLastSeen):
(WKWebsiteDataStoreSetStatisticsMergeStatistic):
(WKWebsiteDataStoreSetStatisticsExpiredStatistic):
(WKWebsiteDataStoreSetStatisticsPrevalentResource):
(WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
(WKWebsiteDataStoreDumpResourceLoadStatistics):
(WKWebsiteDataStoreIsStatisticsPrevalentResource):
(WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
(WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder):
(WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
(WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
(WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
(WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
(WKWebsiteDataStoreIsStatisticsOnlyInDatabaseOnce):
(WKWebsiteDataStoreSetStatisticsGrandfathered):
(WKWebsiteDataStoreIsStatisticsGrandfathered):
(WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
(WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
(WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
(WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
(WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
(WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
(WKWebsiteDataStoreSetStatisticsCrossSiteLoadWithLinkDecoration):
(WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
(WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
(WKWebsiteDataStoreStatisticsUpdateCookieBlocking):
(WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned):
(WKWebsiteDataStoreSetStatisticsIsRunningTest):
(WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
(WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval):
(WKWebsiteDataStoreSetStatisticsGrandfatheringTime):
(WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries):
(WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo):
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
(WKWebsiteDataStoreStatisticsDeleteCookiesForTesting):
(WKWebsiteDataStoreStatisticsHasLocalStorage):
(WKWebsiteDataStoreSetStatisticsCacheMaxAgeCap):
(WKWebsiteDataStoreStatisticsHasIsolatedSession):
(WKWebsiteDataStoreSetResourceLoadStatisticsShouldDowngradeReferrerForTesting):
(WKWebsiteDataStoreSetResourceLoadStatisticsShouldBlockThirdPartyCookiesForTesting):
(WKWebsiteDataStoreSetResourceLoadStatisticsFirstPartyWebsiteDataRemovalModeForTesting):
(WKWebsiteDataStoreSetResourceLoadStatisticsToSameSiteStrictCookiesForTesting):
(WKWebsiteDataStoreSetResourceLoadStatisticsFirstPartyHostCNAMEDomainForTesting):
(WKWebsiteDataStoreSetResourceLoadStatisticsThirdPartyCNAMEDomainForTesting):
(WKWebsiteDataStoreStatisticsResetToConsistentState):
(WKWebsiteDataStoreGetAllStorageAccessEntries):
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _seedResourceLoadStatisticsForTestingWithFirstParty:thirdParty:shouldScheduleNotification:completionHandler:]):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _resourceLoadStatisticsDebugMode]):
(-[WKWebsiteDataStore _setResourceLoadStatisticsDebugMode:]):
(-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
(-[WKWebsiteDataStore _loadedSubresourceDomainsFor:completionHandler:]):
(-[WKWebsiteDataStore _clearLoadedSubresourceDomainsFor:]):
(-[WKWebsiteDataStore _getAllStorageAccessEntriesFor:completionHandler:]):
(-[WKWebsiteDataStore _scheduleCookieBlockingUpdate:]):
(-[WKWebsiteDataStore _logUserInteraction:completionHandler:]):
(-[WKWebsiteDataStore _setPrevalentDomain:completionHandler:]):
(-[WKWebsiteDataStore _getIsPrevalentDomain:completionHandler:]):
(-[WKWebsiteDataStore _clearPrevalentDomain:completionHandler:]):
(-[WKWebsiteDataStore _clearResourceLoadStatistics:]):
(-[WKWebsiteDataStore _getResourceLoadStatisticsDataSummary:]):
(-[WKWebsiteDataStore _isRelationshipOnlyInDatabaseOnce:thirdParty:completionHandler:]):
(-[WKWebsiteDataStore _isRegisteredAsSubresourceUnderFirstParty:thirdParty:completionHandler:]):
(-[WKWebsiteDataStore _statisticsDatabaseHasAllTables:]):
(-[WKWebsiteDataStore _processStatisticsAndDataRecords:]):
(-[WKWebsiteDataStore _setThirdPartyCookieBlockingMode:onlyOnSitesWithoutUserInteraction:completionHandler:]):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/Network/NetworkProcessProxy.cpp:
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::webProcessDataStoreParameters):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
* UIProcess/WebProcessProxy.h:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::platformSetNetworkParameters):
* UIProcess/WebsiteData/WebsiteDataRecord.cpp:
(WebKit::WebsiteDataRecord::isolatedCopy const):
* UIProcess/WebsiteData/WebsiteDataRecord.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataAndApply):
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
(WebKit::WebsiteDataStore::resetCacheMaxAgeCapForPrevalentResources):
(WebKit::WebsiteDataStore::resourceLoadStatisticsEnabled const):
(WebKit::WebsiteDataStore::resourceLoadStatisticsDebugMode const):
(WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
(WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
(WebKit::WebsiteDataStore::isResourceLoadStatisticsEphemeral const):
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::detachedFromParent2):
(WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
* WebProcess/WebCoreSupport/WebResourceLoadObserver.h:
* WebProcess/WebPage/WebCookieJar.cpp:
(WebKit::WebCookieJar::cookies const):
(WebKit::WebCookieJar::setCookies):
(WebKit::WebCookieJar::cookiesEnabled const):
(WebKit::WebCookieJar::cookieRequestHeaderFieldValue const):
(WebKit::WebCookieJar::getRawCookies const):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCommitLoad):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::setWebsiteDataStoreParameters):
(WebKit::WebProcess::setResourceLoadStatisticsEnabled):
(WebKit::WebProcess::clearResourceLoadStatistics):
(WebKit::WebProcess::flushResourceLoadStatistics):
(WebKit::WebProcess::seedResourceLoadStatisticsForTesting):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

Source/WTF:

* wtf/PlatformEnableCocoa.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/IPCTestingAPI.mm:


Canonical link: https://commits.webkit.org/241688@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@282429 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
johnwilander committed Sep 15, 2021
1 parent 7c89958 commit 70eb0d411cfa484122cbecbd2aa9e947d3eeec52
Showing 106 changed files with 607 additions and 299 deletions.
@@ -1,3 +1,19 @@
2021-09-14 John Wilander <wilander@apple.com>

Rename RESOURCE_LOAD_STATISTICS to INTELLIGENT_TRACKING_PREVENTION
https://bugs.webkit.org/show_bug.cgi?id=230279
<rdar://problem/83118683>

Reviewed by Darin Adler.

* Source/cmake/OptionsFTW.cmake:
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsMac.cmake:
* Source/cmake/OptionsPlayStation.cmake:
* Source/cmake/OptionsWPE.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:

2021-09-14 Hoa Dinh <dvh@apple.com>

Add dvh@apple.com to the list of contributors.
@@ -1,3 +1,13 @@
2021-09-14 John Wilander <wilander@apple.com>

Rename RESOURCE_LOAD_STATISTICS to INTELLIGENT_TRACKING_PREVENTION
https://bugs.webkit.org/show_bug.cgi?id=230279
<rdar://problem/83118683>

Reviewed by Darin Adler.

* wtf/PlatformEnableCocoa.h:

2021-09-14 Chris Dumez <cdumez@apple.com>

Enable BroadcastChannel for modern WebKit
@@ -486,8 +486,8 @@
#define ENABLE_RESIZE_OBSERVER 1
#endif

#if !defined(ENABLE_RESOURCE_LOAD_STATISTICS)
#define ENABLE_RESOURCE_LOAD_STATISTICS 1
#if !defined(ENABLE_INTELLIGENT_TRACKING_PREVENTION)
#define ENABLE_INTELLIGENT_TRACKING_PREVENTION 1
#endif

#if !defined(ENABLE_SPEECH_SYNTHESIS) && !PLATFORM(MACCATALYST)
@@ -1,3 +1,54 @@
2021-09-14 John Wilander <wilander@apple.com>

Rename RESOURCE_LOAD_STATISTICS to INTELLIGENT_TRACKING_PREVENTION
https://bugs.webkit.org/show_bug.cgi?id=230279
<rdar://problem/83118683>

Reviewed by Darin Adler.

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect):
* dom/BroadcastChannel.cpp:
(WebCore::shouldPartitionOrigin):
* dom/Document+StorageAccess.idl:
* dom/Document.cpp:
(WebCore::Document::referrer):
* dom/Document.h:
* dom/DocumentStorageAccess.cpp:
* dom/DocumentStorageAccess.h:
* history/CachedPage.cpp:
(WebCore::CachedPage::CachedPage):
(WebCore::CachedPage::restore):
(WebCore::CachedPage::clear):
* history/CachedPage.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
* loader/EmptyClients.cpp:
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoaderClient.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::willSendRequestInternal):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
* page/ChromeClient.h:
* page/CrossSiteNavigationDataTransfer.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::open):
* page/Quirks.cpp:
(WebCore::Quirks::triggerOptionalStorageAccessQuirk const):
* page/Quirks.h:
* platform/network/NetworkStorageSession.cpp:
* platform/network/NetworkStorageSession.h:
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::cookiesForURL const):
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
* platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
(WebCore::NetworkStorageSession::getRawCookies const):
(WebCore::cookiesForSession):

2021-09-14 Wenson Hsieh <wenson_hsieh@apple.com>

[macOS] Avoid computing post-layout EditorState data unless necessary
@@ -324,7 +324,7 @@ ExceptionOr<void> WebSocket::connect(const String& url, const Vector<String>& pr
return { };
}

#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
auto reportRegistrableDomain = [domain = RegistrableDomain(m_url).isolatedCopy()](auto& context) mutable {
if (auto* frame = downcast<Document>(context).frame())
frame->loader().client().didLoadFromRegistrableDomain(WTFMove(domain));
@@ -64,7 +64,7 @@ static bool shouldPartitionOrigin(Document& document)
if (!document.settings().broadcastChannelOriginPartitioningEnabled())
return false;

#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
if (!document.settings().storageAccessAPIEnabled())
return true;

@@ -25,7 +25,7 @@

// https://privacycg.github.io/storage-access/#the-document-object
[
Conditional=RESOURCE_LOAD_STATISTICS,
Conditional=INTELLIGENT_TRACKING_PREVENTION,
EnabledBySetting=storageAccessAPI,
ImplementedBy=DocumentStorageAccess
] partial interface Document {
@@ -5313,7 +5313,7 @@ ExceptionOr<void> Document::setCookie(const String& value)

String Document::referrer()
{
#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
if (!m_referrerOverride.isEmpty())
return m_referrerOverride;
if (DeprecatedGlobalSettings::resourceLoadStatisticsEnabled() && frame()) {
@@ -8381,7 +8381,7 @@ void Document::updateMainArticleElementAfterLayout()
m_mainArticleElement = makeWeakPtr(tallestArticle.get());
}

#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)

bool Document::hasRequestedPageSpecificStorageAccessWithUserInteraction(const RegistrableDomain& domain)
{
@@ -1552,7 +1552,7 @@ class Document
bool handlingTouchEvent() const { return m_handlingTouchEvent; }
#endif

#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
WEBCORE_EXPORT bool hasRequestedPageSpecificStorageAccessWithUserInteraction(const RegistrableDomain&);
WEBCORE_EXPORT void setHasRequestedPageSpecificStorageAccessWithUserInteraction(const RegistrableDomain&);
WEBCORE_EXPORT void wasLoadedWithDataTransferFromPrevalentResource();
@@ -2184,7 +2184,7 @@ class Document
RefPtr<SWClientConnection> m_serviceWorkerConnection;
#endif

#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
RegistrableDomain m_registrableDomainRequestedPageSpecificStorageAccessWithUserInteraction { };
String m_referrerOverride;
#endif
@@ -26,7 +26,7 @@
#include "config.h"
#include "DocumentStorageAccess.h"

#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)

#include "Chrome.h"
#include "ChromeClient.h"
@@ -318,4 +318,4 @@ bool DocumentStorageAccess::hasFrameSpecificStorageAccess() const

} // namespace WebCore

#endif // ENABLE(RESOURCE_LOAD_STATISTICS)
#endif // ENABLE(INTELLIGENT_TRACKING_PREVENTION)
@@ -25,7 +25,7 @@

#pragma once

#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)

#include "RegistrableDomain.h"
#include "Supplementable.h"
@@ -150,4 +150,4 @@ std::optional<RequestStorageAccessResult> RequestStorageAccessResult::decode(Dec

} // namespace WebCore

#endif // ENABLE(RESOURCE_LOAD_STATISTICS)
#endif // ENABLE(INTELLIGENT_TRACKING_PREVENTION)
@@ -59,7 +59,7 @@ CachedPage::CachedPage(Page& page)
: m_page(page)
, m_expirationTime(MonotonicTime::now() + page.settings().backForwardCacheExpirationInterval())
, m_cachedMainFrame(makeUnique<CachedFrame>(page.mainFrame()))
#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
, m_loadedSubresourceDomains(page.mainFrame().loader().client().loadedSubresourceDomains())
#endif
{
@@ -171,7 +171,7 @@ void CachedPage::restore(Page& page)

firePageShowAndPopStateEvents(page);

#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
for (auto& domain : m_loadedSubresourceDomains)
page.mainFrame().loader().client().didLoadFromRegistrableDomain(WTFMove(domain));
#endif
@@ -189,7 +189,7 @@ void CachedPage::clear()
#endif
m_needsDeviceOrPageScaleChanged = false;
m_needsUpdateContentsSize = false;
#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
m_loadedSubresourceDomains.clear();
#endif
}
@@ -68,7 +68,7 @@ class CachedPage {
#endif
bool m_needsDeviceOrPageScaleChanged { false };
bool m_needsUpdateContentsSize { false };
#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
Vector<RegistrableDomain> m_loadedSubresourceDomains;
#endif
};
@@ -122,7 +122,7 @@
#include "QuickLook.h"
#endif

#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
#include "NetworkStorageSession.h"
#endif

@@ -952,7 +952,7 @@ void DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied(
cancelMainResourceLoad(frameLoader->cancelledError(m_request));
}

#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
static URL microsoftTeamsRedirectURL()
{
return URL(URL(), "https://www.microsoft.com/en-us/microsoft-365/microsoft-teams/");
@@ -969,7 +969,7 @@ void DocumentLoader::responseReceived(CachedResource& resource, const ResourceRe
} else
m_contentSecurityPolicy = nullptr;

#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
// FIXME(218779): Remove this quirk once microsoft.com completes their login flow redesign.
if (m_frame && m_frame->document()) {
auto& document = *m_frame->document();
@@ -1101,7 +1101,7 @@ RefPtr<LegacyPreviewLoaderClient> EmptyFrameLoaderClient::createPreviewLoaderCli

#endif

#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)

bool EmptyFrameLoaderClient::hasFrameSpecificStorageAccess()
{
@@ -199,7 +199,7 @@ class WEBCORE_EXPORT EmptyFrameLoaderClient : public FrameLoaderClient {
RefPtr<LegacyPreviewLoaderClient> createPreviewLoaderClient(const String&, const String&) final;
#endif

#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
bool hasFrameSpecificStorageAccess() final;
#endif
};
@@ -368,7 +368,7 @@ class WEBCORE_EXPORT FrameLoaderClient {
virtual void finishedLoadingApplicationManifest(uint64_t, const std::optional<ApplicationManifest>&) { }
#endif

#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
virtual bool hasFrameSpecificStorageAccess() { return false; }
virtual void didLoadFromRegistrableDomain(RegistrableDomain&&) { }
virtual Vector<RegistrableDomain> loadedSubresourceDomains() const { return { }; }
@@ -430,7 +430,7 @@ void ResourceLoader::willSendRequestInternal(ResourceRequest&& request, const Re
if (isRedirect) {
RESOURCELOADER_RELEASE_LOG("willSendRequestInternal: Processing cross-origin redirect");
platformStrategies()->loaderStrategy()->crossOriginRedirectReceived(this, request.url());
#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
frameLoader()->client().didLoadFromRegistrableDomain(RegistrableDomain(request.url()));
#endif
}
@@ -1085,7 +1085,7 @@ ResourceErrorOr<CachedResourceHandle<CachedResource>> CachedResourceLoader::requ

ASSERT(resource->url() == url.string());
m_documentResources.set(resource->url().string(), resource);
#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
frame.loader().client().didLoadFromRegistrableDomain(RegistrableDomain(resource->resourceRequest().url()));
#endif
return resource;
@@ -551,7 +551,7 @@ class ChromeClient {
virtual void reportProcessCPUTime(Seconds, ActivityStateForCPUSampling) { }
virtual RefPtr<Icon> createIconForFiles(const Vector<String>& /* filenames */) = 0;

#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
virtual void hasStorageAccess(RegistrableDomain&& /*subFrameDomain*/, RegistrableDomain&& /*topFrameDomain*/, Frame&, WTF::CompletionHandler<void(bool)>&& completionHandler) { completionHandler(false); }
virtual void requestStorageAccess(RegistrableDomain&& subFrameDomain, RegistrableDomain&& topFrameDomain, Frame&, StorageAccessScope scope, WTF::CompletionHandler<void(RequestStorageAccessResult)>&& completionHandler) { completionHandler({ StorageAccessWasGranted::No, StorageAccessPromptWasShown::No, scope, WTFMove(topFrameDomain), WTFMove(subFrameDomain) }); }
virtual bool hasPageLevelStorageAccess(const RegistrableDomain& /*topLevelDomain*/, const RegistrableDomain& /*resourceDomain*/) const { return false; }
@@ -25,7 +25,7 @@

#pragma once

#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
#include <wtf/OptionSet.h>

namespace WebCore {
@@ -50,4 +50,4 @@ template<> struct EnumTraits<WebCore::CrossSiteNavigationDataTransfer::Flag> {
};

} // namespace WTF
#endif // ENABLE(RESOURCE_LOAD_STATISTICS)
#endif // ENABLE(INTELLIGENT_TRACKING_PREVENTION)
@@ -2550,7 +2550,7 @@ ExceptionOr<RefPtr<Frame>> DOMWindow::createWindow(const String& urlString, cons

ExceptionOr<RefPtr<WindowProxy>> DOMWindow::open(DOMWindow& activeWindow, DOMWindow& firstWindow, const String& urlStringToOpen, const AtomString& frameName, const String& windowFeaturesString)
{
#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
if (RefPtr document = this->document()) {
if (document->settings().needsSiteSpecificQuirks() && urlStringToOpen == Quirks::BBCRadioPlayerURLString()) {
auto radioPlayerDomain = RegistrableDomain(URL(URL(), Quirks::staticRadioPlayerURLString()));
@@ -1012,7 +1012,7 @@ bool Quirks::shouldAvoidPastingImagesAsWebContent() const
#endif
}

#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
static bool isKinjaLoginAvatarElement(const Element& element)
{
// The click event handler has been found to trigger on a div or
@@ -1151,7 +1151,7 @@ Quirks::StorageAccessResult Quirks::triggerOptionalStorageAccessQuirk(Element& e
if (!DeprecatedGlobalSettings::resourceLoadStatisticsEnabled() || !isParentProcessAFullWebBrowser)
return Quirks::StorageAccessResult::ShouldNotCancelEvent;

#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
if (!needsQuirks())
return Quirks::StorageAccessResult::ShouldNotCancelEvent;

@@ -39,7 +39,7 @@ class HTMLVideoElement;
class LayoutUnit;
class PlatformMouseEvent;

#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
class RegistrableDomain;
enum class StorageAccessWasGranted : bool;
#endif
@@ -139,7 +139,7 @@ class Quirks {
WEBCORE_EXPORT bool blocksReturnToFullscreenFromPictureInPictureQuirk() const;
bool shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFullscreenQuirk() const;

#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
static bool isMicrosoftTeamsRedirectURL(const URL&);
static bool hasStorageAccessForAllLoginDomains(const HashSet<RegistrableDomain>&, const RegistrableDomain&);
static const String& BBCRadioPlayerURLString();
@@ -32,7 +32,7 @@
#include <wtf/NeverDestroyed.h>
#include <wtf/ProcessPrivilege.h>

#if ENABLE(RESOURCE_LOAD_STATISTICS)
#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
#include "ResourceRequest.h"
#if ENABLE(PUBLIC_SUFFIX_LIST)
#include "PublicSuffix.h"
@@ -65,7 +65,7 @@ Vector<Cookie> NetworkStorageSession::domCookiesForHost(const String&)