Diff
Modified: trunk/Source/WebKit/ChangeLog (240585 => 240586)
--- trunk/Source/WebKit/ChangeLog 2019-01-28 17:23:17 UTC (rev 240585)
+++ trunk/Source/WebKit/ChangeLog 2019-01-28 17:29:44 UTC (rev 240586)
@@ -1,3 +1,92 @@
+2019-01-28 Brent Fulgham <bfulg...@apple.com>
+
+ Remove the UIProcess components of the ResourceLoadStatistics code
+ https://bugs.webkit.org/show_bug.cgi?id=193303
+ <rdar://problem/47160073>
+
+ Reviewed by Chris Dumez.
+
+ 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-28 Antoine Quint <grao...@apple.com>
Limit user-agent interactions based on the touch-action property on iOS
Modified: trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp (240585 => 240586)
--- trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp 2019-01-28 17:23:17 UTC (rev 240585)
+++ trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp 2019-01-28 17:29:44 UTC (rev 240586)
@@ -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 @@
#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);
});
Modified: trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp (240585 => 240586)
--- trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp 2019-01-28 17:23:17 UTC (rev 240585)
+++ trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp 2019-01-28 17:29:44 UTC (rev 240586)
@@ -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 @@
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::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 @@
{
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 @@
{
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 @@
{
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::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::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::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::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::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::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::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::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::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::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::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::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::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::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::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::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::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::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::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::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 @@
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 @@
{
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 @@
{
ASSERT(RunLoop::isMain());
- if (m_websiteDataStore)
- m_websiteDataStore->removePrevalentDomains(domains);
removePrevalentDomains(domains);
}
@@ -1197,11 +924,6 @@
{
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 @@
{
ASSERT(RunLoop::isMain());
- if (m_websiteDataStore)
- WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed();
-
if (m_networkSession)
m_networkSession->notifyResourceLoadStatisticsProcessed();
}
@@ -1221,11 +940,6 @@
{
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 @@
{
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,11 +962,6 @@
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);
}
@@ -1264,14 +968,6 @@
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);
}
Modified: trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h (240585 => 240586)
--- trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h 2019-01-28 17:23:17 UTC (rev 240585)
+++ trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h 2019-01-28 17:29:44 UTC (rev 240586)
@@ -55,16 +55,10 @@
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 @@
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 @@
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,7 +147,6 @@
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;
@@ -181,7 +153,6 @@
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 @@
void flushAndDestroyPersistentStore();
- WeakPtr<WebsiteDataStore> m_websiteDataStore;
WeakPtr<NetworkSession> m_networkSession;
Ref<WorkQueue> m_statisticsQueue;
std::unique_ptr<ResourceLoadStatisticsMemoryStore> m_memoryStore;
Modified: trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp (240585 => 240586)
--- trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp 2019-01-28 17:23:17 UTC (rev 240585)
+++ trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp 2019-01-28 17:29:44 UTC (rev 240586)
@@ -285,134 +285,6 @@
}
#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())
Modified: trunk/Source/WebKit/UIProcess/WebProcessProxy.h (240585 => 240586)
--- trunk/Source/WebKit/UIProcess/WebProcessProxy.h 2019-01-28 17:23:17 UTC (rev 240585)
+++ trunk/Source/WebKit/UIProcess/WebProcessProxy.h 2019-01-28 17:29:44 UTC (rev 240586)
@@ -173,9 +173,6 @@
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);
Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp (240585 => 240586)
--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp 2019-01-28 17:23:17 UTC (rev 240585)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp 2019-01-28 17:29:44 UTC (rev 240586)
@@ -142,10 +142,6 @@
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);
@@ -649,20 +645,6 @@
});
});
}
-
-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)
@@ -949,19 +931,7 @@
#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();
@@ -1253,52 +1223,15 @@
}
#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())
@@ -1309,11 +1242,6 @@
{
ASSERT(RunLoop::isMain());
- if (m_resourceLoadStatistics) {
- m_resourceLoadStatistics->setPruneEntriesDownTo(pruneTargetCount, WTFMove(completionHandler));
- return;
- }
-
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
for (auto& processPool : processPools()) {
@@ -1325,11 +1253,6 @@
{
ASSERT(RunLoop::isMain());
- if (m_resourceLoadStatistics) {
- m_resourceLoadStatistics->setGrandfatheringTime(seconds, WTFMove(completionHandler));
- return;
- }
-
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
for (auto& processPool : processPools())
@@ -1336,31 +1259,10 @@
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())
@@ -1371,11 +1273,6 @@
{
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));
@@ -1394,11 +1291,6 @@
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));
@@ -1417,11 +1309,6 @@
return;
}
- if (m_resourceLoadStatistics) {
- m_resourceLoadStatistics->setPrevalentResource(url, WTFMove(completionHandler));
- return;
- }
-
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
for (auto& processPool : processPools()) {
@@ -1438,11 +1325,6 @@
return;
}
- if (m_resourceLoadStatistics) {
- m_resourceLoadStatistics->setPrevalentResourceForDebugMode(url, WTFMove(completionHandler));
- return;
- }
-
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
for (auto& processPool : processPools()) {
@@ -1460,11 +1342,6 @@
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));
@@ -1483,11 +1360,6 @@
return;
}
- if (m_resourceLoadStatistics) {
- m_resourceLoadStatistics->setVeryPrevalentResource(url, WTFMove(completionHandler));
- return;
- }
-
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
for (auto& processPool : processPools()) {
@@ -1500,11 +1372,6 @@
{
ASSERT(RunLoop::isMain());
- if (m_resourceLoadStatistics) {
- m_resourceLoadStatistics->setShouldClassifyResourcesBeforeDataRecordsRemoval(value, WTFMove(completionHandler));
- return;
- }
-
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
for (auto& processPool : processPools())
@@ -1520,11 +1387,6 @@
return;
}
- if (m_resourceLoadStatistics) {
- m_resourceLoadStatistics->setSubframeUnderTopFrameOrigin(subframe, topFrame, WTFMove(completionHandler));
- return;
- }
-
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
for (auto& processPool : processPools()) {
@@ -1537,11 +1399,6 @@
{
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));
@@ -1560,11 +1417,6 @@
return;
}
- if (m_resourceLoadStatistics) {
- m_resourceLoadStatistics->setSubresourceUnderTopFrameOrigin(subresource, topFrame, WTFMove(completionHandler));
- return;
- }
-
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
for (auto& processPool : processPools()) {
@@ -1577,11 +1429,6 @@
{
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));
@@ -1600,11 +1447,6 @@
return;
}
- if (m_resourceLoadStatistics) {
- m_resourceLoadStatistics->setSubresourceUniqueRedirectTo(subresource, hostNameRedirectedTo, WTFMove(completionHandler));
- return;
- }
-
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
for (auto& processPool : processPools()) {
@@ -1622,11 +1464,6 @@
return;
}
- if (m_resourceLoadStatistics) {
- m_resourceLoadStatistics->setSubresourceUniqueRedirectFrom(subresource, hostNameRedirectedFrom, WTFMove(completionHandler));
- return;
- }
-
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
for (auto& processPool : processPools()) {
@@ -1644,11 +1481,6 @@
return;
}
- if (m_resourceLoadStatistics) {
- m_resourceLoadStatistics->setTopFrameUniqueRedirectTo(topFrameHostName, hostNameRedirectedTo, WTFMove(completionHandler));
- return;
- }
-
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
for (auto& processPool : processPools()) {
@@ -1666,11 +1498,6 @@
return;
}
- if (m_resourceLoadStatistics) {
- m_resourceLoadStatistics->setTopFrameUniqueRedirectFrom(topFrameHostName, hostNameRedirectedFrom, WTFMove(completionHandler));
- return;
- }
-
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
for (auto& processPool : processPools()) {
@@ -1683,11 +1510,6 @@
{
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));
@@ -1706,11 +1528,6 @@
return;
}
- if (m_resourceLoadStatistics) {
- m_resourceLoadStatistics->clearPrevalentResource(url, WTFMove(completionHandler));
- return;
- }
-
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
const auto& primaryDomain = WebCore::ResourceLoadStatistics::primaryDomain(url);
@@ -1724,11 +1541,6 @@
{
ASSERT(RunLoop::isMain());
- if (m_resourceLoadStatistics) {
- m_resourceLoadStatistics->resetParametersToDefaultValues(WTFMove(completionHandler));
- return;
- }
-
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
for (auto& processPool : processPools()) {
@@ -1741,11 +1553,6 @@
{
ASSERT(RunLoop::isMain());
- if (m_resourceLoadStatistics) {
- m_resourceLoadStatistics->submitTelemetry([] { });
- return;
- }
-
for (auto& processPool : processPools()) {
if (auto* process = processPool->networkProcess())
process->submitTelemetry(m_sessionID, [] { });
@@ -1756,11 +1563,6 @@
{
ASSERT(RunLoop::isMain());
- if (m_resourceLoadStatistics) {
- m_resourceLoadStatistics->scheduleClearInMemoryAndPersistent(modifiedSince, shouldGrandfather, WTFMove(completionHandler));
- return;
- }
-
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
for (auto& processPool : processPools()) {
@@ -1773,11 +1575,6 @@
{
ASSERT(RunLoop::isMain());
- if (m_resourceLoadStatistics) {
- m_resourceLoadStatistics->scheduleClearInMemoryAndPersistent(shouldGrandfather, WTFMove(completionHandler));
- return;
- }
-
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
for (auto& processPool : processPools()) {
@@ -1788,11 +1585,6 @@
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()) {
@@ -1805,11 +1597,6 @@
{
ASSERT(RunLoop::isMain());
- if (m_resourceLoadStatistics) {
- m_resourceLoadStatistics->scheduleStatisticsAndDataRecordsProcessing(WTFMove(completionHandler));
- return;
- }
-
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
for (auto& processPool : processPools()) {
@@ -1818,26 +1605,6 @@
}
}
-#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()) {
@@ -1845,11 +1612,6 @@
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);
@@ -1861,11 +1623,6 @@
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())
@@ -1874,11 +1631,6 @@
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())
@@ -1885,18 +1637,6 @@
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);
@@ -1909,34 +1649,6 @@
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()) {
@@ -1944,11 +1656,6 @@
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);
@@ -1966,11 +1673,6 @@
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);
@@ -1988,11 +1690,6 @@
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);
@@ -2005,11 +1702,6 @@
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())
@@ -2025,11 +1717,6 @@
return;
}
- if (m_resourceLoadStatistics) {
- m_resourceLoadStatistics->logUserInteraction(url, WTFMove(completionHandler));
- return;
- }
-
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
for (auto& processPool : processPools()) {
@@ -2047,11 +1734,6 @@
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));
@@ -2070,11 +1752,6 @@
return;
}
- if (m_resourceLoadStatistics) {
- m_resourceLoadStatistics->clearUserInteraction(url, WTFMove(completionHandler));
- return;
- }
-
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
for (auto& processPool : processPools()) {
@@ -2083,29 +1760,6 @@
}
}
-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());
@@ -2115,11 +1769,6 @@
return;
}
- if (m_resourceLoadStatistics) {
- m_resourceLoadStatistics->setGrandfathered(url, isGrandfathered, WTFMove(completionHandler));
- return;
- }
-
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
for (auto& processPool : processPools()) {
@@ -2172,11 +1821,6 @@
{
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)
@@ -2193,11 +1837,6 @@
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);
}
@@ -2354,11 +1993,7 @@
{
#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())
@@ -2370,25 +2005,6 @@
}
#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());
@@ -2491,10 +2107,6 @@
void WebsiteDataStore::didCreateNetworkProcess()
{
-#if ENABLE(RESOURCE_LOAD_STATISTICS)
- if (m_resourceLoadStatistics)
- m_resourceLoadStatistics->didCreateNetworkProcess();
-#endif
}
}
Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h (240585 => 240586)
--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h 2019-01-28 17:23:17 UTC (rev 240585)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h 2019-01-28 17:29:44 UTC (rev 240586)
@@ -119,29 +119,19 @@
#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()>&&);
@@ -148,7 +138,6 @@
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()>&&);
@@ -260,11 +249,6 @@
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)