WebKit Bugzilla
Attachment 360229 Details for
Bug 193303
: Remove the UIProcess components of the ResourceLoadStatistics code
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193303-20190125230924.patch (text/plain), 83.24 KB, created by
Brent Fulgham
on 2019-01-25 23:09:25 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Brent Fulgham
Created:
2019-01-25 23:09:25 PST
Size:
83.24 KB
patch
obsolete
>Subversion Revision: 240509 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 2e0e8d24a58694f1b6cf22213a76e9ce33d056fb..1331af1f50723b3130c1331dd48292877feb5034 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,92 @@ >+2019-01-25 Brent Fulgham <bfulgham@apple.com> >+ >+ Remove the UIProcess components of the ResourceLoadStatistics code >+ https://bugs.webkit.org/show_bug.cgi?id=193303 >+ <rdar://problem/47160073> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Now that the ResourceLoadStatistics code is running in the NetworkProcess, we can get rid >+ of the UIProcess copies of these routines. >+ >+ Tested by existing ResourceLoadStatistics and StorageAccess tests. >+ >+ * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: >+ (WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap): >+ * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: >+ (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler): >+ (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler): >+ (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess): >+ (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap): >+ (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler): >+ (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler): >+ (WebKit::WebResourceLoadStatisticsStore::logTestingEvent): >+ (WebKit::WebResourceLoadStatisticsStore::notifyResourceLoadStatisticsProcessed): >+ (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): >+ (WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsWithWebsiteData): >+ (WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const): >+ (WebKit::WebResourceLoadStatisticsStore::notifyPageStatisticsTelemetryFinished const): >+ * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: >+ * UIProcess/WebProcessProxy.cpp: >+ (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted. >+ (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData): Deleted. >+ * UIProcess/WebProcessProxy.h: >+ * UIProcess/WebsiteData/WebsiteDataStore.cpp: >+ (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): >+ (WebKit::WebsiteDataStore::removeData): >+ (WebKit::WebsiteDataStore::setMaxStatisticsEntries): >+ (WebKit::WebsiteDataStore::setPruneEntriesDownTo): >+ (WebKit::WebsiteDataStore::setGrandfatheringTime): >+ (WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval): >+ (WebKit::WebsiteDataStore::dumpResourceLoadStatistics): >+ (WebKit::WebsiteDataStore::isPrevalentResource): >+ (WebKit::WebsiteDataStore::setPrevalentResource): >+ (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode): >+ (WebKit::WebsiteDataStore::isVeryPrevalentResource): >+ (WebKit::WebsiteDataStore::setVeryPrevalentResource): >+ (WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval): >+ (WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin): >+ (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder): >+ (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin): >+ (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder): >+ (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo): >+ (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom): >+ (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo): >+ (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom): >+ (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo): >+ (WebKit::WebsiteDataStore::clearPrevalentResource): >+ (WebKit::WebsiteDataStore::resetParametersToDefaultValues): >+ (WebKit::WebsiteDataStore::submitTelemetry): >+ (WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent): >+ (WebKit::WebsiteDataStore::scheduleCookieBlockingUpdate): >+ (WebKit::WebsiteDataStore::scheduleStatisticsAndDataRecordsProcessing): >+ (WebKit::WebsiteDataStore::setLastSeen): >+ (WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned): >+ (WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured): >+ (WebKit::WebsiteDataStore::hasStorageAccess): >+ (WebKit::WebsiteDataStore::requestStorageAccess): >+ (WebKit::WebsiteDataStore::grantStorageAccess): >+ (WebKit::WebsiteDataStore::setTimeToLiveUserInteraction): >+ (WebKit::WebsiteDataStore::logUserInteraction): >+ (WebKit::WebsiteDataStore::hasHadUserInteraction): >+ (WebKit::WebsiteDataStore::clearUserInteraction): >+ (WebKit::WebsiteDataStore::setGrandfathered): >+ (WebKit::WebsiteDataStore::webProcessWillOpenConnection): >+ (WebKit::WebsiteDataStore::webProcessDidCloseConnection): >+ (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode): >+ (WebKit::WebsiteDataStore::didCreateNetworkProcess): >+ (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData): Deleted. >+ (WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains): Deleted. >+ (WebKit::WebsiteDataStore::setCacheMaxAgeCap): Deleted. >+ (WebKit::WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor): Deleted. >+ (WebKit::WebsiteDataStore::setAgeCapForClientSideCookies): Deleted. >+ (WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler): Deleted. >+ (WebKit::WebsiteDataStore::grantStorageAccessHandler): Deleted. >+ (WebKit::WebsiteDataStore::removeAllStorageAccessHandler): Deleted. >+ (WebKit::WebsiteDataStore::removePrevalentDomains): Deleted. >+ (WebKit::WebsiteDataStore::isGrandfathered): Deleted. >+ * UIProcess/WebsiteData/WebsiteDataStore.h: >+ > 2019-01-25 Keith Rollin <krollin@apple.com> > > Update WebKitAdditions.xcconfig with correct order of variable definitions >diff --git a/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp b/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp >index 8f927eb9dcc4fad0b17589a8a20fac272ba1d07a..b188d422985e959539817a5060ef488136e5bc7d 100644 >--- a/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp >+++ b/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2017-2018 Apple Inc. All rights reserved. >+ * Copyright (C) 2017-2019Ã Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -897,8 +897,6 @@ void ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap() > > #if ENABLE(RESOURCE_LOAD_STATISTICS) > RunLoop::main().dispatch([store = makeRef(m_store), seconds = m_parameters.clientSideCookiesAgeCapTime] () { >- if (auto* websiteDataStore = store->websiteDataStore()) >- websiteDataStore->setAgeCapForClientSideCookies(seconds, [] { }); > if (auto* networkSession = store->networkSession()) > networkSession->networkStorageSession().setAgeCapForClientSideCookies(seconds); > }); >diff --git a/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp b/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp >index b2a3887b2c73bd79b175760b2eb86e6bdbf78d25..33f5f0d0028702d215c6450d7f778b0333c6ab92 100644 >--- a/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp >+++ b/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp >@@ -43,7 +43,6 @@ > #include "WebResourceLoadStatisticsStoreMessages.h" > #include "WebResourceLoadStatisticsTelemetry.h" > #include "WebsiteDataFetchOption.h" >-#include "WebsiteDataStore.h" > #include <WebCore/DiagnosticLoggingClient.h> > #include <WebCore/DiagnosticLoggingKeys.h> > #include <WebCore/NetworkStorageSession.h> >@@ -138,21 +137,6 @@ void WebResourceLoadStatisticsStore::setNotifyPagesWhenTelemetryWasCaptured(bool > completionHandler(); > } > >-WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore(WebsiteDataStore& websiteDataStore) >- : m_websiteDataStore(makeWeakPtr(websiteDataStore)) >- , m_statisticsQueue(WorkQueue::create("WebResourceLoadStatisticsStore Process Data Queue", WorkQueue::Type::Serial, WorkQueue::QOS::Utility)) >- , m_dailyTasksTimer(RunLoop::main(), this, &WebResourceLoadStatisticsStore::performDailyTasks) >-{ >- ASSERT(RunLoop::isMain()); >- >- postTask([this, resourceLoadStatisticsDirectory = websiteDataStore.resolvedResourceLoadStatisticsDirectory().isolatedCopy()] { >- m_memoryStore = std::make_unique<ResourceLoadStatisticsMemoryStore>(*this, m_statisticsQueue); >- m_persistentStorage = std::make_unique<ResourceLoadStatisticsPersistentStorage>(*m_memoryStore, m_statisticsQueue, resourceLoadStatisticsDirectory); >- }); >- >- m_dailyTasksTimer.startRepeating(24_h); >-} >- > WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore(NetworkSession& networkSession, const String& resourceLoadStatisticsDirectory) > : m_networkSession(makeWeakPtr(networkSession)) > , m_statisticsQueue(WorkQueue::create("WebResourceLoadStatisticsStore Process Data Queue", WorkQueue::Type::Serial, WorkQueue::QOS::Utility)) >@@ -223,13 +207,6 @@ void WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode(bool val > }); > } > >-void WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode(const URL& url, CompletionHandler<void()>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- >- setPrevalentResourceForDebugMode(WebCore::ResourceLoadStatistics::primaryDomain(url), WTFMove(completionHandler)); >-} >- > void WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode(const String& primaryDomain, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -308,11 +285,6 @@ void WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler(const S > { > ASSERT(RunLoop::isMain()); > >- if (m_websiteDataStore) { >- m_websiteDataStore->hasStorageAccessForFrameHandler(resourceDomain, firstPartyDomain, frameID, pageID, WTFMove(callback)); >- return; >- } >- > if (m_networkSession) { > callback(m_networkSession->networkStorageSession().hasStorageAccess(resourceDomain, firstPartyDomain, frameID, pageID)); > return; >@@ -403,11 +375,6 @@ void WebResourceLoadStatisticsStore::callGrantStorageAccessHandler(const String& > { > ASSERT(RunLoop::isMain()); > >- if (m_websiteDataStore) { >- m_websiteDataStore->grantStorageAccessHandler(subFramePrimaryDomain, topFramePrimaryDomain, frameID, pageID, WTFMove(callback)); >- return; >- } >- > callback(grantStorageAccess(subFramePrimaryDomain, topFramePrimaryDomain, frameID, pageID)); > } > >@@ -426,11 +393,6 @@ void WebResourceLoadStatisticsStore::removeAllStorageAccess(CompletionHandler<vo > { > ASSERT(RunLoop::isMain()); > >- if (m_websiteDataStore) { >- m_websiteDataStore->removeAllStorageAccessHandler(WTFMove(completionHandler)); >- return; >- } >- > if (m_networkSession) > m_networkSession->networkStorageSession().removeAllStorageAccess(); > >@@ -536,18 +498,6 @@ void WebResourceLoadStatisticsStore::logSubresourceRedirect(const String& source > }); > } > >-void WebResourceLoadStatisticsStore::logUserInteraction(const URL& url, CompletionHandler<void()>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- >- if (url.protocolIsAbout() || url.isEmpty()) { >- completionHandler(); >- return; >- } >- >- logUserInteraction(WebCore::ResourceLoadStatistics::primaryDomain(url), WTFMove(completionHandler)); >-} >- > void WebResourceLoadStatisticsStore::logUserInteraction(const String& targetPrimaryDomain, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -559,18 +509,6 @@ void WebResourceLoadStatisticsStore::logUserInteraction(const String& targetPrim > }); > } > >-void WebResourceLoadStatisticsStore::clearUserInteraction(const URL& url, CompletionHandler<void()>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- >- if (url.protocolIsAbout() || url.isEmpty()) { >- completionHandler(); >- return; >- } >- >- clearUserInteraction(WebCore::ResourceLoadStatistics::primaryDomain(url), WTFMove(completionHandler)); >-} >- > void WebResourceLoadStatisticsStore::clearUserInteraction(const String& targetPrimaryDomain, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -582,18 +520,6 @@ void WebResourceLoadStatisticsStore::clearUserInteraction(const String& targetPr > }); > } > >-void WebResourceLoadStatisticsStore::hasHadUserInteraction(const URL& url, CompletionHandler<void (bool)>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- >- if (url.protocolIsAbout() || url.isEmpty()) { >- completionHandler(false); >- return; >- } >- >- hasHadUserInteraction(WebCore::ResourceLoadStatistics::primaryDomain(url), WTFMove(completionHandler)); >-} >- > void WebResourceLoadStatisticsStore::hasHadUserInteraction(const String& primaryDomain, CompletionHandler<void(bool)>&& completionHandler) > { > postTask([this, primaryDomain = primaryDomain.isolatedCopy(), completionHandler = WTFMove(completionHandler)]() mutable { >@@ -604,18 +530,6 @@ void WebResourceLoadStatisticsStore::hasHadUserInteraction(const String& primary > }); > } > >-void WebResourceLoadStatisticsStore::setLastSeen(const URL& url, Seconds seconds, CompletionHandler<void()>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- >- if (url.protocolIsAbout() || url.isEmpty()) { >- completionHandler(); >- return; >- } >- >- setLastSeen(WebCore::ResourceLoadStatistics::primaryDomain(url), seconds, WTFMove(completionHandler)); >-} >- > void WebResourceLoadStatisticsStore::setLastSeen(const String& resourceDomain, Seconds seconds, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -627,18 +541,6 @@ void WebResourceLoadStatisticsStore::setLastSeen(const String& resourceDomain, S > }); > } > >-void WebResourceLoadStatisticsStore::setPrevalentResource(const URL& url, CompletionHandler<void()>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- >- if (url.protocolIsAbout() || url.isEmpty()) { >- completionHandler(); >- return; >- } >- >- setPrevalentResource(WebCore::ResourceLoadStatistics::primaryDomain(url), WTFMove(completionHandler)); >-} >- > void WebResourceLoadStatisticsStore::setPrevalentResource(const String& resourceDomain, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -650,18 +552,6 @@ void WebResourceLoadStatisticsStore::setPrevalentResource(const String& resource > }); > } > >-void WebResourceLoadStatisticsStore::setVeryPrevalentResource(const URL& url, CompletionHandler<void()>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- >- if (url.protocolIsAbout() || url.isEmpty()) { >- completionHandler(); >- return; >- } >- >- setVeryPrevalentResource(WebCore::ResourceLoadStatistics::primaryDomain(url), WTFMove(completionHandler)); >-} >- > void WebResourceLoadStatisticsStore::setVeryPrevalentResource(const String& primaryDomain, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -685,18 +575,6 @@ void WebResourceLoadStatisticsStore::dumpResourceLoadStatistics(CompletionHandle > }); > } > >-void WebResourceLoadStatisticsStore::isPrevalentResource(const URL& url, CompletionHandler<void (bool)>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- >- if (url.protocolIsAbout() || url.isEmpty()) { >- completionHandler(false); >- return; >- } >- >- isPrevalentResource(WebCore::ResourceLoadStatistics::primaryDomain(url), WTFMove(completionHandler)); >-} >- > void WebResourceLoadStatisticsStore::isPrevalentResource(const String& primaryDomain, CompletionHandler<void(bool)>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -709,18 +587,6 @@ void WebResourceLoadStatisticsStore::isPrevalentResource(const String& primaryDo > }); > } > >-void WebResourceLoadStatisticsStore::isVeryPrevalentResource(const URL& url, CompletionHandler<void(bool)>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- >- if (url.protocolIsAbout() || url.isEmpty()) { >- completionHandler(false); >- return; >- } >- >- isVeryPrevalentResource(WebCore::ResourceLoadStatistics::primaryDomain(url), WTFMove(completionHandler)); >-} >- > void WebResourceLoadStatisticsStore::isVeryPrevalentResource(const String& primaryDomain, CompletionHandler<void(bool)>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -733,13 +599,6 @@ void WebResourceLoadStatisticsStore::isVeryPrevalentResource(const String& prima > }); > } > >-void WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder(const URL& subresource, const URL& topFrame, CompletionHandler<void(bool)>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- >- isRegisteredAsSubresourceUnder(WebCore::ResourceLoadStatistics::primaryDomain(subresource), WebCore::ResourceLoadStatistics::primaryDomain(topFrame), WTFMove(completionHandler)); >-} >- > void WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder(const String& subresource, const String& topFrame, CompletionHandler<void(bool)>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -752,13 +611,6 @@ void WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder(const String > }); > } > >-void WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder(const URL& subFrame, const URL& topFrame, CompletionHandler<void (bool)>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- >- isRegisteredAsSubFrameUnder(WebCore::ResourceLoadStatistics::primaryDomain(subFrame), WebCore::ResourceLoadStatistics::primaryDomain(topFrame), WTFMove(completionHandler)); >-} >- > void WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder(const String& subFrame, const String& topFrame, CompletionHandler<void(bool)>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -771,13 +623,6 @@ void WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder(const String& s > }); > } > >-void WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo(const URL& hostRedirectedFrom, const URL& hostRedirectedTo, CompletionHandler<void (bool)>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- >- isRegisteredAsRedirectingTo(WebCore::ResourceLoadStatistics::primaryDomain(hostRedirectedFrom), WebCore::ResourceLoadStatistics::primaryDomain(hostRedirectedTo), WTFMove(completionHandler)); >-} >- > void WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo(const String& hostRedirectedFrom, const String& hostRedirectedTo, CompletionHandler<void(bool)>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -790,18 +635,6 @@ void WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo(const String& h > }); > } > >-void WebResourceLoadStatisticsStore::clearPrevalentResource(const URL& url, CompletionHandler<void()>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- >- if (url.protocolIsAbout() || url.isEmpty()) { >- completionHandler(); >- return; >- } >- >- clearPrevalentResource(WebCore::ResourceLoadStatistics::primaryDomain(url), WTFMove(completionHandler)); >-} >- > void WebResourceLoadStatisticsStore::clearPrevalentResource(const String& resourceDomain, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -813,16 +646,6 @@ void WebResourceLoadStatisticsStore::clearPrevalentResource(const String& resour > }); > } > >-void WebResourceLoadStatisticsStore::setGrandfathered(const URL& url, bool value, CompletionHandler<void()>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- >- if (url.protocolIsAbout() || url.isEmpty()) >- return; >- >- setGrandfathered(WebCore::ResourceLoadStatistics::primaryDomain(url), value, WTFMove(completionHandler)); >-} >- > void WebResourceLoadStatisticsStore::setGrandfathered(const String& domain, bool value, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -834,18 +657,6 @@ void WebResourceLoadStatisticsStore::setGrandfathered(const String& domain, bool > }); > } > >-void WebResourceLoadStatisticsStore::isGrandfathered(const URL& url, CompletionHandler<void (bool)>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- >- if (url.protocolIsAbout() || url.isEmpty()) { >- completionHandler(false); >- return; >- } >- >- isGrandfathered(WebCore::ResourceLoadStatistics::primaryDomain(url), WTFMove(completionHandler)); >-} >- > void WebResourceLoadStatisticsStore::isGrandfathered(const String& primaryDomain, CompletionHandler<void(bool)>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -858,18 +669,6 @@ void WebResourceLoadStatisticsStore::isGrandfathered(const String& primaryDomain > }); > } > >-void WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin(const URL& subframe, const URL& topFrame, CompletionHandler<void()>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- >- if (subframe.protocolIsAbout() || subframe.isEmpty() || topFrame.protocolIsAbout() || topFrame.isEmpty()) { >- completionHandler(); >- return; >- } >- >- setSubframeUnderTopFrameOrigin(WebCore::ResourceLoadStatistics::primaryDomain(subframe), WebCore::ResourceLoadStatistics::primaryDomain(topFrame), WTFMove(completionHandler)); >-} >- > void WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin(const String& subframe, const String& topFrame, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -881,18 +680,6 @@ void WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin(const String > }); > } > >-void WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin(const URL& subresource, const URL& topFrame, CompletionHandler<void()>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- >- if (subresource.protocolIsAbout() || subresource.isEmpty() || topFrame.protocolIsAbout() || topFrame.isEmpty()) { >- completionHandler(); >- return; >- } >- >- setSubresourceUnderTopFrameOrigin(WebCore::ResourceLoadStatistics::primaryDomain(subresource), WebCore::ResourceLoadStatistics::primaryDomain(topFrame), WTFMove(completionHandler)); >-} >- > void WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin(const String& subresource, const String& topFrame, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -904,18 +691,6 @@ void WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin(const Str > }); > } > >-void WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo(const URL& subresource, const URL& hostNameRedirectedTo, CompletionHandler<void()>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- >- if (subresource.protocolIsAbout() || subresource.isEmpty() || hostNameRedirectedTo.protocolIsAbout() || hostNameRedirectedTo.isEmpty()) { >- completionHandler(); >- return; >- } >- >- setSubresourceUniqueRedirectTo(WebCore::ResourceLoadStatistics::primaryDomain(subresource), WebCore::ResourceLoadStatistics::primaryDomain(hostNameRedirectedTo), WTFMove(completionHandler)); >-} >- > void WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo(const String& subresource, const String& hostNameRedirectedTo, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -927,18 +702,6 @@ void WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo(const String > }); > } > >-void WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom(const URL& subresource, const URL& hostNameRedirectedFrom, CompletionHandler<void()>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- >- if (subresource.protocolIsAbout() || subresource.isEmpty() || hostNameRedirectedFrom.protocolIsAbout() || hostNameRedirectedFrom.isEmpty()) { >- completionHandler(); >- return; >- } >- >- setSubresourceUniqueRedirectFrom(WebCore::ResourceLoadStatistics::primaryDomain(subresource), WebCore::ResourceLoadStatistics::primaryDomain(hostNameRedirectedFrom), WTFMove(completionHandler)); >-} >- > void WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom(const String& subresource, const String& hostNameRedirectedFrom, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -950,18 +713,6 @@ void WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom(const Stri > }); > } > >-void WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo(const URL& topFrameHostName, const URL& hostNameRedirectedTo, CompletionHandler<void()>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- >- if (topFrameHostName.protocolIsAbout() || topFrameHostName.isEmpty() || hostNameRedirectedTo.protocolIsAbout() || hostNameRedirectedTo.isEmpty()) { >- completionHandler(); >- return; >- } >- >- setTopFrameUniqueRedirectTo(WebCore::ResourceLoadStatistics::primaryDomain(topFrameHostName), WebCore::ResourceLoadStatistics::primaryDomain(hostNameRedirectedTo), WTFMove(completionHandler)); >-} >- > void WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo(const String& topFrameHostName, const String& hostNameRedirectedTo, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -973,18 +724,6 @@ void WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo(const String& t > }); > } > >-void WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom(const URL& topFrameHostName, const URL& hostNameRedirectedFrom, CompletionHandler<void()>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- >- if (topFrameHostName.protocolIsAbout() || topFrameHostName.isEmpty() || hostNameRedirectedFrom.protocolIsAbout() || hostNameRedirectedFrom.isEmpty()) { >- completionHandler(); >- return; >- } >- >- setTopFrameUniqueRedirectFrom(WebCore::ResourceLoadStatistics::primaryDomain(topFrameHostName), WebCore::ResourceLoadStatistics::primaryDomain(hostNameRedirectedFrom), WTFMove(completionHandler)); >-} >- > void WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom(const String& topFrameHostName, const String& hostNameRedirectedFrom, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -1117,11 +856,6 @@ void WebResourceLoadStatisticsStore::setCacheMaxAgeCap(Seconds seconds, Completi > ASSERT(RunLoop::isMain()); > ASSERT(seconds >= 0_s); > >- if (m_websiteDataStore) { >- m_websiteDataStore->setCacheMaxAgeCapForPrevalentResources(seconds, WTFMove(completionHandler)); >- return; >- } >- > if (m_networkSession) > m_networkSession->networkStorageSession().setCacheMaxAgeCapForPrevalentResources(seconds); > >@@ -1132,11 +866,6 @@ void WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesFor > { > ASSERT(RunLoop::isMain()); > >- if (m_websiteDataStore) { >- m_websiteDataStore->updatePrevalentDomainsToBlockCookiesFor(domainsToBlock, WTFMove(completionHandler)); >- return; >- } >- > if (m_networkSession) > m_networkSession->networkStorageSession().setPrevalentDomainsToBlockCookiesFor(domainsToBlock); > >@@ -1153,8 +882,6 @@ void WebResourceLoadStatisticsStore::callRemoveDomainsHandler(const Vector<Strin > { > ASSERT(RunLoop::isMain()); > >- if (m_websiteDataStore) >- m_websiteDataStore->removePrevalentDomains(domains); > removePrevalentDomains(domains); > } > >@@ -1197,11 +924,6 @@ void WebResourceLoadStatisticsStore::logTestingEvent(const String& event) > { > ASSERT(RunLoop::isMain()); > >- if (m_websiteDataStore) { >- m_websiteDataStore->logTestingEvent(event); >- return; >- } >- > if (m_networkSession) > m_networkSession->networkProcess().parentProcessConnection()->send(Messages::NetworkProcessProxy::LogTestingEvent(m_networkSession->sessionID(), event), 0); > } >@@ -1210,9 +932,6 @@ void WebResourceLoadStatisticsStore::notifyResourceLoadStatisticsProcessed() > { > ASSERT(RunLoop::isMain()); > >- if (m_websiteDataStore) >- WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed(); >- > if (m_networkSession) > m_networkSession->notifyResourceLoadStatisticsProcessed(); > } >@@ -1221,11 +940,6 @@ void WebResourceLoadStatisticsStore::deleteWebsiteDataForTopPrivatelyControlledD > { > ASSERT(RunLoop::isMain()); > >- if (m_websiteDataStore) { >- WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores(dataTypes, WTFMove(topPrivatelyControlledDomains), shouldNotifyPage, WTFMove(completionHandler)); >- return; >- } >- > if (m_networkSession) { > m_networkSession->deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores(dataTypes, WTFMove(topPrivatelyControlledDomains), shouldNotifyPage, WTFMove(completionHandler)); > return; >@@ -1238,11 +952,6 @@ void WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsWithWebsiteDat > { > ASSERT(RunLoop::isMain()); > >- if (m_websiteDataStore) { >- WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData(dataTypes, shouldNotifyPage, WTFMove(completionHandler)); >- return; >- } >- > if (m_networkSession) { > m_networkSession->topPrivatelyControlledDomainsWithWebsiteData(dataTypes, shouldNotifyPage, WTFMove(completionHandler)); > return; >@@ -1253,25 +962,12 @@ void WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsWithWebsiteDat > > void WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue(const String& message, const String& description, unsigned value, unsigned sigDigits, WebCore::ShouldSample shouldSample) const > { >- if (m_websiteDataStore) { >- if (auto* webPageProxy = WebPageProxy::nonEphemeralWebPageProxy()) >- webPageProxy->logDiagnosticMessageWithValue(message, description, value, sigDigits, shouldSample); >- } >- > if (m_networkSession) > const_cast<WebResourceLoadStatisticsStore*>(this)->networkSession()->logDiagnosticMessageWithValue(message, description, value, sigDigits, shouldSample); > } > > void WebResourceLoadStatisticsStore::notifyPageStatisticsTelemetryFinished(unsigned totalPrevalentResources, unsigned totalPrevalentResourcesWithUserInteraction, unsigned top3SubframeUnderTopFrameOrigins) const > { >- if (m_websiteDataStore) { >- API::Dictionary::MapType messageBody; >- messageBody.set("TotalPrevalentResources"_s, API::UInt64::create(totalPrevalentResources)); >- messageBody.set("TotalPrevalentResourcesWithUserInteraction"_s, API::UInt64::create(totalPrevalentResourcesWithUserInteraction)); >- messageBody.set("Top3SubframeUnderTopFrameOrigins"_s, API::UInt64::create(top3SubframeUnderTopFrameOrigins)); >- WebProcessProxy::notifyPageStatisticsTelemetryFinished(API::Dictionary::create(messageBody).ptr()); >- } >- > if (m_networkSession) > const_cast<WebResourceLoadStatisticsStore*>(this)->networkSession()->notifyPageStatisticsTelemetryFinished(totalPrevalentResources, totalPrevalentResourcesWithUserInteraction, top3SubframeUnderTopFrameOrigins); > } >diff --git a/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h b/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h >index 3b2d09fd471d5b67bee5dd090358d94f3b4ae016..dfd065ad59a1f8a70e133066b616d1f9f20f7d3f 100644 >--- a/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h >+++ b/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h >@@ -55,16 +55,10 @@ class ResourceLoadStatisticsMemoryStore; > class ResourceLoadStatisticsPersistentStorage; > class WebFrameProxy; > class WebProcessProxy; >-class WebsiteDataStore; > enum class ShouldGrandfatherStatistics : bool; > > class WebResourceLoadStatisticsStore final : public ThreadSafeRefCounted<WebResourceLoadStatisticsStore, WTF::DestructionThread::Main>, public IPC::MessageReceiver { > public: >- static Ref<WebResourceLoadStatisticsStore> create(WebsiteDataStore& websiteDataStore) >- { >- return adoptRef(*new WebResourceLoadStatisticsStore(websiteDataStore)); >- } >- > static Ref<WebResourceLoadStatisticsStore> create(NetworkSession& networkSession, const String& resourceLoadStatisticsDirectory) > { > return adoptRef(*new WebResourceLoadStatisticsStore(networkSession, resourceLoadStatisticsDirectory)); >@@ -89,58 +83,38 @@ public: > > void logFrameNavigation(const WebFrameProxy&, const URL& pageURL, const WebCore::ResourceRequest&, const URL& redirectURL); > void logFrameNavigation(const String& targetPrimaryDomain, const String& mainFramePrimaryDomain, const String& sourcePrimaryDomain, const String& targetHost, const String& mainFrameHost, bool isRedirect, bool isMainFrame); >- void logUserInteraction(const URL&, CompletionHandler<void()>&&); > void logUserInteraction(const String& targetPrimaryDomain, CompletionHandler<void()>&&); > void logWebSocketLoading(const String& targetPrimaryDomain, const String& mainFramePrimaryDomain, WallTime lastSeen, CompletionHandler<void()>&&); > void logSubresourceLoading(const String& targetPrimaryDomain, const String& mainFramePrimaryDomain, WallTime lastSeen, CompletionHandler<void()>&&); > void logSubresourceRedirect(const String& sourcePrimaryDomain, const String& targetPrimaryDomain, CompletionHandler<void()>&&); >- void clearUserInteraction(const URL&, CompletionHandler<void()>&&); > void clearUserInteraction(const String& targetPrimaryDomain, CompletionHandler<void()>&&); > void deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores(OptionSet<WebsiteDataType>, Vector<String>&& topPrivatelyControlledDomains, bool shouldNotifyPage, CompletionHandler<void(const HashSet<String>&)>&&); > void topPrivatelyControlledDomainsWithWebsiteData(OptionSet<WebsiteDataType>, bool shouldNotifyPage, CompletionHandler<void(HashSet<String>&&)>&&); > bool grantStorageAccess(const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID); >- void hasHadUserInteraction(const URL&, CompletionHandler<void(bool)>&&); > void hasHadUserInteraction(const String& resourceDomain, CompletionHandler<void(bool)>&&); > void hasStorageAccess(const String& subFrameHost, const String& topFrameHost, Optional<uint64_t> frameID, uint64_t pageID, CompletionHandler<void(bool)>&& callback); > bool hasStorageAccessForFrame(const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID); > void requestStorageAccess(const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, bool promptEnabled, CompletionHandler<void(StorageAccessStatus)>&&); > void requestUpdate(); >- void setLastSeen(const URL&, Seconds, CompletionHandler<void()>&&); > void setLastSeen(const String& resourceDomain, Seconds, CompletionHandler<void()>&&); >- void setPrevalentResource(const URL&, CompletionHandler<void()>&&); > void setPrevalentResource(const String& resourceDomain, CompletionHandler<void()>&&); >- void setVeryPrevalentResource(const URL&, CompletionHandler<void()>&&); > void setVeryPrevalentResource(const String& resourceDomain, CompletionHandler<void()>&&); > void dumpResourceLoadStatistics(CompletionHandler<void(String)>&&); >- void isPrevalentResource(const URL&, CompletionHandler<void(bool)>&&); > void isPrevalentResource(const String&, CompletionHandler<void(bool)>&&); >- void isVeryPrevalentResource(const URL&, CompletionHandler<void(bool)>&&); > void isVeryPrevalentResource(const String&, CompletionHandler<void(bool)>&&); >- void isRegisteredAsSubresourceUnder(const URL& subresource, const URL& topFrame, CompletionHandler<void(bool)>&&); > void isRegisteredAsSubresourceUnder(const String& subresource, const String& topFrame, CompletionHandler<void(bool)>&&); >- void isRegisteredAsSubFrameUnder(const URL& subFrame, const URL& topFrame, CompletionHandler<void(bool)>&&); > void isRegisteredAsSubFrameUnder(const String& subFrame, const String& topFrame, CompletionHandler<void(bool)>&&); >- void isRegisteredAsRedirectingTo(const URL& hostRedirectedFrom, const URL& hostRedirectedTo, CompletionHandler<void(bool)>&&); > void isRegisteredAsRedirectingTo(const String& hostRedirectedFrom, const String& hostRedirectedTo, CompletionHandler<void(bool)>&&); >- void clearPrevalentResource(const URL&, CompletionHandler<void()>&&); > void clearPrevalentResource(const String&, CompletionHandler<void()>&&); >- void setGrandfathered(const URL&, bool, CompletionHandler<void()>&&); > void setGrandfathered(const String&, bool, CompletionHandler<void()>&&); >- void isGrandfathered(const URL&, CompletionHandler<void(bool)>&&); > void isGrandfathered(const String&, CompletionHandler<void(bool)>&&); > void removePrevalentDomains(const Vector<String>& domainsToBlock); > void setNotifyPagesWhenDataRecordsWereScanned(bool, CompletionHandler<void()>&&); >- void setSubframeUnderTopFrameOrigin(const URL& subframe, const URL& topFrame, CompletionHandler<void()>&&); > void setSubframeUnderTopFrameOrigin(const String& subframe, const String& topFrame, CompletionHandler<void()>&&); >- void setSubresourceUnderTopFrameOrigin(const URL& subresource, const URL& topFrame, CompletionHandler<void()>&&); > void setSubresourceUnderTopFrameOrigin(const String& subresource, const String& topFrame, CompletionHandler<void()>&&); >- void setSubresourceUniqueRedirectTo(const URL& subresource, const URL& hostNameRedirectedTo, CompletionHandler<void()>&&); > void setSubresourceUniqueRedirectTo(const String& subresource, const String& hostNameRedirectedTo, CompletionHandler<void()>&&); >- void setSubresourceUniqueRedirectFrom(const URL& subresource, const URL& hostNameRedirectedFrom, CompletionHandler<void()>&&); > void setSubresourceUniqueRedirectFrom(const String& subresource, const String& hostNameRedirectedFrom, CompletionHandler<void()>&&); >- void setTopFrameUniqueRedirectTo(const URL& topFrameHostName, const URL& hostNameRedirectedTo, CompletionHandler<void()>&&); > void setTopFrameUniqueRedirectTo(const String& topFrameHostName, const String& hostNameRedirectedTo, CompletionHandler<void()>&&); >- void setTopFrameUniqueRedirectFrom(const URL& topFrameHostName, const URL& hostNameRedirectedFrom, CompletionHandler<void()>&&); > void setTopFrameUniqueRedirectFrom(const String& topFrameHostName, const String& hostNameRedirectedFrom, CompletionHandler<void()>&&); > void scheduleCookieBlockingUpdate(CompletionHandler<void()>&&); > void scheduleCookieBlockingUpdateForDomains(const Vector<String>& domainsToBlock, CompletionHandler<void()>&&); >@@ -160,7 +134,6 @@ public: > void resetParametersToDefaultValues(CompletionHandler<void()>&&); > > void setResourceLoadStatisticsDebugMode(bool, CompletionHandler<void()>&&); >- void setPrevalentResourceForDebugMode(const URL&, CompletionHandler<void()>&&); > void setPrevalentResourceForDebugMode(const String& resourceDomain, CompletionHandler<void()>&&); > > void logTestingEvent(const String&); >@@ -174,14 +147,12 @@ public: > > void notifyResourceLoadStatisticsProcessed(); > >- WebsiteDataStore* websiteDataStore() { return m_websiteDataStore.get(); } > NetworkSession* networkSession() { return m_networkSession.get(); } > > void sendDiagnosticMessageWithValue(const String& message, const String& description, unsigned value, unsigned sigDigits, WebCore::ShouldSample) const; > void notifyPageStatisticsTelemetryFinished(unsigned totalPrevalentResources, unsigned totalPrevalentResourcesWithUserInteraction, unsigned top3SubframeUnderTopFrameOrigins) const; > > private: >- explicit WebResourceLoadStatisticsStore(WebsiteDataStore&); > explicit WebResourceLoadStatisticsStore(NetworkSession&, const String&); > > void postTask(WTF::Function<void()>&&); >@@ -200,7 +171,6 @@ private: > > void flushAndDestroyPersistentStore(); > >- WeakPtr<WebsiteDataStore> m_websiteDataStore; > WeakPtr<NetworkSession> m_networkSession; > Ref<WorkQueue> m_statisticsQueue; > std::unique_ptr<ResourceLoadStatisticsMemoryStore> m_memoryStore; >diff --git a/Source/WebKit/UIProcess/WebProcessProxy.cpp b/Source/WebKit/UIProcess/WebProcessProxy.cpp >index d93f60532266e60b402375324516635a52ea50fd..050f7c39f2492aa8184b4317f47eb93c38d5f1da 100644 >--- a/Source/WebKit/UIProcess/WebProcessProxy.cpp >+++ b/Source/WebKit/UIProcess/WebProcessProxy.cpp >@@ -285,134 +285,6 @@ WebPageProxy* WebProcessProxy::webPage(uint64_t pageID) > } > > #if ENABLE(RESOURCE_LOAD_STATISTICS) >-void WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores(OptionSet<WebsiteDataType> dataTypes, Vector<String>&& topPrivatelyControlledDomains, bool shouldNotifyPage, CompletionHandler<void (const HashSet<String>&)>&& completionHandler) >-{ >- // We expect this to be called on the main thread so we get the default website data store. >- ASSERT(isMainThreadOrCheckDisabled()); >- >- struct CallbackAggregator : ThreadSafeRefCounted<CallbackAggregator> { >- explicit CallbackAggregator(CompletionHandler<void(HashSet<String>)>&& completionHandler) >- : completionHandler(WTFMove(completionHandler)) >- { >- } >- void addDomainsWithDeletedWebsiteData(const HashSet<String>& domains) >- { >- domainsWithDeletedWebsiteData.add(domains.begin(), domains.end()); >- } >- >- void addPendingCallback() >- { >- ++pendingCallbacks; >- } >- >- void removePendingCallback() >- { >- ASSERT(pendingCallbacks); >- --pendingCallbacks; >- >- callIfNeeded(); >- } >- >- void callIfNeeded() >- { >- if (!pendingCallbacks) >- completionHandler(domainsWithDeletedWebsiteData); >- } >- >- unsigned pendingCallbacks = 0; >- CompletionHandler<void(HashSet<String>)> completionHandler; >- HashSet<String> domainsWithDeletedWebsiteData; >- }; >- >- RefPtr<CallbackAggregator> callbackAggregator = adoptRef(new CallbackAggregator(WTFMove(completionHandler))); >- OptionSet<WebsiteDataFetchOption> fetchOptions = WebsiteDataFetchOption::DoNotCreateProcesses; >- >- HashSet<PAL::SessionID> visitedSessionIDs; >- for (auto& page : globalPageMap()) { >- auto& dataStore = page.value->websiteDataStore(); >- if (!dataStore.isPersistent() || visitedSessionIDs.contains(dataStore.sessionID())) >- continue; >- visitedSessionIDs.add(dataStore.sessionID()); >- callbackAggregator->addPendingCallback(); >- dataStore.removeDataForTopPrivatelyControlledDomains(dataTypes, fetchOptions, topPrivatelyControlledDomains, [callbackAggregator, shouldNotifyPage, page](HashSet<String>&& domainsWithDeletedWebsiteData) { >- // When completing the task, we should be getting called on the main thread. >- ASSERT(isMainThreadOrCheckDisabled()); >- >- if (shouldNotifyPage) >- page.value->postMessageToInjectedBundle("WebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished", nullptr); >- >- callbackAggregator->addDomainsWithDeletedWebsiteData(WTFMove(domainsWithDeletedWebsiteData)); >- callbackAggregator->removePendingCallback(); >- }); >- } >-} >- >-void WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData(OptionSet<WebsiteDataType> dataTypes, bool shouldNotifyPage, CompletionHandler<void(HashSet<String>&&)>&& completionHandler) >-{ >- // We expect this to be called on the main thread so we get the default website data store. >- ASSERT(isMainThreadOrCheckDisabled()); >- >- struct CallbackAggregator : ThreadSafeRefCounted<CallbackAggregator> { >- explicit CallbackAggregator(CompletionHandler<void(HashSet<String>&&)>&& completionHandler) >- : completionHandler(WTFMove(completionHandler)) >- { >- } >- >- void addDomainsWithDeletedWebsiteData(HashSet<String>&& domains) >- { >- domainsWithDeletedWebsiteData.add(domains.begin(), domains.end()); >- } >- >- void addPendingCallback() >- { >- ++pendingCallbacks; >- } >- >- void removePendingCallback() >- { >- ASSERT(pendingCallbacks); >- --pendingCallbacks; >- >- callIfNeeded(); >- } >- >- void callIfNeeded() >- { >- if (!pendingCallbacks) >- completionHandler(WTFMove(domainsWithDeletedWebsiteData)); >- } >- >- unsigned pendingCallbacks = 0; >- CompletionHandler<void(HashSet<String>&&)> completionHandler; >- HashSet<String> domainsWithDeletedWebsiteData; >- }; >- >- RefPtr<CallbackAggregator> callbackAggregator = adoptRef(new CallbackAggregator(WTFMove(completionHandler))); >- >- HashSet<PAL::SessionID> visitedSessionIDs; >- for (auto& page : globalPageMap().values()) { >- auto& dataStore = page->websiteDataStore(); >- if (!dataStore.isPersistent() || visitedSessionIDs.contains(dataStore.sessionID())) >- continue; >- visitedSessionIDs.add(dataStore.sessionID()); >- callbackAggregator->addPendingCallback(); >- dataStore.topPrivatelyControlledDomainsWithWebsiteData(dataTypes, { }, [callbackAggregator, shouldNotifyPage, page = makeRef(*page)](HashSet<String>&& domainsWithDataRecords) { >- // When completing the task, we should be getting called on the main thread. >- ASSERT(isMainThreadOrCheckDisabled()); >- >- if (shouldNotifyPage) >- page->postMessageToInjectedBundle("WebsiteDataScanForTopPrivatelyControlledDomainsFinished", nullptr); >- >- callbackAggregator->addDomainsWithDeletedWebsiteData(WTFMove(domainsWithDataRecords)); >- callbackAggregator->removePendingCallback(); >- }); >- } >- >- // FIXME: It's bizarre that this call is on WebProcessProxy and that it doesn't work if there are no visited pages. >- // This should actually be a function of WebsiteDataStore and it should work even if there are no WebViews instances. >- callbackAggregator->callIfNeeded(); >-} >- > void WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed() > { > for (auto& page : globalPageMap()) >diff --git a/Source/WebKit/UIProcess/WebProcessProxy.h b/Source/WebKit/UIProcess/WebProcessProxy.h >index 575ab4ddbf56836e037455f7d774fc28398adee2..835686c63013cbcd9d03357b01757f81c40ebd02 100644 >--- a/Source/WebKit/UIProcess/WebProcessProxy.h >+++ b/Source/WebKit/UIProcess/WebProcessProxy.h >@@ -173,9 +173,6 @@ public: > void deleteWebsiteDataForOrigins(PAL::SessionID, OptionSet<WebsiteDataType>, const Vector<WebCore::SecurityOriginData>&, CompletionHandler<void()>&&); > > #if ENABLE(RESOURCE_LOAD_STATISTICS) >- static void deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores(OptionSet<WebsiteDataType>, Vector<String>&& topPrivatelyControlledDomains, bool shouldNotifyPages, CompletionHandler<void (const HashSet<String>&)>&&); >- static void topPrivatelyControlledDomainsWithWebsiteData(OptionSet<WebsiteDataType> dataTypes, bool shouldNotifyPage, CompletionHandler<void(HashSet<String>&&)>&&); >- > static void notifyPageStatisticsAndDataRecordsProcessed(); > static void notifyPageStatisticsTelemetryFinished(API::Object* messageBody); > >diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp >index 82be11545a368bec09b4f020ac1b9312ed6cad8d..9a570f7e4f56a0f957cc40eae99986a48d51a4fd 100644 >--- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp >+++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp >@@ -132,10 +132,6 @@ WebsiteDataStore::~WebsiteDataStore() > > platformDestroy(); > >-#if ENABLE(RESOURCE_LOAD_STATISTICS) >- unregisterWebResourceLoadStatisticsStoreAsMessageReceiver(); >-#endif >- > if (m_sessionID.isValid() && m_sessionID != PAL::SessionID::defaultSessionID()) { > ASSERT(nonDefaultDataStores().get(m_sessionID) == this); > nonDefaultDataStores().remove(m_sessionID); >@@ -639,20 +635,6 @@ void WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains(OptionSet<Websi > }); > }); > } >- >-void WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData(OptionSet<WebsiteDataType> dataTypes, OptionSet<WebsiteDataFetchOption> fetchOptions, Function<void(HashSet<String>&&)>&& completionHandler) >-{ >- fetchData(dataTypes, fetchOptions, [completionHandler = WTFMove(completionHandler), protectedThis = makeRef(*this)](auto&& existingDataRecords) { >- HashSet<String> domainsWithDataRecords; >- for (auto&& dataRecord : existingDataRecords) { >- String domain = dataRecord.topPrivatelyControlledDomain(); >- if (domain.isEmpty()) >- continue; >- domainsWithDataRecords.add(WTFMove(domain)); >- } >- completionHandler(WTFMove(domainsWithDataRecords)); >- }); >-} > #endif > > static ProcessAccessType computeNetworkProcessAccessTypeForDataRemoval(OptionSet<WebsiteDataType> dataTypes, bool isNonPersistentStore) >@@ -939,19 +921,7 @@ void WebsiteDataStore::removeData(OptionSet<WebsiteDataType> dataTypes, WallTime > > #if ENABLE(RESOURCE_LOAD_STATISTICS) > if (dataTypes.contains(WebsiteDataType::ResourceLoadStatistics)) { >- auto deletedTypesRaw = dataTypes.toRaw(); >- auto monitoredTypesRaw = WebResourceLoadStatisticsStore::monitoredDataTypes().toRaw(); >- >- // If we are deleting all of the data types that the resource load statistics store monitors >- // we do not need to re-grandfather old data. >- auto shouldGrandfather = ((monitoredTypesRaw & deletedTypesRaw) == monitoredTypesRaw) ? ShouldGrandfatherStatistics::No : ShouldGrandfatherStatistics::Yes; >- >- if (m_resourceLoadStatistics) { >- callbackAggregator->addPendingCallback(); >- m_resourceLoadStatistics->scheduleClearInMemoryAndPersistent(modifiedSince, shouldGrandfather, [callbackAggregator] { >- callbackAggregator->removePendingCallback(); >- }); >- } else if (!didNotifyNetworkProcessToDeleteWebsiteData) { >+ if (!didNotifyNetworkProcessToDeleteWebsiteData) { > for (auto& processPool : processPools()) { > if (auto* process = processPool->networkProcess()) { > callbackAggregator->addPendingCallback(); >@@ -1243,52 +1213,15 @@ void WebsiteDataStore::removeData(OptionSet<WebsiteDataType> dataTypes, const Ve > } > #endif > >-#if ENABLE(RESOURCE_LOAD_STATISTICS) >- // FIXME <rdar://problem/33491222>; scheduleClearInMemoryAndPersistent does not have a completion handler, >- // so the completion handler for this removeData() call can be called prematurely. >- if (dataTypes.contains(WebsiteDataType::ResourceLoadStatistics) && m_resourceLoadStatistics) { >- auto deletedTypesRaw = dataTypes.toRaw(); >- auto monitoredTypesRaw = WebResourceLoadStatisticsStore::monitoredDataTypes().toRaw(); >- >- // If we are deleting all of the data types that the resource load statistics store monitors >- // we do not need to re-grandfather old data. >- auto shouldGrandfather = ((monitoredTypesRaw & deletedTypesRaw) == monitoredTypesRaw) ? ShouldGrandfatherStatistics::No : ShouldGrandfatherStatistics::Yes; >- >- callbackAggregator->addPendingCallback(); >- m_resourceLoadStatistics->scheduleClearInMemoryAndPersistent(shouldGrandfather, [callbackAggregator] { >- callbackAggregator->removePendingCallback(); >- }); >- >- callbackAggregator->addPendingCallback(); >- clearResourceLoadStatisticsInWebProcesses([callbackAggregator] { >- callbackAggregator->removePendingCallback(); >- }); >- } >-#endif >- > // There's a chance that we don't have any pending callbacks. If so, we want to dispatch the completion handler right away. > callbackAggregator->callIfNeeded(); > } > > #if ENABLE(RESOURCE_LOAD_STATISTICS) >-void WebsiteDataStore::removeDataForTopPrivatelyControlledDomains(OptionSet<WebsiteDataType> dataTypes, OptionSet<WebsiteDataFetchOption> fetchOptions, const Vector<String>& topPrivatelyControlledDomains, Function<void(HashSet<String>&&)>&& completionHandler) >-{ >- fetchDataForTopPrivatelyControlledDomains(dataTypes, fetchOptions, topPrivatelyControlledDomains, [dataTypes, completionHandler = WTFMove(completionHandler), this, protectedThis = makeRef(*this)](Vector<WebsiteDataRecord>&& websiteDataRecords, HashSet<String>&& domainsWithDataRecords) mutable { >- this->removeData(dataTypes, websiteDataRecords, [domainsWithDataRecords = WTFMove(domainsWithDataRecords), completionHandler = WTFMove(completionHandler)]() mutable { >- completionHandler(WTFMove(domainsWithDataRecords)); >- }); >- }); >-} >- > void WebsiteDataStore::setMaxStatisticsEntries(size_t maximumEntryCount, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->setMaxStatisticsEntries(maximumEntryCount, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) >@@ -1299,11 +1232,6 @@ void WebsiteDataStore::setPruneEntriesDownTo(size_t pruneTargetCount, Completion > { > ASSERT(RunLoop::isMain()); > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->setPruneEntriesDownTo(pruneTargetCount, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) { >@@ -1315,42 +1243,16 @@ void WebsiteDataStore::setGrandfatheringTime(Seconds seconds, CompletionHandler< > { > ASSERT(RunLoop::isMain()); > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->setGrandfatheringTime(seconds, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) > processPool->ensureNetworkProcess().setGrandfatheringTime(m_sessionID, seconds, [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); > } > >-void WebsiteDataStore::setCacheMaxAgeCap(Seconds seconds, CompletionHandler<void()>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- ASSERT(seconds >= 0_s); >- >- if (m_resourceLoadStatistics) { >- setCacheMaxAgeCap(seconds, WTFMove(completionHandler)); >- return; >- } >- >- auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); >- >- for (auto& processPool : processPools()) >- processPool->ensureNetworkProcess().setCacheMaxAgeCap(m_sessionID, seconds, [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); >-} >- > void WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval(Seconds seconds, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->setMinimumTimeBetweenDataRecordsRemoval(seconds, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) >@@ -1361,11 +1263,6 @@ void WebsiteDataStore::dumpResourceLoadStatistics(CompletionHandler<void(const S > { > ASSERT(RunLoop::isMain()); > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->dumpResourceLoadStatistics(WTFMove(completionHandler)); >- return; >- } >- > for (auto& processPool : processPools()) { > if (auto* process = processPool->networkProcess()) { > process->dumpResourceLoadStatistics(m_sessionID, WTFMove(completionHandler)); >@@ -1384,11 +1281,6 @@ void WebsiteDataStore::isPrevalentResource(const URL& url, CompletionHandler<voi > return; > } > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->isPrevalentResource(url, WTFMove(completionHandler)); >- return; >- } >- > for (auto& processPool : processPools()) { > if (auto* process = processPool->networkProcess()) { > process->isPrevalentResource(m_sessionID, WebCore::ResourceLoadStatistics::primaryDomain(url), WTFMove(completionHandler)); >@@ -1407,11 +1299,6 @@ void WebsiteDataStore::setPrevalentResource(const URL& url, CompletionHandler<vo > return; > } > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->setPrevalentResource(url, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) { >@@ -1428,11 +1315,6 @@ void WebsiteDataStore::setPrevalentResourceForDebugMode(const URL& url, Completi > return; > } > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->setPrevalentResourceForDebugMode(url, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) { >@@ -1450,11 +1332,6 @@ void WebsiteDataStore::isVeryPrevalentResource(const URL& url, CompletionHandler > return; > } > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->isVeryPrevalentResource(url, WTFMove(completionHandler)); >- return; >- } >- > for (auto& processPool : processPools()) { > if (auto* process = processPool->networkProcess()) { > process->isVeryPrevalentResource(m_sessionID, WebCore::ResourceLoadStatistics::primaryDomain(url), WTFMove(completionHandler)); >@@ -1473,11 +1350,6 @@ void WebsiteDataStore::setVeryPrevalentResource(const URL& url, CompletionHandle > return; > } > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->setVeryPrevalentResource(url, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) { >@@ -1490,11 +1362,6 @@ void WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval(bool v > { > ASSERT(RunLoop::isMain()); > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->setShouldClassifyResourcesBeforeDataRecordsRemoval(value, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) >@@ -1510,11 +1377,6 @@ void WebsiteDataStore::setSubframeUnderTopFrameOrigin(const URL& subframe, const > return; > } > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->setSubframeUnderTopFrameOrigin(subframe, topFrame, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) { >@@ -1527,11 +1389,6 @@ void WebsiteDataStore::isRegisteredAsSubFrameUnder(const URL& subFrame, const UR > { > ASSERT(RunLoop::isMain()); > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->isRegisteredAsSubFrameUnder(subFrame, topFrame, WTFMove(completionHandler)); >- return; >- } >- > for (auto& processPool : processPools()) { > if (auto* process = processPool->networkProcess()) { > process->isRegisteredAsSubFrameUnder(m_sessionID, WebCore::ResourceLoadStatistics::primaryDomain(subFrame), WebCore::ResourceLoadStatistics::primaryDomain(topFrame), WTFMove(completionHandler)); >@@ -1550,11 +1407,6 @@ void WebsiteDataStore::setSubresourceUnderTopFrameOrigin(const URL& subresource, > return; > } > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->setSubresourceUnderTopFrameOrigin(subresource, topFrame, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) { >@@ -1567,11 +1419,6 @@ void WebsiteDataStore::isRegisteredAsSubresourceUnder(const URL& subresource, co > { > ASSERT(RunLoop::isMain()); > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->isRegisteredAsSubresourceUnder(subresource, topFrame, WTFMove(completionHandler)); >- return; >- } >- > for (auto& processPool : processPools()) { > if (auto* process = processPool->networkProcess()) { > process->isRegisteredAsSubresourceUnder(m_sessionID, WebCore::ResourceLoadStatistics::primaryDomain(subresource), WebCore::ResourceLoadStatistics::primaryDomain(topFrame), WTFMove(completionHandler)); >@@ -1590,11 +1437,6 @@ void WebsiteDataStore::setSubresourceUniqueRedirectTo(const URL& subresource, co > return; > } > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->setSubresourceUniqueRedirectTo(subresource, hostNameRedirectedTo, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) { >@@ -1612,11 +1454,6 @@ void WebsiteDataStore::setSubresourceUniqueRedirectFrom(const URL& subresource, > return; > } > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->setSubresourceUniqueRedirectFrom(subresource, hostNameRedirectedFrom, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) { >@@ -1634,11 +1471,6 @@ void WebsiteDataStore::setTopFrameUniqueRedirectTo(const URL& topFrameHostName, > return; > } > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->setTopFrameUniqueRedirectTo(topFrameHostName, hostNameRedirectedTo, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) { >@@ -1656,11 +1488,6 @@ void WebsiteDataStore::setTopFrameUniqueRedirectFrom(const URL& topFrameHostName > return; > } > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->setTopFrameUniqueRedirectFrom(topFrameHostName, hostNameRedirectedFrom, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) { >@@ -1673,11 +1500,6 @@ void WebsiteDataStore::isRegisteredAsRedirectingTo(const URL& hostRedirectedFrom > { > ASSERT(RunLoop::isMain()); > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->isRegisteredAsRedirectingTo(hostRedirectedFrom, hostRedirectedTo, WTFMove(completionHandler)); >- return; >- } >- > for (auto& processPool : processPools()) { > if (auto* process = processPool->networkProcess()) { > process->isRegisteredAsRedirectingTo(m_sessionID, WebCore::ResourceLoadStatistics::primaryDomain(hostRedirectedFrom), WebCore::ResourceLoadStatistics::primaryDomain(hostRedirectedTo), WTFMove(completionHandler)); >@@ -1696,11 +1518,6 @@ void WebsiteDataStore::clearPrevalentResource(const URL& url, CompletionHandler< > return; > } > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->clearPrevalentResource(url, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > const auto& primaryDomain = WebCore::ResourceLoadStatistics::primaryDomain(url); >@@ -1714,11 +1531,6 @@ void WebsiteDataStore::resetParametersToDefaultValues(CompletionHandler<void()>& > { > ASSERT(RunLoop::isMain()); > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->resetParametersToDefaultValues(WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) { >@@ -1731,11 +1543,6 @@ void WebsiteDataStore::submitTelemetry() > { > ASSERT(RunLoop::isMain()); > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->submitTelemetry([] { }); >- return; >- } >- > for (auto& processPool : processPools()) { > if (auto* process = processPool->networkProcess()) > process->submitTelemetry(m_sessionID, [] { }); >@@ -1746,11 +1553,6 @@ void WebsiteDataStore::scheduleClearInMemoryAndPersistent(WallTime modifiedSince > { > ASSERT(RunLoop::isMain()); > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->scheduleClearInMemoryAndPersistent(modifiedSince, shouldGrandfather, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) { >@@ -1763,11 +1565,6 @@ void WebsiteDataStore::scheduleClearInMemoryAndPersistent(ShouldGrandfatherStati > { > ASSERT(RunLoop::isMain()); > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->scheduleClearInMemoryAndPersistent(shouldGrandfather, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) { >@@ -1778,11 +1575,6 @@ void WebsiteDataStore::scheduleClearInMemoryAndPersistent(ShouldGrandfatherStati > > void WebsiteDataStore::scheduleCookieBlockingUpdate(CompletionHandler<void()>&& completionHandler) > { >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->scheduleCookieBlockingUpdate(WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) { >@@ -1795,11 +1587,6 @@ void WebsiteDataStore::scheduleStatisticsAndDataRecordsProcessing(CompletionHand > { > ASSERT(RunLoop::isMain()); > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->scheduleStatisticsAndDataRecordsProcessing(WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) { >@@ -1808,26 +1595,6 @@ void WebsiteDataStore::scheduleStatisticsAndDataRecordsProcessing(CompletionHand > } > } > >-#if ENABLE(RESOURCE_LOAD_STATISTICS) >-void WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor(const Vector<String>& domainsToBlock, CompletionHandler<void()>&& completionHandler) >-{ >- auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); >- >- for (auto& processPool : processPools()) { >- if (auto* process = processPool->networkProcess()) >- process->updatePrevalentDomainsToBlockCookiesFor(m_sessionID, domainsToBlock, [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); >- } >-} >-#endif >- >-void WebsiteDataStore::setAgeCapForClientSideCookies(Optional<Seconds> seconds, CompletionHandler<void()>&& completionHandler) >-{ >- auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); >- >- for (auto& processPool : processPools()) >- processPool->ensureNetworkProcess().setAgeCapForClientSideCookies(m_sessionID, seconds, [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); >-} >- > void WebsiteDataStore::setLastSeen(const URL& url, Seconds seconds, CompletionHandler<void()>&& completionHandler) > { > if (url.protocolIsAbout() || url.isEmpty()) { >@@ -1835,11 +1602,6 @@ void WebsiteDataStore::setLastSeen(const URL& url, Seconds seconds, CompletionHa > return; > } > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->setLastSeen(url, seconds, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > const auto& primaryDomain = WebCore::ResourceLoadStatistics::primaryDomain(url); >@@ -1851,11 +1613,6 @@ void WebsiteDataStore::setLastSeen(const URL& url, Seconds seconds, CompletionHa > > void WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned(bool value, CompletionHandler<void()>&& completionHandler) > { >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->setNotifyPagesWhenDataRecordsWereScanned(value, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) >@@ -1864,29 +1621,12 @@ void WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned(bool value, Comp > > void WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured(bool value, CompletionHandler<void()>&& completionHandler) > { >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->setNotifyPagesWhenTelemetryWasCaptured(value, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) > processPool->ensureNetworkProcess().setNotifyPagesWhenTelemetryWasCaptured(m_sessionID, value, [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); > } > >-void WebsiteDataStore::hasStorageAccessForFrameHandler(const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID, CompletionHandler<void(bool hasAccess)>&& completionHandler) >-{ >- auto* webPage = WebProcessProxy::webPage(pageID); >- if (!webPage) { >- completionHandler(false); >- return; >- } >- >- auto& networkProcess = webPage->process().processPool().ensureNetworkProcess(); >- networkProcess.hasStorageAccessForFrame(m_sessionID, resourceDomain, firstPartyDomain, frameID, pageID, WTFMove(completionHandler)); >-} >- > void WebsiteDataStore::getAllStorageAccessEntries(uint64_t pageID, CompletionHandler<void(Vector<String>&& domains)>&& completionHandler) > { > auto* webPage = WebProcessProxy::webPage(pageID); >@@ -1899,34 +1639,6 @@ void WebsiteDataStore::getAllStorageAccessEntries(uint64_t pageID, CompletionHan > networkProcess.getAllStorageAccessEntries(m_sessionID, WTFMove(completionHandler)); > } > >-void WebsiteDataStore::grantStorageAccessHandler(const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, CompletionHandler<void(bool wasGranted)>&& completionHandler) >-{ >- auto* webPage = WebProcessProxy::webPage(pageID); >- if (!webPage) { >- completionHandler(false); >- return; >- } >- >- auto& networkProcess = webPage->process().processPool().ensureNetworkProcess(); >- networkProcess.grantStorageAccess(m_sessionID, resourceDomain, firstPartyDomain, frameID, pageID, false, WTFMove(completionHandler)); >-} >- >-void WebsiteDataStore::removeAllStorageAccessHandler(CompletionHandler<void()>&& completionHandler) >-{ >- auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); >- >- for (auto& processPool : processPools()) { >- if (auto networkProcess = processPool->networkProcess()) >- networkProcess->removeAllStorageAccess(m_sessionID, [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); >- } >-} >- >-void WebsiteDataStore::removePrevalentDomains(const Vector<String>& domains) >-{ >- for (auto& processPool : processPools()) >- processPool->sendToNetworkingProcess(Messages::NetworkProcess::RemovePrevalentDomains(m_sessionID, domains)); >-} >- > void WebsiteDataStore::hasStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t pageID, CompletionHandler<void(bool)>&& completionHandler) > { > if (!resourceLoadStatisticsEnabled()) { >@@ -1934,11 +1646,6 @@ void WebsiteDataStore::hasStorageAccess(String&& subFrameHost, String&& topFrame > return; > } > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->hasStorageAccess(WTFMove(subFrameHost), WTFMove(topFrameHost), frameID, pageID, WTFMove(completionHandler)); >- return; >- } >- > auto* webPage = WebProcessProxy::webPage(pageID); > if (!webPage) { > completionHandler(false); >@@ -1956,11 +1663,6 @@ void WebsiteDataStore::requestStorageAccess(String&& subFrameHost, String&& topF > return; > } > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->requestStorageAccess(WTFMove(subFrameHost), WTFMove(topFrameHost), frameID, pageID, promptEnabled, WTFMove(completionHandler)); >- return; >- } >- > auto* webPage = WebProcessProxy::webPage(pageID); > if (!webPage) { > completionHandler(StorageAccessStatus::CannotRequestAccess); >@@ -1978,11 +1680,6 @@ void WebsiteDataStore::grantStorageAccess(String&& subFrameHost, String&& topFra > return; > } > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->grantStorageAccess(WTFMove(subFrameHost), WTFMove(topFrameHost), frameID, pageID, userWasPrompted, WTFMove(completionHandler)); >- return; >- } >- > auto* webPage = WebProcessProxy::webPage(pageID); > if (!webPage) { > completionHandler(false); >@@ -1995,11 +1692,6 @@ void WebsiteDataStore::grantStorageAccess(String&& subFrameHost, String&& topFra > > void WebsiteDataStore::setTimeToLiveUserInteraction(Seconds seconds, CompletionHandler<void()>&& completionHandler) > { >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->setTimeToLiveUserInteraction(seconds, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) >@@ -2015,11 +1707,6 @@ void WebsiteDataStore::logUserInteraction(const URL& url, CompletionHandler<void > return; > } > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->logUserInteraction(url, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) { >@@ -2037,11 +1724,6 @@ void WebsiteDataStore::hasHadUserInteraction(const URL& url, CompletionHandler<v > return; > } > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->hasHadUserInteraction(url, WTFMove(completionHandler)); >- return; >- } >- > for (auto& processPool : processPools()) { > if (auto* process = processPool->networkProcess()) { > process->hasHadUserInteraction(m_sessionID, WebCore::ResourceLoadStatistics::primaryDomain(url), WTFMove(completionHandler)); >@@ -2060,11 +1742,6 @@ void WebsiteDataStore::clearUserInteraction(const URL& url, CompletionHandler<vo > return; > } > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->clearUserInteraction(url, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) { >@@ -2073,29 +1750,6 @@ void WebsiteDataStore::clearUserInteraction(const URL& url, CompletionHandler<vo > } > } > >-void WebsiteDataStore::isGrandfathered(const URL& url, CompletionHandler<void(bool)>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- >- if (url.protocolIsAbout() || url.isEmpty()) { >- completionHandler(false); >- return; >- } >- >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->isGrandfathered(url, WTFMove(completionHandler)); >- return; >- } >- >- for (auto& processPool : processPools()) { >- if (auto* process = processPool->networkProcess()) { >- process->isGrandfathered(m_sessionID, WebCore::ResourceLoadStatistics::primaryDomain(url), WTFMove(completionHandler)); >- ASSERT(processPools().size() == 1); >- break; >- } >- } >-} >- > void WebsiteDataStore::setGrandfathered(const URL& url, bool isGrandfathered, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -2105,11 +1759,6 @@ void WebsiteDataStore::setGrandfathered(const URL& url, bool isGrandfathered, Co > return; > } > >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->setGrandfathered(url, isGrandfathered, WTFMove(completionHandler)); >- return; >- } >- > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) { >@@ -2162,11 +1811,6 @@ void WebsiteDataStore::webProcessWillOpenConnection(WebProcessProxy& webProcessP > { > if (m_storageManager) > m_storageManager->processWillOpenConnection(webProcessProxy, connection); >- >-#if ENABLE(RESOURCE_LOAD_STATISTICS) >- if (m_resourceLoadStatistics) >- webProcessProxy.addMessageReceiver(Messages::WebResourceLoadStatisticsStore::messageReceiverName(), *m_resourceLoadStatistics); >-#endif > } > > void WebsiteDataStore::webPageWillOpenConnection(WebPageProxy& webPageProxy, IPC::Connection& connection) >@@ -2183,11 +1827,6 @@ void WebsiteDataStore::webPageDidCloseConnection(WebPageProxy& webPageProxy, IPC > > void WebsiteDataStore::webProcessDidCloseConnection(WebProcessProxy& webProcessProxy, IPC::Connection& connection) > { >-#if ENABLE(RESOURCE_LOAD_STATISTICS) >- if (m_resourceLoadStatistics) >- webProcessProxy.removeMessageReceiver(Messages::WebResourceLoadStatisticsStore::messageReceiverName()); >-#endif >- > if (m_storageManager) > m_storageManager->processDidCloseConnection(webProcessProxy, connection); > } >@@ -2344,11 +1983,7 @@ void WebsiteDataStore::setResourceLoadStatisticsDebugMode(bool enabled, Completi > { > #if ENABLE(RESOURCE_LOAD_STATISTICS) > m_resourceLoadStatisticsDebugMode = enabled; >- if (m_resourceLoadStatistics) { >- m_resourceLoadStatistics->setResourceLoadStatisticsDebugMode(enabled, WTFMove(completionHandler)); >- return; >- } >- >+ > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) >@@ -2360,25 +1995,6 @@ void WebsiteDataStore::setResourceLoadStatisticsDebugMode(bool enabled, Completi > } > > #if ENABLE(RESOURCE_LOAD_STATISTICS) >-void WebsiteDataStore::unregisterWebResourceLoadStatisticsStoreAsMessageReceiver() >-{ >- if (!m_resourceLoadStatistics) >- return; >- >- for (auto* webProcessProxy : processes()) >- webProcessProxy->removeMessageReceiver(Messages::WebResourceLoadStatisticsStore::messageReceiverName()); >-} >- >-void WebsiteDataStore::registerWebResourceLoadStatisticsStoreAsMessageReceiver() >-{ >- ASSERT(m_resourceLoadStatistics); >- if (!m_resourceLoadStatistics) >- return; >- >- for (auto* webProcessProxy : processes()) >- webProcessProxy->addMessageReceiver(Messages::WebResourceLoadStatisticsStore::messageReceiverName(), *m_resourceLoadStatistics); >-} >- > void WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback(Function<void (const String&)>&& callback) > { > ASSERT(!m_sessionID.isEphemeral()); >@@ -2481,10 +2097,6 @@ void WebsiteDataStore::setMockWebAuthenticationConfiguration(MockWebAuthenticati > > void WebsiteDataStore::didCreateNetworkProcess() > { >-#if ENABLE(RESOURCE_LOAD_STATISTICS) >- if (m_resourceLoadStatistics) >- m_resourceLoadStatistics->didCreateNetworkProcess(); >-#endif > } > > } >diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h >index e528f6dd36c871643d7f2ab01f3f23105e2cf172..a2c59273f2e74a014a57a0edde3811774041cb0b 100644 >--- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h >+++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h >@@ -118,36 +118,25 @@ public: > > #if ENABLE(RESOURCE_LOAD_STATISTICS) > void fetchDataForTopPrivatelyControlledDomains(OptionSet<WebsiteDataType>, OptionSet<WebsiteDataFetchOption>, const Vector<String>& topPrivatelyControlledDomains, Function<void(Vector<WebsiteDataRecord>&&, HashSet<String>&&)>&& completionHandler); >- void topPrivatelyControlledDomainsWithWebsiteData(OptionSet<WebsiteDataType> dataTypes, OptionSet<WebsiteDataFetchOption> fetchOptions, Function<void(HashSet<String>&&)>&& completionHandler); >- void removeDataForTopPrivatelyControlledDomains(OptionSet<WebsiteDataType>, OptionSet<WebsiteDataFetchOption>, const Vector<String>& topPrivatelyControlledDomains, Function<void(HashSet<String>&&)>&& completionHandler); > > void clearPrevalentResource(const URL&, CompletionHandler<void()>&&); > void clearUserInteraction(const URL&, CompletionHandler<void()>&&); >- void deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores(OptionSet<WebsiteDataType>, Vector<String>&& topPrivatelyControlledDomains, bool shouldNotifyPages, CompletionHandler<void(const HashSet<String>&)>&&); > void dumpResourceLoadStatistics(CompletionHandler<void(const String&)>&&); > void logTestingEvent(const String&); > void logUserInteraction(const URL&, CompletionHandler<void()>&&); >- void updatePrevalentDomainsToBlockCookiesFor(const Vector<String>& domainsToBlock, CompletionHandler<void()>&&); >- void setAgeCapForClientSideCookies(Optional<Seconds>, CompletionHandler<void()>&&); >- void hasStorageAccessForFrameHandler(const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID, CompletionHandler<void(bool hasAccess)>&&); > void getAllStorageAccessEntries(uint64_t pageID, CompletionHandler<void(Vector<String>&& domains)>&&); >- void grantStorageAccessHandler(const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, CompletionHandler<void(bool wasGranted)>&&); > void hasHadUserInteraction(const URL&, CompletionHandler<void(bool)>&&); >- void isGrandfathered(const URL&, CompletionHandler<void(bool)>&&); > void isPrevalentResource(const URL&, CompletionHandler<void(bool)>&&); > void isRegisteredAsRedirectingTo(const URL& hostRedirectedFrom, const URL& hostRedirectedTo, CompletionHandler<void(bool)>&&); > void isRegisteredAsSubresourceUnder(const URL& subresource, const URL& topFrame, CompletionHandler<void(bool)>&&); > void isRegisteredAsSubFrameUnder(const URL& subFrame, const URL& topFrame, CompletionHandler<void(bool)>&&); > void isVeryPrevalentResource(const URL&, CompletionHandler<void(bool)>&&); >- void removeAllStorageAccessHandler(CompletionHandler<void()>&&); >- void removePrevalentDomains(const Vector<String>& domains); > void resetParametersToDefaultValues(CompletionHandler<void()>&&); > void scheduleCookieBlockingUpdate(CompletionHandler<void()>&&); > void scheduleClearInMemoryAndPersistent(WallTime modifiedSince, ShouldGrandfatherStatistics, CompletionHandler<void()>&&); > void scheduleClearInMemoryAndPersistent(ShouldGrandfatherStatistics, CompletionHandler<void()>&&); > void scheduleStatisticsAndDataRecordsProcessing(CompletionHandler<void()>&&); > void submitTelemetry(); >- void setCacheMaxAgeCap(Seconds, CompletionHandler<void()>&&); > void setGrandfathered(const URL&, bool, CompletionHandler<void()>&&); > void setGrandfatheringTime(Seconds, CompletionHandler<void()>&&); > void setLastSeen(const URL&, Seconds, CompletionHandler<void()>&&); >@@ -255,11 +244,6 @@ private: > void platformDestroy(); > static void platformRemoveRecentSearches(WallTime); > >-#if ENABLE(RESOURCE_LOAD_STATISTICS) >- void registerWebResourceLoadStatisticsStoreAsMessageReceiver(); >- void unregisterWebResourceLoadStatisticsStoreAsMessageReceiver(); >-#endif >- > HashSet<RefPtr<WebProcessPool>> processPools(size_t count = std::numeric_limits<size_t>::max(), bool ensureAPoolExists = true) const; > > #if ENABLE(NETSCAPE_PLUGIN_API)
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
Flags:
cdumez
:
review+
cdumez
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193303
: 360229