WebKit Bugzilla
Attachment 359844 Details for
Bug 193659
: Switch NetworkStorageSession portions of ResourceLoadStatistics to Async message passing style
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193659-20190122202548.patch (text/plain), 91.68 KB, created by
Brent Fulgham
on 2019-01-22 20:25:49 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Brent Fulgham
Created:
2019-01-22 20:25:49 PST
Size:
91.68 KB
patch
obsolete
>Subversion Revision: 240318 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index ad3bd102453dfda6b6c59b2e4e2ab76c16b4aff2..1cfb61e19f9f62bc73422d1fab68d3b10750fb13 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,96 @@ >+2019-01-22 Brent Fulgham <bfulgham@apple.com> >+ >+ Switch NetworkStorageSession portions of ResourceLoadStatistics to Async message passing style >+ https://bugs.webkit.org/show_bug.cgi?id=193659 >+ <rdar://problem/47433290> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Change the implementations of ResourceLoadStatistics code in NetworkStorageSession to use the >+ 'sendWithAsyncReply' so that more of the code is autogenerated. This should make test runs more >+ consistent, and should reduce the possibility of bookkeeping errors in the message handling >+ implementations. >+ >+ Fix the implementation of NetworkProcessProxy::clearCallbackStates to remove the manually constructed >+ (and incomplete) message callbacks. These errors are a big reason to move to the auto-generated >+ 'sendWithAsyncReply' implementatoin. Ditto for NetworkProcessProxy::didClose. >+ >+ This patch also moves an initializaton call (WebsiteDataStore::didCreateNetworkProcess) from >+ 'ensureNetworkProcess' to 'processDidFinishLaunching'. In current code, the call happens before >+ a connection is established to the network process, causing initialization messages to get dropped >+ leading to test system flakiness. >+ >+ * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: >+ * NetworkProcess/Classifier/ShouldGrandfatherStatistics.h: Added. >+ * NetworkProcess/Classifier/StorageAccessStatus.h: Added. >+ * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: >+ (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): >+ * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: >+ * NetworkProcess/NetworkProcess.cpp: >+ (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor): >+ (WebKit::NetworkProcess::setAgeCapForClientSideCookies): >+ (WebKit::NetworkProcess::scheduleClearInMemoryAndPersistent): >+ (WebKit::NetworkProcess::hasStorageAccessForFrame): >+ (WebKit::NetworkProcess::requestStorageAccess): >+ (WebKit::NetworkProcess::grantStorageAccess): >+ (WebKit::NetworkProcess::removeAllStorageAccess): >+ (WebKit::NetworkProcess::setCacheMaxAgeCapForPrevalentResources): >+ (WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources): >+ (WebKit::NetworkProcess::deleteWebsiteData): >+ * NetworkProcess/NetworkProcess.h: >+ * NetworkProcess/NetworkProcess.messages.in: >+ * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: >+ (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore): >+ (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours): >+ (WKWebsiteDataStoreStatisticsResetToConsistentState): >+ * UIProcess/Network/NetworkProcessProxy.cpp: >+ (WebKit::NetworkProcessProxy::clearCallbackStates): Remove incomplete clean-up code that >+ is now autogenerated. >+ (WebKit::NetworkProcessProxy::didClose): Ditto. >+ (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor): >+ (WebKit::NetworkProcessProxy::scheduleClearInMemoryAndPersistent): >+ (WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies): >+ (WebKit::NetworkProcessProxy::hasStorageAccessForFrame): >+ (WebKit::NetworkProcessProxy::requestStorageAccess): >+ (WebKit::NetworkProcessProxy::grantStorageAccess): >+ (WebKit::NetworkProcessProxy::removeAllStorageAccess): >+ (WebKit::NetworkProcessProxy::setCacheMaxAgeCapForPrevalentResources): >+ (WebKit::NetworkProcessProxy::setCacheMaxAgeCap): >+ (WebKit::NetworkProcessProxy::resetCacheMaxAgeCapForPrevalentResources): >+ (WebKit::NetworkProcessProxy::didUpdateBlockCookies): Deleted. >+ (WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies): Deleted. >+ (WebKit::NetworkProcessProxy::didUpdateRuntimeSettings): Deleted. >+ (WebKit::NetworkProcessProxy::storageAccessRequestResult): Deleted. >+ (WebKit::NetworkProcessProxy::storageAccessOperationResult): Deleted. >+ (WebKit::NetworkProcessProxy::didRemoveAllStorageAccess): Deleted. >+ (WebKit::NetworkProcessProxy::didSetCacheMaxAgeCapForPrevalentResources): Deleted. >+ * UIProcess/Network/NetworkProcessProxy.h: >+ * UIProcess/Network/NetworkProcessProxy.messages.in: >+ * UIProcess/WebPageProxy.cpp: >+ * UIProcess/WebProcessPool.cpp: >+ (WebKit::WebProcessPool::ensureNetworkProcess): Move WebsiteDataStore 'didCreateNetworkProcess' >+ to 'processDidFinishLaunching'. Currently the call happens before a connection is established, >+ causing initialization messages to get dropped. >+ (WebKit::WebProcessPool::processDidFinishLaunching): Ditto. >+ * UIProcess/WebsiteData/WebsiteDataStore.cpp: >+ (WebKit::WebsiteDataStore::removeData): >+ (WebKit::WebsiteDataStore::setMaxStatisticsEntries): >+ (WebKit::WebsiteDataStore::setPruneEntriesDownTo): >+ (WebKit::WebsiteDataStore::setGrandfatheringTime): >+ (WebKit::WebsiteDataStore::setCacheMaxAgeCap): >+ (WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval): >+ (WebKit::WebsiteDataStore::setPrevalentResource): >+ (WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval): >+ (WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent): >+ (WebKit::WebsiteDataStore::setAgeCapForClientSideCookies): >+ (WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned): >+ (WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured): >+ (WebKit::WebsiteDataStore::setTimeToLiveUserInteraction): >+ (WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources): >+ (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode): >+ * UIProcess/WebsiteData/WebsiteDataStore.h: >+ * WebKit.xcodeproj/project.pbxproj: >+ > 2019-01-22 Michael Catanzaro <mcatanzaro@igalia.com> > > Unreviewed attempt to fix GTK/WPE bots >diff --git a/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp b/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp >index 7685b6e33c62f1b8e94d3865719bf15cbba7f0d6..9744d48345c1853f8ac605371814c7abe352ea47 100644 >--- a/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp >+++ b/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp >@@ -33,6 +33,7 @@ > #include "PluginProcessManager.h" > #include "PluginProcessProxy.h" > #include "ResourceLoadStatisticsPersistentStorage.h" >+#include "StorageAccessStatus.h" > #include "WebProcessProxy.h" > #include "WebResourceLoadStatisticsTelemetry.h" > #include "WebsiteDataStore.h" >diff --git a/Source/WebKit/NetworkProcess/Classifier/ShouldGrandfatherStatistics.h b/Source/WebKit/NetworkProcess/Classifier/ShouldGrandfatherStatistics.h >new file mode 100644 >index 0000000000000000000000000000000000000000..105c27de04480f412abfbcff83a709870ab4d4e6 >--- /dev/null >+++ b/Source/WebKit/NetworkProcess/Classifier/ShouldGrandfatherStatistics.h >@@ -0,0 +1,50 @@ >+/* >+ * Copyright (C) 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 >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+namespace WebKit { >+ >+enum class ShouldGrandfatherStatistics : bool { >+ No, >+ Yes, >+}; >+ >+ >+} // namespace WebKit >+ >+namespace WTF { >+ >+template<> struct EnumTraits<WebKit::ShouldGrandfatherStatistics> { >+ using values = EnumValues< >+ WebKit::ShouldGrandfatherStatistics, >+ WebKit::ShouldGrandfatherStatistics::No, >+ WebKit::ShouldGrandfatherStatistics::Yes >+ >; >+}; >+ >+} // namespace WTF >+ >+ >diff --git a/Source/WebKit/NetworkProcess/Classifier/StorageAccessStatus.h b/Source/WebKit/NetworkProcess/Classifier/StorageAccessStatus.h >new file mode 100644 >index 0000000000000000000000000000000000000000..70b6a293362bfe43d13a453ac3160cfb73ec8a35 >--- /dev/null >+++ b/Source/WebKit/NetworkProcess/Classifier/StorageAccessStatus.h >@@ -0,0 +1,51 @@ >+/* >+ * Copyright (C) 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 >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+namespace WebKit { >+ >+enum class StorageAccessStatus : uint8_t { >+ CannotRequestAccess, >+ RequiresUserPrompt, >+ HasAccess >+}; >+ >+} // namespace WebKit >+ >+namespace WTF { >+ >+template<> struct EnumTraits<WebKit::StorageAccessStatus> { >+ using values = EnumValues< >+ WebKit::StorageAccessStatus, >+ WebKit::StorageAccessStatus::CannotRequestAccess, >+ WebKit::StorageAccessStatus::RequiresUserPrompt, >+ WebKit::StorageAccessStatus::HasAccess >+ >; >+}; >+ >+} // namespace WTF >+ >+ >diff --git a/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp b/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp >index 8e7735abf779ffdde8ea7502eba3d5e0c01690a8..e2c97540cc8d24d35d844902f28abba250a78066 100644 >--- a/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp >+++ b/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp >@@ -33,6 +33,8 @@ > #include "NetworkSession.h" > #include "ResourceLoadStatisticsMemoryStore.h" > #include "ResourceLoadStatisticsPersistentStorage.h" >+#include "ShouldGrandfatherStatistics.h" >+#include "StorageAccessStatus.h" > #include "WebFrameProxy.h" > #include "WebPageProxy.h" > #include "WebProcessMessages.h" >@@ -639,7 +641,7 @@ void WebResourceLoadStatisticsStore::setVeryPrevalentResource(const String& prim > }); > } > >-void WebResourceLoadStatisticsStore::dumpResourceLoadStatistics(CompletionHandler<void(const String&)>&& completionHandler) >+void WebResourceLoadStatisticsStore::dumpResourceLoadStatistics(CompletionHandler<void(String)>&& completionHandler) > { > ASSERT(RunLoop::isMain()); > >@@ -1010,7 +1012,7 @@ void WebResourceLoadStatisticsStore::scheduleClearBlockingStateForDomains(const > }); > } > >-void WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent(ShouldGrandfather shouldGrandfather, CompletionHandler<void()>&& completionHandler) >+void WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent(ShouldGrandfatherStatistics shouldGrandfather, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); > postTask([this, protectedThis = makeRef(*this), shouldGrandfather, completionHandler = WTFMove(completionHandler)]() mutable { >@@ -1023,7 +1025,7 @@ void WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent(ShouldGr > > if (m_memoryStore) { > m_memoryStore->clear([this, protectedThis = protectedThis.copyRef(), shouldGrandfather, completionHandlerCaller = WTFMove(completionHandlerCaller)] () mutable { >- if (shouldGrandfather == ShouldGrandfather::Yes) { >+ if (shouldGrandfather == ShouldGrandfatherStatistics::Yes) { > if (m_memoryStore) > m_memoryStore->grandfatherExistingWebsiteData(completionHandlerCaller.release()); > else >@@ -1031,13 +1033,13 @@ void WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent(ShouldGr > } > }); > } else { >- if (shouldGrandfather == ShouldGrandfather::Yes) >+ if (shouldGrandfather == ShouldGrandfatherStatistics::Yes) > RELEASE_LOG(ResourceLoadStatistics, "WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent Before being cleared, m_memoryStore is null when trying to grandfather data."); > } > }); > } > >-void WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent(WallTime modifiedSince, ShouldGrandfather shouldGrandfather, CompletionHandler<void()>&& callback) >+void WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent(WallTime modifiedSince, ShouldGrandfatherStatistics shouldGrandfather, CompletionHandler<void()>&& callback) > { > ASSERT(RunLoop::isMain()); > >diff --git a/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h b/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h >index 251b3925bab5ac402a8ce4d7f942e1026b46f76c..b60aaac890ef3037e2fac7f16b87ebd804dd84e4 100644 >--- a/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h >+++ b/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h >@@ -28,6 +28,7 @@ > #if ENABLE(RESOURCE_LOAD_STATISTICS) > > #include "Connection.h" >+#include "StorageAccessStatus.h" > #include "WebsiteDataType.h" > #include <wtf/CompletionHandler.h> > #include <wtf/RunLoop.h> >@@ -55,17 +56,7 @@ class ResourceLoadStatisticsPersistentStorage; > class WebFrameProxy; > class WebProcessProxy; > class WebsiteDataStore; >- >-enum class StorageAccessStatus : unsigned { >- CannotRequestAccess, >- RequiresUserPrompt, >- HasAccess >-}; >- >-enum class ShouldGrandfather { >- No, >- Yes, >-}; >+enum class ShouldGrandfatherStatistics : bool; > > class WebResourceLoadStatisticsStore final : public ThreadSafeRefCounted<WebResourceLoadStatisticsStore, WTF::DestructionThread::Main>, public IPC::MessageReceiver { > public: >@@ -116,7 +107,7 @@ public: > void setPrevalentResource(const String& resourceDomain, CompletionHandler<void()>&&); > void setVeryPrevalentResource(const URL&, CompletionHandler<void()>&&); > void setVeryPrevalentResource(const String& resourceDomain, CompletionHandler<void()>&&); >- void dumpResourceLoadStatistics(CompletionHandler<void(const String&)>&&); >+ 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)>&&); >@@ -155,8 +146,8 @@ public: > void scheduleStatisticsAndDataRecordsProcessing(CompletionHandler<void()>&&); > void submitTelemetry(CompletionHandler<void()>&&); > void updatePrevalentDomainsToBlockCookiesFor(const Vector<String>& domainsToBlock); >- void scheduleClearInMemoryAndPersistent(ShouldGrandfather, CompletionHandler<void()>&&); >- void scheduleClearInMemoryAndPersistent(WallTime modifiedSince, ShouldGrandfather, CompletionHandler<void()>&&); >+ void scheduleClearInMemoryAndPersistent(ShouldGrandfatherStatistics, CompletionHandler<void()>&&); >+ void scheduleClearInMemoryAndPersistent(WallTime modifiedSince, ShouldGrandfatherStatistics, CompletionHandler<void()>&&); > > void setTimeToLiveUserInteraction(Seconds, CompletionHandler<void()>&&); > void setMinimumTimeBetweenDataRecordsRemoval(Seconds, CompletionHandler<void()>&&); >diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.cpp b/Source/WebKit/NetworkProcess/NetworkProcess.cpp >index 607201129bff0726d5e45a53bc6fc131afbfcd42..d92f25325cf60ed9762f33f6eb064cf028ca5392 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcess.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkProcess.cpp >@@ -49,7 +49,9 @@ > #include "NetworkSessionCreationParameters.h" > #include "PreconnectTask.h" > #include "RemoteNetworkingContext.h" >+#include "ShouldGrandfatherStatistics.h" > #include "StatisticsData.h" >+#include "StorageAccessStatus.h" > #include "WebCookieManager.h" > #include "WebPageProxyMessages.h" > #include "WebProcessPoolMessages.h" >@@ -595,23 +597,20 @@ void NetworkProcess::writeBlobToFilePath(const URL& url, const String& path, San > } > > #if ENABLE(RESOURCE_LOAD_STATISTICS) >-void NetworkProcess::dumpResourceLoadStatistics(PAL::SessionID sessionID, uint64_t contextId) >+void NetworkProcess::dumpResourceLoadStatistics(PAL::SessionID sessionID, CompletionHandler<void(String)>&& completionHandler) > { > if (auto* networkSession = this->networkSession(sessionID)) { >- if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics()) { >- resourceLoadStatistics->dumpResourceLoadStatistics([this, contextId](const String& dumpedStatistics) { >- parentProcessConnection()->send(Messages::NetworkProcessProxy::DidDumpResourceLoadStatistics(dumpedStatistics, contextId), 0); >- }); >- } >+ if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics()) >+ resourceLoadStatistics->dumpResourceLoadStatistics(WTFMove(completionHandler)); > } else > ASSERT_NOT_REACHED(); > } > >-void NetworkProcess::updatePrevalentDomainsToBlockCookiesFor(PAL::SessionID sessionID, const Vector<String>& domainsToBlock, uint64_t contextId) >+void NetworkProcess::updatePrevalentDomainsToBlockCookiesFor(PAL::SessionID sessionID, const Vector<String>& domainsToBlock, CompletionHandler<void()>&& completionHandler) > { > if (auto* networkStorageSession = storageSession(sessionID)) > networkStorageSession->setPrevalentDomainsToBlockCookiesFor(domainsToBlock); >- parentProcessConnection()->send(Messages::NetworkProcessProxy::DidUpdateBlockCookies(contextId), 0); >+ completionHandler(); > } > > void NetworkProcess::isGrandfathered(PAL::SessionID sessionID, const String& targetPrimaryDomain, CompletionHandler<void(bool)>&& completionHandler) >@@ -641,11 +640,11 @@ void NetworkProcess::isVeryPrevalentResource(PAL::SessionID sessionID, const Str > ASSERT_NOT_REACHED(); > } > >-void NetworkProcess::setAgeCapForClientSideCookies(PAL::SessionID sessionID, Optional<Seconds> seconds, uint64_t contextId) >+void NetworkProcess::setAgeCapForClientSideCookies(PAL::SessionID sessionID, Optional<Seconds> seconds, CompletionHandler<void()>&& completionHandler) > { > if (auto* networkStorageSession = storageSession(sessionID)) > networkStorageSession->setAgeCapForClientSideCookies(seconds); >- parentProcessConnection()->send(Messages::NetworkProcessProxy::DidSetAgeCapForClientSideCookies(contextId), 0); >+ completionHandler(); > } > > void NetworkProcess::setGrandfathered(PAL::SessionID sessionID, const String& resourceDomain, bool isGrandfathered, CompletionHandler<void()>&& completionHandler) >@@ -711,15 +710,14 @@ void NetworkProcess::scheduleCookieBlockingUpdate(PAL::SessionID sessionID, Comp > ASSERT_NOT_REACHED(); > } > >-void NetworkProcess::scheduleClearInMemoryAndPersistent(PAL::SessionID sessionID, Optional<WallTime> modifiedSince, bool shouldGrandfather, CompletionHandler<void()>&& completionHandler) >+void NetworkProcess::scheduleClearInMemoryAndPersistent(PAL::SessionID sessionID, Optional<WallTime> modifiedSince, ShouldGrandfatherStatistics shouldGrandfather, CompletionHandler<void()>&& completionHandler) > { > if (auto* networkSession = this->networkSession(sessionID)) { > if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics()) { >- auto grandfather = shouldGrandfather ? ShouldGrandfather::Yes : ShouldGrandfather::No; > if (modifiedSince) >- resourceLoadStatistics->scheduleClearInMemoryAndPersistent(modifiedSince.value(), grandfather, WTFMove(completionHandler)); >+ resourceLoadStatistics->scheduleClearInMemoryAndPersistent(modifiedSince.value(), shouldGrandfather, WTFMove(completionHandler)); > else >- resourceLoadStatistics->scheduleClearInMemoryAndPersistent(grandfather, WTFMove(completionHandler)); >+ resourceLoadStatistics->scheduleClearInMemoryAndPersistent(shouldGrandfather, WTFMove(completionHandler)); > } > } else > ASSERT_NOT_REACHED(); >@@ -852,18 +850,21 @@ void NetworkProcess::setLastSeen(PAL::SessionID sessionID, const String& resourc > ASSERT_NOT_REACHED(); > } > >-void NetworkProcess::hasStorageAccessForFrame(PAL::SessionID sessionID, const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID, uint64_t contextId) >+void NetworkProcess::hasStorageAccessForFrame(PAL::SessionID sessionID, const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID, CompletionHandler<void(bool)>&& completionHandler) > { >+ bool hasStorageAccess = false; > if (auto* networkStorageSession = storageSession(sessionID)) >- parentProcessConnection()->send(Messages::NetworkProcessProxy::StorageAccessOperationResult(networkStorageSession->hasStorageAccess(resourceDomain, firstPartyDomain, frameID, pageID), contextId), 0); >+ hasStorageAccess = networkStorageSession->hasStorageAccess(resourceDomain, firstPartyDomain, frameID, pageID); > else > ASSERT_NOT_REACHED(); >+ >+ completionHandler(hasStorageAccess); > } > >-void NetworkProcess::getAllStorageAccessEntries(PAL::SessionID sessionID, uint64_t contextId) >+void NetworkProcess::getAllStorageAccessEntries(PAL::SessionID sessionID, CompletionHandler<void(Vector<String> domains)>&& completionHandler) > { > if (auto* networkStorageSession = storageSession(sessionID)) >- parentProcessConnection()->send(Messages::NetworkProcessProxy::AllStorageAccessEntriesResult(networkStorageSession->getAllStorageAccessEntries(), contextId), 0); >+ completionHandler(networkStorageSession->getAllStorageAccessEntries()); > else > ASSERT_NOT_REACHED(); > } >@@ -877,19 +878,16 @@ void NetworkProcess::hasStorageAccess(PAL::SessionID sessionID, const String& re > ASSERT_NOT_REACHED(); > } > >-void NetworkProcess::requestStorageAccess(PAL::SessionID sessionID, const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, bool promptEnabled, uint64_t contextId) >+void NetworkProcess::requestStorageAccess(PAL::SessionID sessionID, const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, bool promptEnabled, CompletionHandler<void(StorageAccessStatus)>&& completionHandler) > { > if (auto* networkSession = this->networkSession(sessionID)) { >- if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics()) { >- resourceLoadStatistics->requestStorageAccess(resourceDomain, firstPartyDomain, frameID, pageID, promptEnabled, [this, contextId](StorageAccessStatus promptAccepted) { >- parentProcessConnection()->send(Messages::NetworkProcessProxy::StorageAccessRequestResult(static_cast<unsigned>(promptAccepted), contextId), 0); >- }); >- } >+ if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics()) >+ resourceLoadStatistics->requestStorageAccess(resourceDomain, firstPartyDomain, frameID, pageID, promptEnabled, WTFMove(completionHandler)); > } else > ASSERT_NOT_REACHED(); > } > >-void NetworkProcess::grantStorageAccess(PAL::SessionID sessionID, const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, bool userWasPrompted, uint64_t contextId) >+void NetworkProcess::grantStorageAccess(PAL::SessionID sessionID, const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, bool userWasPrompted, CompletionHandler<void(bool)>&& completionHandler) > { > bool isStorageGranted = false; > if (auto* networkStorageSession = storageSession(sessionID)) { >@@ -899,7 +897,7 @@ void NetworkProcess::grantStorageAccess(PAL::SessionID sessionID, const String& > } else > ASSERT_NOT_REACHED(); > >- parentProcessConnection()->send(Messages::NetworkProcessProxy::StorageAccessOperationResult(isStorageGranted, contextId), 0); >+ completionHandler(isStorageGranted); > } > > void NetworkProcess::logFrameNavigation(PAL::SessionID sessionID, const String& targetPrimaryDomain, const String& mainFramePrimaryDomain, const String& sourcePrimaryDomain, const String& targetHost, const String& mainFrameHost, bool isRedirect, bool isMainFrame) >@@ -939,13 +937,13 @@ void NetworkProcess::clearUserInteraction(PAL::SessionID sessionID, const String > ASSERT_NOT_REACHED(); > } > >-void NetworkProcess::removeAllStorageAccess(PAL::SessionID sessionID, uint64_t contextId) >+void NetworkProcess::removeAllStorageAccess(PAL::SessionID sessionID, CompletionHandler<void()>&& completionHandler) > { > if (auto* networkStorageSession = storageSession(sessionID)) > networkStorageSession->removeAllStorageAccess(); > else > ASSERT_NOT_REACHED(); >- parentProcessConnection()->send(Messages::NetworkProcessProxy::DidRemoveAllStorageAccess(contextId), 0); >+ completionHandler(); > } > > void NetworkProcess::removePrevalentDomains(PAL::SessionID sessionID, const Vector<String>& domains) >@@ -954,13 +952,13 @@ void NetworkProcess::removePrevalentDomains(PAL::SessionID sessionID, const Vect > networkStorageSession->removePrevalentDomains(domains); > } > >-void NetworkProcess::setCacheMaxAgeCapForPrevalentResources(PAL::SessionID sessionID, Seconds seconds, uint64_t contextId) >+void NetworkProcess::setCacheMaxAgeCapForPrevalentResources(PAL::SessionID sessionID, Seconds seconds, CompletionHandler<void()>&& completionHandler) > { > if (auto* networkStorageSession = storageSession(sessionID)) > networkStorageSession->setCacheMaxAgeCapForPrevalentResources(Seconds { seconds }); > else > ASSERT_NOT_REACHED(); >- parentProcessConnection()->send(Messages::NetworkProcessProxy::DidSetCacheMaxAgeCapForPrevalentResources(contextId), 0); >+ completionHandler(); > } > > void NetworkProcess::setGrandfatheringTime(PAL::SessionID sessionID, Seconds seconds, CompletionHandler<void()>&& completionHandler) >@@ -1032,13 +1030,13 @@ void NetworkProcess::setResourceLoadStatisticsDebugMode(PAL::SessionID sessionID > ASSERT_NOT_REACHED(); > } > >-void NetworkProcess::resetCacheMaxAgeCapForPrevalentResources(PAL::SessionID sessionID, uint64_t contextId) >+void NetworkProcess::resetCacheMaxAgeCapForPrevalentResources(PAL::SessionID sessionID, CompletionHandler<void()>&& completionHandler) > { > if (auto* networkStorageSession = storageSession(sessionID)) > networkStorageSession->resetCacheMaxAgeCapForPrevalentResources(); > else > ASSERT_NOT_REACHED(); >- parentProcessConnection()->send(Messages::NetworkProcessProxy::DidUpdateRuntimeSettings(contextId), 0); >+ completionHandler(); > } > #endif // ENABLE(RESOURCE_LOAD_STATISTICS) > >@@ -1211,7 +1209,7 @@ void NetworkProcess::deleteWebsiteData(PAL::SessionID sessionID, OptionSet<Websi > > // 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) ? ShouldGrandfather::No : ShouldGrandfather::Yes; >+ auto shouldGrandfather = ((monitoredTypesRaw & deletedTypesRaw) == monitoredTypesRaw) ? ShouldGrandfatherStatistics::No : ShouldGrandfatherStatistics::Yes; > > resourceLoadStatistics->scheduleClearInMemoryAndPersistent(modifiedSince, shouldGrandfather, [clearTasksHandler = clearTasksHandler.copyRef()] { }); > } >diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.h b/Source/WebKit/NetworkProcess/NetworkProcess.h >index afbebbde179e9c32e08f9bbd004a7de691f9a585..6efad28d111a1fa21d4f06190af8a32acf0f8b55 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcess.h >+++ b/Source/WebKit/NetworkProcess/NetworkProcess.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2012-2018 Apple Inc. All rights reserved. >+ * Copyright (C) 2012-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 >@@ -81,6 +81,8 @@ class NetworkProcessSupplement; > class NetworkProximityManager; > class WebSWServerConnection; > class WebSWServerToContextConnection; >+enum class ShouldGrandfatherStatistics : bool; >+enum class StorageAccessStatus : uint8_t; > enum class WebsiteDataFetchOption; > enum class WebsiteDataType; > struct NetworkProcessCreationParameters; >@@ -176,12 +178,12 @@ public: > void clearPrevalentResource(PAL::SessionID, const String& resourceDomain, CompletionHandler<void()>&&); > void clearUserInteraction(PAL::SessionID, const String& resourceDomain, CompletionHandler<void()>&&); > void deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores(PAL::SessionID, OptionSet<WebsiteDataType>, Vector<String>&& topPrivatelyControlledDomains, bool shouldNotifyPage, CompletionHandler<void(const HashSet<String>&)>&&); >- void dumpResourceLoadStatistics(PAL::SessionID, uint64_t contextId); >- void updatePrevalentDomainsToBlockCookiesFor(PAL::SessionID, const Vector<String>& domainsToBlock, uint64_t contextId); >+ void dumpResourceLoadStatistics(PAL::SessionID, CompletionHandler<void(String)>&&); >+ void updatePrevalentDomainsToBlockCookiesFor(PAL::SessionID, const Vector<String>& domainsToBlock, CompletionHandler<void()>&&); > void isGrandfathered(PAL::SessionID, const String& targetPrimaryDomain, CompletionHandler<void(bool)>&&); > void isPrevalentResource(PAL::SessionID, const String& resourceDomain, CompletionHandler<void(bool)>&&); > void isVeryPrevalentResource(PAL::SessionID, const String& resourceDomain, CompletionHandler<void(bool)>&&); >- void setAgeCapForClientSideCookies(PAL::SessionID, Optional<Seconds>, uint64_t contextId); >+ void setAgeCapForClientSideCookies(PAL::SessionID, Optional<Seconds>, CompletionHandler<void()>&&); > void isRegisteredAsRedirectingTo(PAL::SessionID, const String& redirectedFrom, const String& redirectedTo, CompletionHandler<void(bool)>&&); > void isRegisteredAsSubFrameUnder(PAL::SessionID, const String& subframe, const String& topFrame, CompletionHandler<void(bool)>&&); > void isRegisteredAsSubresourceUnder(PAL::SessionID, const String& subresource, const String& topFrame, CompletionHandler<void(bool)>&&); >@@ -192,22 +194,22 @@ public: > void setVeryPrevalentResource(PAL::SessionID, const String& resourceDomain, CompletionHandler<void()>&&); > void setPruneEntriesDownTo(PAL::SessionID, uint64_t pruneTargetCount, CompletionHandler<void()>&&); > void hadUserInteraction(PAL::SessionID, const String& resourceDomain, CompletionHandler<void(bool)>&&); >- void hasStorageAccessForFrame(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID, uint64_t contextId); >- void getAllStorageAccessEntries(PAL::SessionID, uint64_t contextId); >- void grantStorageAccess(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, bool userWasPrompted, uint64_t contextId); >+ void hasStorageAccessForFrame(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID, CompletionHandler<void(bool)>&&); >+ void getAllStorageAccessEntries(PAL::SessionID, CompletionHandler<void(Vector<String> domains)>&&); >+ void grantStorageAccess(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, bool userWasPrompted, CompletionHandler<void(bool)>&&); > void hasStorageAccess(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, CompletionHandler<void(bool)>&&); > void logFrameNavigation(PAL::SessionID, const String& targetPrimaryDomain, const String& mainFramePrimaryDomain, const String& sourcePrimaryDomain, const String& targetHost, const String& mainFrameHost, bool isRedirect, bool isMainFrame); > void logUserInteraction(PAL::SessionID, const String& targetPrimaryDomain, CompletionHandler<void()>&&); >- void removeAllStorageAccess(PAL::SessionID, uint64_t contextId); >+ void removeAllStorageAccess(PAL::SessionID, CompletionHandler<void()>&&); > void removePrevalentDomains(PAL::SessionID, const Vector<String>& domains); >- void requestStorageAccess(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, bool promptEnabled, uint64_t contextId); >- void resetCacheMaxAgeCapForPrevalentResources(PAL::SessionID, uint64_t contextId); >+ void requestStorageAccess(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, bool promptEnabled, CompletionHandler<void(StorageAccessStatus)>&&); >+ void resetCacheMaxAgeCapForPrevalentResources(PAL::SessionID, CompletionHandler<void()>&&); > void resetParametersToDefaultValues(PAL::SessionID, CompletionHandler<void()>&&); >- void scheduleClearInMemoryAndPersistent(PAL::SessionID, Optional<WallTime> modifiedSince, bool shouldGrandfather, CompletionHandler<void()>&&); >+ void scheduleClearInMemoryAndPersistent(PAL::SessionID, Optional<WallTime> modifiedSince, ShouldGrandfatherStatistics, CompletionHandler<void()>&&); > void scheduleCookieBlockingUpdate(PAL::SessionID, CompletionHandler<void()>&&); > void scheduleStatisticsAndDataRecordsProcessing(PAL::SessionID, CompletionHandler<void()>&&); > void submitTelemetry(PAL::SessionID, CompletionHandler<void()>&&); >- void setCacheMaxAgeCapForPrevalentResources(PAL::SessionID, Seconds, uint64_t contextId); >+ void setCacheMaxAgeCapForPrevalentResources(PAL::SessionID, Seconds, CompletionHandler<void()>&&); > void setGrandfatheringTime(PAL::SessionID, Seconds, CompletionHandler<void()>&&); > void setLastSeen(PAL::SessionID, const String& resourceDomain, Seconds, CompletionHandler<void()>&&); > void setMinimumTimeBetweenDataRecordsRemoval(PAL::SessionID, Seconds, CompletionHandler<void()>&&); >diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.messages.in b/Source/WebKit/NetworkProcess/NetworkProcess.messages.in >index 62565812aae650a2a0e5544d7a4dca6c04db9643..5d2aa6d2cc01fffdac7aaa8935d6164117d4c063 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcess.messages.in >+++ b/Source/WebKit/NetworkProcess/NetworkProcess.messages.in >@@ -1,4 +1,4 @@ >-# Copyright (C) 2012-2017 Apple Inc. All rights reserved. >+# Copyright (C) 2012-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 >@@ -87,35 +87,35 @@ messages -> NetworkProcess LegacyReceiver { > #if ENABLE(RESOURCE_LOAD_STATISTICS) > ClearPrevalentResource(PAL::SessionID sessionID, String resourceDomain) -> () Async > ClearUserInteraction(PAL::SessionID sessionID, String resourceDomain) -> () Async >- DumpResourceLoadStatistics(PAL::SessionID sessionID, uint64_t contextId) >+ DumpResourceLoadStatistics(PAL::SessionID sessionID) -> (String dumpedStatistics) Async > SetResourceLoadStatisticsEnabled(bool enabled) >- UpdatePrevalentDomainsToBlockCookiesFor(PAL::SessionID sessionID, Vector<String> domainsToBlock, uint64_t contextId) >+ UpdatePrevalentDomainsToBlockCookiesFor(PAL::SessionID sessionID, Vector<String> domainsToBlock) -> () Async > IsGrandfathered(PAL::SessionID sessionID, String targetPrimaryDomain) -> (bool isGrandfathered) Async > IsPrevalentResource(PAL::SessionID sessionID, String targetPrimaryDomain) -> (bool isPrevalent) Async > IsVeryPrevalentResource(PAL::SessionID sessionID, String targetPrimaryDomain) -> (bool isVeryPrevalent) Async >- SetAgeCapForClientSideCookies(PAL::SessionID sessionID, Optional<Seconds> seconds, uint64_t contextId) >+ SetAgeCapForClientSideCookies(PAL::SessionID sessionID, Optional<Seconds> seconds) -> () Async > SetLastSeen(PAL::SessionID sessionID, String resourceDomain, Seconds seconds) -> () Async > SetPrevalentResource(PAL::SessionID sessionID, String resourceDomain) -> () Async > SetPrevalentResourceForDebugMode(PAL::SessionID sessionID, String resourceDomain) -> () Async > HadUserInteraction(PAL::SessionID sessionID, String resourceDomain) -> (bool hadUserInteraction) Async >- HasStorageAccessForFrame(PAL::SessionID sessionID, String resourceDomain, String firstPartyDomain, uint64_t frameID, uint64_t pageID, uint64_t contextId) >- HasStorageAccess(PAL::SessionID sessionID, String resourceDomain, String firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID) -> (bool hadUserInteraction) Async >- GetAllStorageAccessEntries(PAL::SessionID sessionID, uint64_t contextId) >- GrantStorageAccess(PAL::SessionID sessionID, String resourceDomain, String firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, bool userWasPrompted, uint64_t contextId) >+ HasStorageAccessForFrame(PAL::SessionID sessionID, String resourceDomain, String firstPartyDomain, uint64_t frameID, uint64_t pageID) -> (bool hasStorageAccess) Async >+ HasStorageAccess(PAL::SessionID sessionID, String resourceDomain, String firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID) -> (bool hasStorageAccess) Async >+ GetAllStorageAccessEntries(PAL::SessionID sessionID) -> (Vector<String> domains) Async >+ GrantStorageAccess(PAL::SessionID sessionID, String resourceDomain, String firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, bool userWasPrompted) -> (bool accessGranted) Async > IsRegisteredAsRedirectingTo(PAL::SessionID sessionID, String redirectedFrom, String redirectedTo) -> (bool isRedirectingTo) Async > IsRegisteredAsSubFrameUnder(PAL::SessionID sessionID, String subframe, String topFrame) -> (bool isSubframeUnder) Async > IsRegisteredAsSubresourceUnder(PAL::SessionID sessionID, String subresource, String topFrame) -> (bool isSubresourceUnder) Async > LogFrameNavigation(PAL::SessionID sessionID, String targetPrimaryDomain, String mainFramePrimaryDomain, String sourcePrimaryDomain, String targetHost, String mainFrameHost, bool isRedirect, bool isMainFrame) > LogUserInteraction(PAL::SessionID sessionID, String targetPrimaryDomain) -> () Async >- RemoveAllStorageAccess(PAL::SessionID sessionID, uint64_t contextId) >+ RemoveAllStorageAccess(PAL::SessionID sessionID) -> () Async > RemovePrevalentDomains(PAL::SessionID sessionID, Vector<String> domainsWithInteraction) >- RequestStorageAccess(PAL::SessionID sessionID, String resourceDomain, String firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, bool promptEnabled, uint64_t contextId) >+ RequestStorageAccess(PAL::SessionID sessionID, String resourceDomain, String firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, bool promptEnabled) -> (enum:uint8_t WebKit::StorageAccessStatus storageAccessStatus) Async > ResetParametersToDefaultValues(PAL::SessionID sessionID) -> () Async >- ScheduleClearInMemoryAndPersistent(PAL::SessionID sessionID, Optional<WallTime> modifiedSince, bool shouldGrandfather) -> () Async >+ ScheduleClearInMemoryAndPersistent(PAL::SessionID sessionID, Optional<WallTime> modifiedSince, enum:bool WebKit::ShouldGrandfatherStatistics shouldGrandfather) -> () Async > ScheduleCookieBlockingUpdate(PAL::SessionID sessionID) -> () Async > ScheduleStatisticsAndDataRecordsProcessing(PAL::SessionID sessionID) -> () Async > SubmitTelemetry(PAL::SessionID sessionID) -> () Async >- SetCacheMaxAgeCapForPrevalentResources(PAL::SessionID sessionID, Seconds seconds, uint64_t contextId) >+ SetCacheMaxAgeCapForPrevalentResources(PAL::SessionID sessionID, Seconds seconds) -> () Async > SetGrandfathered(PAL::SessionID sessionID, String resourceDomain, bool isGrandfathered) -> () Async > SetGrandfatheringTime(PAL::SessionID sessionID, Seconds seconds) -> () Async > SetMaxStatisticsEntries(PAL::SessionID sessionID, uint64_t maximumEntryCount) -> () Async >@@ -133,7 +133,7 @@ messages -> NetworkProcess LegacyReceiver { > SetTimeToLiveUserInteraction(PAL::SessionID sessionID, Seconds seconds) -> () Async > SetTopFrameUniqueRedirectTo(PAL::SessionID sessionID, String topFrameHostName, String hostNameRedirectedTo) -> () Async > SetTopFrameUniqueRedirectFrom(PAL::SessionID sessionID, String topFrameHostName, String hostNameRedirectedFrom) -> () Async >- ResetCacheMaxAgeCapForPrevalentResources(PAL::SessionID sessionID, uint64_t contextId) >+ ResetCacheMaxAgeCapForPrevalentResources(PAL::SessionID sessionID) -> () Async > #endif > > SetSessionIsControlledByAutomation(PAL::SessionID sessionID, bool controlled); >diff --git a/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp b/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp >index ba333c9f5fd35fd820eb855e0f525376be2f4c31..7a1411528f5e8543f495ad901e474f8ec8d4f1c0 100644 >--- a/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp >+++ b/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2015 Apple Inc. All rights reserved. >+ * Copyright (C) 2015-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 >@@ -29,6 +29,7 @@ > #include "APIArray.h" > #include "APIWebsiteDataStore.h" > #include "MockWebAuthenticationConfiguration.h" >+#include "ShouldGrandfatherStatistics.h" > #include "WKAPICast.h" > #include "WKDictionary.h" > #include "WKNumber.h" >@@ -378,7 +379,7 @@ void WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo(WKWebsiteDataStoreRef dat > void WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore(WKWebsiteDataStoreRef dataStoreRef, void* context, WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreFunction callback) > { > #if ENABLE(RESOURCE_LOAD_STATISTICS) >- WebKit::toImpl(dataStoreRef)->websiteDataStore().scheduleClearInMemoryAndPersistent(ShouldGrandfather::Yes, [context, callback]() { >+ WebKit::toImpl(dataStoreRef)->websiteDataStore().scheduleClearInMemoryAndPersistent(ShouldGrandfatherStatistics::Yes, [context, callback]() { > callback(context); > }); > #else >@@ -389,7 +390,7 @@ void WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore(WKWebsiteDataSt > void WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours(WKWebsiteDataStoreRef dataStoreRef, unsigned hours, void* context, WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHoursFunction callback) > { > #if ENABLE(RESOURCE_LOAD_STATISTICS) >- WebKit::toImpl(dataStoreRef)->websiteDataStore().scheduleClearInMemoryAndPersistent(WallTime::now() - Seconds::fromHours(hours), ShouldGrandfather::Yes, [context, callback]() { >+ WebKit::toImpl(dataStoreRef)->websiteDataStore().scheduleClearInMemoryAndPersistent(WallTime::now() - Seconds::fromHours(hours), ShouldGrandfatherStatistics::Yes, [context, callback]() { > callback(context); > }); > #endif >@@ -405,9 +406,11 @@ void WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval(WKWebsiteDataSto > > void WKWebsiteDataStoreSetStatisticsCacheMaxAgeCap(WKWebsiteDataStoreRef dataStoreRef, double seconds, void* context, WKWebsiteDataStoreSetStatisticsCacheMaxAgeCapFunction callback) > { >+#if ENABLE(RESOURCE_LOAD_STATISTICS) > WebKit::toImpl(dataStoreRef)->websiteDataStore().setCacheMaxAgeCapForPrevalentResources(Seconds { seconds }, [context, callback] { > callback(context); > }); >+#endif > } > > void WKWebsiteDataStoreStatisticsResetToConsistentState(WKWebsiteDataStoreRef dataStoreRef, void* context, WKWebsiteDataStoreStatisticsResetToConsistentStateFunction completionHandler) >@@ -421,7 +424,7 @@ void WKWebsiteDataStoreStatisticsResetToConsistentState(WKWebsiteDataStoreRef da > store.clearResourceLoadStatisticsInWebProcesses([callbackAggregator = callbackAggregator.copyRef()] { }); > store.resetCacheMaxAgeCapForPrevalentResources([callbackAggregator = callbackAggregator.copyRef()] { }); > store.resetParametersToDefaultValues([callbackAggregator = callbackAggregator.copyRef()] { }); >- store.scheduleClearInMemoryAndPersistent(ShouldGrandfather::No, [callbackAggregator = callbackAggregator.copyRef()] { }); >+ store.scheduleClearInMemoryAndPersistent(ShouldGrandfatherStatistics::No, [callbackAggregator = callbackAggregator.copyRef()] { }); > #else > UNUSED_PARAM(dataStoreRef); > completionHandler(context); >diff --git a/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp b/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp >index cb062f5c81c396ef75b1dd610d44946a010a14b6..acaa8b56850ad4de305cd6edb2c26bd42094fb70 100644 >--- a/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp >+++ b/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp >@@ -37,6 +37,8 @@ > #include "NetworkProcessCreationParameters.h" > #include "NetworkProcessMessages.h" > #include "SandboxExtension.h" >+#include "ShouldGrandfatherStatistics.h" >+#include "StorageAccessStatus.h" > #include "WebCompiledContentRuleList.h" > #include "WebPageProxy.h" > #include "WebProcessMessages.h" >@@ -234,26 +236,6 @@ void NetworkProcessProxy::clearCallbackStates() > > while (!m_pendingDeleteWebsiteDataForOriginsCallbacks.isEmpty()) > m_pendingDeleteWebsiteDataForOriginsCallbacks.take(m_pendingDeleteWebsiteDataForOriginsCallbacks.begin()->key)(); >- >-#if ENABLE(RESOURCE_LOAD_STATISTICS) >- while (!m_scheduleStatisticsProcessingCallbackMap.isEmpty()) >- m_scheduleStatisticsProcessingCallbackMap.take(m_scheduleStatisticsProcessingCallbackMap.begin()->key)(); >- >- while (!m_storageAccessResponseCallbackMap.isEmpty()) >- m_storageAccessResponseCallbackMap.take(m_storageAccessResponseCallbackMap.begin()->key)(false); >- >- while (!m_storageAccessRequestResponseCallbackMap.isEmpty()) >- m_storageAccessRequestResponseCallbackMap.take(m_storageAccessRequestResponseCallbackMap.begin()->key)(StorageAccessStatus::CannotRequestAccess); >- >- while (!m_removeAllStorageAccessCallbackMap.isEmpty()) >- m_removeAllStorageAccessCallbackMap.take(m_removeAllStorageAccessCallbackMap.begin()->key)(); >- >- while (!m_allStorageAccessEntriesCallbackMap.isEmpty()) >- m_allStorageAccessEntriesCallbackMap.take(m_allStorageAccessEntriesCallbackMap.begin()->key)({ }); >- >- while (!m_dumpStatisticsCallbackMap.isEmpty()) >- m_dumpStatisticsCallbackMap.take(m_dumpStatisticsCallbackMap.begin()->key)({ }); >-#endif > } > > void NetworkProcessProxy::didReceiveMessage(IPC::Connection& connection, IPC::Decoder& decoder) >@@ -290,16 +272,6 @@ void NetworkProcessProxy::didClose(IPC::Connection&) > m_syncAllCookiesToken = nullptr; > m_syncAllCookiesCounter = 0; > >-#if ENABLE(RESOURCE_LOAD_STATISTICS) >- for (auto& callback : m_removeAllStorageAccessCallbackMap.values()) >- callback(); >- m_removeAllStorageAccessCallbackMap.clear(); >- >- for (auto& callback : m_scheduleStatisticsProcessingCallbackMap.values()) >- callback(); >- m_scheduleStatisticsProcessingCallbackMap.clear(); >-#endif >- > // This will cause us to be deleted. > networkProcessCrashed(); > } >@@ -425,24 +397,14 @@ void NetworkProcessProxy::logGlobalDiagnosticMessageWithValue(const String& mess > } > > #if ENABLE(RESOURCE_LOAD_STATISTICS) >-void NetworkProcessProxy::dumpResourceLoadStatistics(PAL::SessionID sessionID, CompletionHandler<void(const String&)>&& completionHandler) >+void NetworkProcessProxy::dumpResourceLoadStatistics(PAL::SessionID sessionID, CompletionHandler<void(String)>&& completionHandler) > { > if (!canSendMessage()) { > completionHandler({ }); > return; > } > >- auto callbackId = generateCallbackID(); >- auto addResult = m_dumpStatisticsCallbackMap.add(callbackId, [protectedProcessPool = makeRef(m_processPool), token = throttler().backgroundActivityToken(), completionHandler = WTFMove(completionHandler)](const String& dumpedStatistics) mutable { >- completionHandler(dumpedStatistics); >- }); >- ASSERT_UNUSED(addResult, addResult.isNewEntry); >- send(Messages::NetworkProcess::DumpResourceLoadStatistics(sessionID, callbackId), 0); >-} >- >-void NetworkProcessProxy::didDumpResourceLoadStatistics(String dumpedStatistics, uint64_t callbackId) >-{ >- m_dumpStatisticsCallbackMap.take(callbackId)(dumpedStatistics); >+ sendWithAsyncReply(Messages::NetworkProcess::DumpResourceLoadStatistics(sessionID), WTFMove(completionHandler)); > } > > void NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor(PAL::SessionID sessionID, const Vector<String>& domainsToBlock, CompletionHandler<void()>&& completionHandler) >@@ -451,18 +413,8 @@ void NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor(PAL::SessionID > completionHandler(); > return; > } >- >- auto callbackId = generateCallbackID(); >- auto addResult = m_scheduleStatisticsProcessingCallbackMap.add(callbackId, [protectedProcessPool = makeRef(m_processPool), token = throttler().backgroundActivityToken(), completionHandler = WTFMove(completionHandler)]() mutable { >- completionHandler(); >- }); >- ASSERT_UNUSED(addResult, addResult.isNewEntry); >- send(Messages::NetworkProcess::UpdatePrevalentDomainsToBlockCookiesFor(sessionID, domainsToBlock, callbackId), 0); >-} > >-void NetworkProcessProxy::didUpdateBlockCookies(uint64_t callbackId) >-{ >- m_scheduleStatisticsProcessingCallbackMap.take(callbackId)(); >+ sendWithAsyncReply(Messages::NetworkProcess::UpdatePrevalentDomainsToBlockCookiesFor(sessionID, domainsToBlock), WTFMove(completionHandler)); > } > > void NetworkProcessProxy::isPrevalentResource(PAL::SessionID sessionID, const String& resourceDomain, CompletionHandler<void(bool)>&& completionHandler) >@@ -545,15 +497,14 @@ void NetworkProcessProxy::scheduleCookieBlockingUpdate(PAL::SessionID sessionID, > sendWithAsyncReply(Messages::NetworkProcess::ScheduleCookieBlockingUpdate(sessionID), WTFMove(completionHandler)); > } > >-void NetworkProcessProxy::scheduleClearInMemoryAndPersistent(PAL::SessionID sessionID, Optional<WallTime> modifiedSince, ShouldGrandfather shouldGrandfather, CompletionHandler<void()>&& completionHandler) >+void NetworkProcessProxy::scheduleClearInMemoryAndPersistent(PAL::SessionID sessionID, Optional<WallTime> modifiedSince, ShouldGrandfatherStatistics shouldGrandfather, CompletionHandler<void()>&& completionHandler) > { > if (!canSendMessage()) { > completionHandler(); > return; > } > >- bool shouldGrandfatherBool = shouldGrandfather == ShouldGrandfather::Yes; >- sendWithAsyncReply(Messages::NetworkProcess::ScheduleClearInMemoryAndPersistent(sessionID, modifiedSince, shouldGrandfatherBool), WTFMove(completionHandler)); >+ sendWithAsyncReply(Messages::NetworkProcess::ScheduleClearInMemoryAndPersistent(sessionID, modifiedSince, shouldGrandfather), WTFMove(completionHandler)); > } > > void NetworkProcessProxy::scheduleStatisticsAndDataRecordsProcessing(PAL::SessionID sessionID, CompletionHandler<void()>&& completionHandler) >@@ -603,17 +554,7 @@ void NetworkProcessProxy::setAgeCapForClientSideCookies(PAL::SessionID sessionID > return; > } > >- auto callbackId = generateCallbackID(); >- auto addResult = m_scheduleStatisticsProcessingCallbackMap.add(callbackId, [protectedProcessPool = makeRef(m_processPool), token = throttler().backgroundActivityToken(), completionHandler = WTFMove(completionHandler)]() mutable { >- completionHandler(); >- }); >- ASSERT_UNUSED(addResult, addResult.isNewEntry); >- send(Messages::NetworkProcess::SetAgeCapForClientSideCookies(sessionID, seconds, callbackId), 0); >-} >- >-void NetworkProcessProxy::didSetAgeCapForClientSideCookies(uint64_t callbackId) >-{ >- m_scheduleStatisticsProcessingCallbackMap.take(callbackId)(); >+ sendWithAsyncReply(Messages::NetworkProcess::SetAgeCapForClientSideCookies(sessionID, seconds), WTFMove(completionHandler)); > } > > void NetworkProcessProxy::setTimeToLiveUserInteraction(PAL::SessionID sessionID, Seconds seconds, CompletionHandler<void()>&& completionHandler) >@@ -626,11 +567,6 @@ void NetworkProcessProxy::setTimeToLiveUserInteraction(PAL::SessionID sessionID, > sendWithAsyncReply(Messages::NetworkProcess::SetTimeToLiveUserInteraction(sessionID, seconds), WTFMove(completionHandler)); > } > >-void NetworkProcessProxy::didUpdateRuntimeSettings(uint64_t callbackId) >-{ >- m_updateRuntimeSettingsCallbackMap.take(callbackId)(); >-} >- > void NetworkProcessProxy::setNotifyPagesWhenTelemetryWasCaptured(PAL::SessionID sessionID, bool value, CompletionHandler<void()>&& completionHandler) > { > if (!canSendMessage()) { >@@ -761,17 +697,14 @@ void NetworkProcessProxy::setGrandfathered(PAL::SessionID sessionID, const Strin > sendWithAsyncReply(Messages::NetworkProcess::SetGrandfathered(sessionID, resourceDomain, isGrandfathered), WTFMove(completionHandler)); > } > >-void NetworkProcessProxy::hasStorageAccessForFrame(PAL::SessionID sessionID, const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID, WTF::CompletionHandler<void(bool)>&& callback) >+void NetworkProcessProxy::hasStorageAccessForFrame(PAL::SessionID sessionID, const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID, CompletionHandler<void(bool)>&& completionHandler) > { > if (!canSendMessage()) { >- callback(false); >+ completionHandler(false); > return; > } > >- auto contextId = generateCallbackID(); >- auto addResult = m_storageAccessResponseCallbackMap.add(contextId, WTFMove(callback)); >- ASSERT_UNUSED(addResult, addResult.isNewEntry); >- send(Messages::NetworkProcess::HasStorageAccessForFrame(sessionID, resourceDomain, firstPartyDomain, frameID, pageID, contextId), 0); >+ sendWithAsyncReply(Messages::NetworkProcess::HasStorageAccessForFrame(sessionID, resourceDomain, firstPartyDomain, frameID, pageID), WTFMove(completionHandler)); > } > > void NetworkProcessProxy::hasStorageAccess(PAL::SessionID sessionID, const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, CompletionHandler<void(bool)>&& completionHandler) >@@ -791,33 +724,17 @@ void NetworkProcessProxy::requestStorageAccess(PAL::SessionID sessionID, const S > return; > } > >- auto contextId = generateCallbackID(); >- auto addResult = m_storageAccessRequestResponseCallbackMap.add(contextId, WTFMove(completionHandler)); >- ASSERT_UNUSED(addResult, addResult.isNewEntry); >- send(Messages::NetworkProcess::RequestStorageAccess(sessionID, resourceDomain, firstPartyDomain, frameID, pageID, promptEnabled, contextId), 0); >+ sendWithAsyncReply(Messages::NetworkProcess::RequestStorageAccess(sessionID, resourceDomain, firstPartyDomain, frameID, pageID, promptEnabled), WTFMove(completionHandler)); > } > >-void NetworkProcessProxy::grantStorageAccess(PAL::SessionID sessionID, const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, bool userWasPrompted, WTF::CompletionHandler<void(bool)>&& completionHandler) >+void NetworkProcessProxy::grantStorageAccess(PAL::SessionID sessionID, const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, bool userWasPrompted, CompletionHandler<void(bool)>&& completionHandler) > { > if (!canSendMessage()) { > completionHandler(false); > return; > } > >- auto contextId = generateCallbackID(); >- auto addResult = m_storageAccessResponseCallbackMap.add(contextId, WTFMove(completionHandler)); >- ASSERT_UNUSED(addResult, addResult.isNewEntry); >- send(Messages::NetworkProcess::GrantStorageAccess(sessionID, resourceDomain, firstPartyDomain, frameID.value(), pageID, userWasPrompted, contextId), 0); >-} >- >-void NetworkProcessProxy::storageAccessRequestResult(unsigned status, uint64_t contextId) >-{ >- m_storageAccessRequestResponseCallbackMap.take(contextId)(static_cast<StorageAccessStatus>(status)); >-} >- >-void NetworkProcessProxy::storageAccessOperationResult(bool wasGranted, uint64_t contextId) >-{ >- m_storageAccessResponseCallbackMap.take(contextId)(wasGranted); >+ sendWithAsyncReply(Messages::NetworkProcess::GrantStorageAccess(sessionID, resourceDomain, firstPartyDomain, frameID.value(), pageID, userWasPrompted), WTFMove(completionHandler)); > } > > void NetworkProcessProxy::removeAllStorageAccess(PAL::SessionID sessionID, CompletionHandler<void()>&& completionHandler) >@@ -827,34 +744,17 @@ void NetworkProcessProxy::removeAllStorageAccess(PAL::SessionID sessionID, Compl > return; > } > >- auto contextId = generateCallbackID(); >- auto addResult = m_removeAllStorageAccessCallbackMap.add(contextId, WTFMove(completionHandler)); >- ASSERT_UNUSED(addResult, addResult.isNewEntry); >- send(Messages::NetworkProcess::RemoveAllStorageAccess(sessionID, contextId), 0); >+ sendWithAsyncReply(Messages::NetworkProcess::RemoveAllStorageAccess(sessionID), WTFMove(completionHandler)); > } > >-void NetworkProcessProxy::didRemoveAllStorageAccess(uint64_t contextId) >-{ >- m_removeAllStorageAccessCallbackMap.take(contextId)(); >-} >- >-void NetworkProcessProxy::getAllStorageAccessEntries(PAL::SessionID sessionID, CompletionHandler<void(Vector<String>&& domains)>&& callback) >+void NetworkProcessProxy::getAllStorageAccessEntries(PAL::SessionID sessionID, CompletionHandler<void(Vector<String> domains)>&& completionHandler) > { > if (!canSendMessage()) { >- callback({ }); >+ completionHandler({ }); > return; > } > >- auto contextId = generateCallbackID(); >- auto addResult = m_allStorageAccessEntriesCallbackMap.add(contextId, WTFMove(callback)); >- ASSERT_UNUSED(addResult, addResult.isNewEntry); >- send(Messages::NetworkProcess::GetAllStorageAccessEntries(sessionID, contextId), 0); >-} >- >-void NetworkProcessProxy::allStorageAccessEntriesResult(Vector<String>&& domains, uint64_t contextId) >-{ >- auto callback = m_allStorageAccessEntriesCallbackMap.take(contextId); >- callback(WTFMove(domains)); >+ sendWithAsyncReply(Messages::NetworkProcess::GetAllStorageAccessEntries(sessionID), WTFMove(completionHandler)); > } > > void NetworkProcessProxy::setCacheMaxAgeCapForPrevalentResources(PAL::SessionID sessionID, Seconds seconds, CompletionHandler<void()>&& completionHandler) >@@ -863,16 +763,8 @@ void NetworkProcessProxy::setCacheMaxAgeCapForPrevalentResources(PAL::SessionID > completionHandler(); > return; > } >- >- auto contextId = generateCallbackID(); >- auto addResult = m_updateRuntimeSettingsCallbackMap.add(contextId, WTFMove(completionHandler)); >- ASSERT_UNUSED(addResult, addResult.isNewEntry); >- send(Messages::NetworkProcess::SetCacheMaxAgeCapForPrevalentResources(sessionID, seconds, contextId), 0); >-} > >-void NetworkProcessProxy::didSetCacheMaxAgeCapForPrevalentResources(uint64_t contextId) >-{ >- m_updateRuntimeSettingsCallbackMap.take(contextId)(); >+ sendWithAsyncReply(Messages::NetworkProcess::SetCacheMaxAgeCapForPrevalentResources(sessionID, seconds), WTFMove(completionHandler)); > } > > void NetworkProcessProxy::setCacheMaxAgeCap(PAL::SessionID sessionID, Seconds seconds, CompletionHandler<void()>&& completionHandler) >@@ -882,10 +774,7 @@ void NetworkProcessProxy::setCacheMaxAgeCap(PAL::SessionID sessionID, Seconds se > return; > } > >- auto contextId = generateCallbackID(); >- auto addResult = m_updateRuntimeSettingsCallbackMap.add(contextId, WTFMove(completionHandler)); >- ASSERT_UNUSED(addResult, addResult.isNewEntry); >- send(Messages::NetworkProcess::SetCacheMaxAgeCapForPrevalentResources(sessionID, seconds, contextId), 0); >+ sendWithAsyncReply(Messages::NetworkProcess::SetCacheMaxAgeCapForPrevalentResources(sessionID, seconds), WTFMove(completionHandler)); > } > > void NetworkProcessProxy::setGrandfatheringTime(PAL::SessionID sessionID, Seconds seconds, CompletionHandler<void()>&& completionHandler) >@@ -955,10 +844,7 @@ void NetworkProcessProxy::resetCacheMaxAgeCapForPrevalentResources(PAL::SessionI > return; > } > >- auto contextId = generateCallbackID(); >- auto addResult = m_updateRuntimeSettingsCallbackMap.add(contextId, WTFMove(completionHandler)); >- ASSERT_UNUSED(addResult, addResult.isNewEntry); >- send(Messages::NetworkProcess::ResetCacheMaxAgeCapForPrevalentResources(sessionID, contextId), 0); >+ sendWithAsyncReply(Messages::NetworkProcess::ResetCacheMaxAgeCapForPrevalentResources(sessionID), WTFMove(completionHandler)); > } > > void NetworkProcessProxy::resetParametersToDefaultValues(PAL::SessionID sessionID, CompletionHandler<void()>&& completionHandler) >@@ -981,13 +867,12 @@ void NetworkProcessProxy::submitTelemetry(PAL::SessionID sessionID, CompletionHa > sendWithAsyncReply(Messages::NetworkProcess::SubmitTelemetry(sessionID), WTFMove(completionHandler)); > } > >-void NetworkProcessProxy::scheduleClearInMemoryAndPersistent(PAL::SessionID sessionID, bool shouldGrandfather, CompletionHandler<void()>&& completionHandler) >+void NetworkProcessProxy::scheduleClearInMemoryAndPersistent(PAL::SessionID sessionID, ShouldGrandfatherStatistics shouldGrandfather, CompletionHandler<void()>&& completionHandler) > { > if (!canSendMessage()) { > completionHandler(); > return; > } >- > > sendWithAsyncReply(Messages::NetworkProcess::ScheduleClearInMemoryAndPersistent(sessionID, { }, shouldGrandfather), WTFMove(completionHandler)); > } >diff --git a/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h b/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h >index e351a06b75ad78e50995fa1f8fd8bba38ebb0a9e..335380b10a5c4ed2a77d193a29e291bc2ae475ed 100644 >--- a/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h >+++ b/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2012 Apple Inc. All rights reserved. >+ * Copyright (C) 2012-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 >@@ -57,7 +57,8 @@ namespace WebKit { > class DownloadProxy; > class DownloadProxyMap; > class WebProcessPool; >-enum class StorageAccessStatus : unsigned; >+enum class ShouldGrandfatherStatistics : bool; >+enum class StorageAccessStatus : uint8_t; > enum class WebsiteDataFetchOption; > enum class WebsiteDataType; > struct NetworkProcessCreationParameters; >@@ -80,7 +81,7 @@ public: > #if ENABLE(RESOURCE_LOAD_STATISTICS) > void clearPrevalentResource(PAL::SessionID, const String& resourceDomain, CompletionHandler<void()>&&); > void clearUserInteraction(PAL::SessionID, const String& resourceDomain, CompletionHandler<void()>&&); >- void dumpResourceLoadStatistics(PAL::SessionID, CompletionHandler<void(const String&)>&&); >+ void dumpResourceLoadStatistics(PAL::SessionID, CompletionHandler<void(String)>&&); > void updatePrevalentDomainsToBlockCookiesFor(PAL::SessionID, const Vector<String>& domainsToBlock, CompletionHandler<void()>&&); > void hasHadUserInteraction(PAL::SessionID, const String& resourceDomain, CompletionHandler<void(bool)>&&); > void isGrandfathered(PAL::SessionID, const String& resourceDomain, CompletionHandler<void(bool)>&&); >@@ -107,15 +108,15 @@ public: > void setPrevalentResource(PAL::SessionID, const String& resourceDomain, CompletionHandler<void()>&&); > void setPrevalentResourceForDebugMode(PAL::SessionID, const String& resourceDomain, CompletionHandler<void()>&&); > void setVeryPrevalentResource(PAL::SessionID, const String& resourceDomain, CompletionHandler<void()>&&); >- void hasStorageAccessForFrame(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID, CompletionHandler<void(bool)>&& callback); >- void getAllStorageAccessEntries(PAL::SessionID, CompletionHandler<void(Vector<String>&& domains)>&&); >- void grantStorageAccess(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, bool userWasPrompted, WTF::CompletionHandler<void(bool)>&&); >+ void hasStorageAccessForFrame(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID, CompletionHandler<void(bool)>&&); >+ void getAllStorageAccessEntries(PAL::SessionID, CompletionHandler<void(Vector<String> domains)>&&); >+ void grantStorageAccess(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, bool userWasPrompted, CompletionHandler<void(bool)>&&); > void hasStorageAccess(PAL::SessionID, const String& subFrameHost, const String& topFrameHost, Optional<uint64_t> frameID, uint64_t pageID, CompletionHandler<void(bool)>&&); > void requestStorageAccess(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, bool promptEnabled, CompletionHandler<void(StorageAccessStatus)>&&); > void resetParametersToDefaultValues(PAL::SessionID, CompletionHandler<void()>&&); > void removeAllStorageAccess(PAL::SessionID, CompletionHandler<void()>&&); >- void scheduleClearInMemoryAndPersistent(PAL::SessionID, bool shouldGrandfather, CompletionHandler<void()>&&); >- void scheduleClearInMemoryAndPersistent(PAL::SessionID, Optional<WallTime> modifiedSince, ShouldGrandfather, CompletionHandler<void()>&&); >+ void scheduleClearInMemoryAndPersistent(PAL::SessionID, ShouldGrandfatherStatistics, CompletionHandler<void()>&&); >+ void scheduleClearInMemoryAndPersistent(PAL::SessionID, Optional<WallTime> modifiedSince, ShouldGrandfatherStatistics, CompletionHandler<void()>&&); > void scheduleCookieBlockingUpdate(PAL::SessionID, CompletionHandler<void()>&&); > void submitTelemetry(PAL::SessionID, CompletionHandler<void()>&&); > void setCacheMaxAgeCapForPrevalentResources(PAL::SessionID, Seconds, CompletionHandler<void()>&&); >@@ -184,15 +185,6 @@ private: > void logDiagnosticMessageWithValue(uint64_t pageID, const String& message, const String& description, double value, unsigned significantFigures, WebCore::ShouldSample); > void logGlobalDiagnosticMessageWithValue(const String& message, const String& description, double value, unsigned significantFigures, WebCore::ShouldSample); > #if ENABLE(RESOURCE_LOAD_STATISTICS) >- void didDumpResourceLoadStatistics(String dumpedStatistics, uint64_t callbackId); >- void didUpdateBlockCookies(uint64_t contextId); >- void didSetAgeCapForClientSideCookies(uint64_t contextId); >- void storageAccessOperationResult(bool wasGranted, uint64_t contextId); >- void storageAccessRequestResult(unsigned wasGranted, uint64_t contextId); >- void allStorageAccessEntriesResult(Vector<String>&& domains, uint64_t contextId); >- void didRemoveAllStorageAccess(uint64_t contextId); >- void didSetCacheMaxAgeCapForPrevalentResources(uint64_t contextId); >- void didUpdateRuntimeSettings(uint64_t contextId); > void notifyResourceLoadStatisticsProcessed(); > void notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished(); > void notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished(); >@@ -239,17 +231,6 @@ private: > > unsigned m_syncAllCookiesCounter { 0 }; > >-#if ENABLE(RESOURCE_LOAD_STATISTICS) >- HashMap<uint64_t, CompletionHandler<void()>> m_scheduleStatisticsProcessingCallbackMap; >- HashMap<uint64_t, CompletionHandler<void(bool wasGranted)>> m_storageAccessResponseCallbackMap; >- HashMap<uint64_t, CompletionHandler<void(StorageAccessStatus wasGranted)>> m_storageAccessRequestResponseCallbackMap; >- HashMap<uint64_t, CompletionHandler<void()>> m_removeAllStorageAccessCallbackMap; >- HashMap<uint64_t, CompletionHandler<void(Vector<String>&& domains)>> m_allStorageAccessEntriesCallbackMap; >- HashMap<uint64_t, CompletionHandler<void(const String&)>> m_dumpStatisticsCallbackMap; >-#endif >- >- HashMap<uint64_t, CompletionHandler<void()>> m_updateRuntimeSettingsCallbackMap; >- > #if ENABLE(CONTENT_EXTENSIONS) > HashSet<WebUserContentControllerProxy*> m_webUserContentControllerProxies; > #endif >diff --git a/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in b/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in >index 84e0e8f644118ec47374e2dcb38e43ea13c88e35..1bc30dbfef1009e260221e0c868b5d3177725636 100644 >--- a/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in >+++ b/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in >@@ -41,15 +41,6 @@ messages -> NetworkProcessProxy LegacyReceiver { > LogGlobalDiagnosticMessageWithValue(String message, String description, double value, unsigned significantFigures, enum:bool WebCore::ShouldSample shouldSample) > > #if ENABLE(RESOURCE_LOAD_STATISTICS) >- DidDumpResourceLoadStatistics(String dumpedStatistics, uint64_t callbackId) >- DidUpdateBlockCookies(uint64_t callbackId) >- DidSetAgeCapForClientSideCookies(uint64_t callbackId) >- StorageAccessOperationResult(bool wasGranted, uint64_t contextId) >- StorageAccessRequestResult(unsigned wasGranted, uint64_t contextId) >- AllStorageAccessEntriesResult(Vector<String> domains, uint64_t contextId) >- DidRemoveAllStorageAccess(uint64_t contextId) >- DidSetCacheMaxAgeCapForPrevalentResources(uint64_t contextId) >- DidUpdateRuntimeSettings(uint64_t contextId) > NotifyResourceLoadStatisticsProcessed() > NotifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished() > NotifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished() >diff --git a/Source/WebKit/UIProcess/WebProcessPool.cpp b/Source/WebKit/UIProcess/WebProcessPool.cpp >index 2ca76381bff4b25ecec001f44d12a2ac0aea2015..496c61f11a7a550fff92cfedcb9bdf8950901ad2 100644 >--- a/Source/WebKit/UIProcess/WebProcessPool.cpp >+++ b/Source/WebKit/UIProcess/WebProcessPool.cpp >@@ -591,9 +591,6 @@ NetworkProcessProxy& WebProcessPool::ensureNetworkProcess(WebsiteDataStore* with > m_networkProcess->addSession(*websiteDataStore); > } > >- if (m_websiteDataStore) >- m_websiteDataStore->websiteDataStore().didCreateNetworkProcess(); >- > return *m_networkProcess; > } > >@@ -1034,6 +1031,9 @@ void WebProcessPool::processDidFinishLaunching(WebProcessProxy* process) > process->connection()->ignoreTimeoutsForTesting(); > > m_connectionClient.didCreateConnection(this, process->webConnection()); >+ >+ if (m_websiteDataStore) >+ m_websiteDataStore->websiteDataStore().didCreateNetworkProcess(); > } > > void WebProcessPool::disconnectProcess(WebProcessProxy* process) >diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp >index b18fce7906f8e2bb8c5bd2464460608e4ccfeadd..b7c818233ec4804b84cb9ae8022aff4fce2f8d20 100644 >--- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp >+++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp >@@ -33,6 +33,8 @@ > #include "DeviceIdHashSaltStorage.h" > #include "MockAuthenticatorManager.h" > #include "NetworkProcessMessages.h" >+#include "ShouldGrandfatherStatistics.h" >+#include "StorageAccessStatus.h" > #include "StorageManager.h" > #include "WebCookieManagerProxy.h" > #include "WebProcessMessages.h" >@@ -942,7 +944,7 @@ void WebsiteDataStore::removeData(OptionSet<WebsiteDataType> dataTypes, WallTime > > // 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) ? ShouldGrandfather::No : ShouldGrandfather::Yes; >+ auto shouldGrandfather = ((monitoredTypesRaw & deletedTypesRaw) == monitoredTypesRaw) ? ShouldGrandfatherStatistics::No : ShouldGrandfatherStatistics::Yes; > > if (m_resourceLoadStatistics) { > callbackAggregator->addPendingCallback(); >@@ -1252,11 +1254,11 @@ void WebsiteDataStore::removeData(OptionSet<WebsiteDataType> dataTypes, const Ve > // we do not need to re-grandfather old data. > callbackAggregator->addPendingCallback(); > if ((monitoredTypesRaw & deletedTypesRaw) == monitoredTypesRaw) >- m_resourceLoadStatistics->scheduleClearInMemoryAndPersistent(ShouldGrandfather::No, [callbackAggregator] { >+ m_resourceLoadStatistics->scheduleClearInMemoryAndPersistent(ShouldGrandfatherStatistics::No, [callbackAggregator] { > callbackAggregator->removePendingCallback(); > }); > else >- m_resourceLoadStatistics->scheduleClearInMemoryAndPersistent(ShouldGrandfather::Yes, [callbackAggregator] { >+ m_resourceLoadStatistics->scheduleClearInMemoryAndPersistent(ShouldGrandfatherStatistics::Yes, [callbackAggregator] { > callbackAggregator->removePendingCallback(); > }); > >@@ -1292,10 +1294,8 @@ void WebsiteDataStore::setMaxStatisticsEntries(size_t maximumEntryCount, Complet > > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > >- for (auto& processPool : processPools()) { >- if (auto* process = processPool->networkProcess()) >- process->setMaxStatisticsEntries(m_sessionID, maximumEntryCount, [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); >- } >+ for (auto& processPool : processPools()) >+ processPool->ensureNetworkProcess().setMaxStatisticsEntries(m_sessionID, maximumEntryCount, [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); > } > > void WebsiteDataStore::setPruneEntriesDownTo(size_t pruneTargetCount, CompletionHandler<void()>&& completionHandler) >@@ -1310,8 +1310,7 @@ void WebsiteDataStore::setPruneEntriesDownTo(size_t pruneTargetCount, Completion > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) { >- if (auto* process = processPool->networkProcess()) >- process->setPruneEntriesDownTo(m_sessionID, pruneTargetCount, [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); >+ processPool->ensureNetworkProcess().setPruneEntriesDownTo(m_sessionID, pruneTargetCount, [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); > } > } > >@@ -1326,10 +1325,8 @@ void WebsiteDataStore::setGrandfatheringTime(Seconds seconds, CompletionHandler< > > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > >- for (auto& processPool : processPools()) { >- if (auto* process = processPool->networkProcess()) >- process->setGrandfatheringTime(m_sessionID, seconds, [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); >- } >+ for (auto& processPool : processPools()) >+ processPool->ensureNetworkProcess().setGrandfatheringTime(m_sessionID, seconds, [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); > } > > void WebsiteDataStore::setCacheMaxAgeCap(Seconds seconds, CompletionHandler<void()>&& completionHandler) >@@ -1344,10 +1341,8 @@ void WebsiteDataStore::setCacheMaxAgeCap(Seconds seconds, CompletionHandler<void > > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > >- for (auto& processPool : processPools()) { >- if (auto* process = processPool->networkProcess()) >- process->setCacheMaxAgeCap(m_sessionID, seconds, [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); >- } >+ for (auto& processPool : processPools()) >+ processPool->ensureNetworkProcess().setCacheMaxAgeCap(m_sessionID, seconds, [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); > } > > void WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval(Seconds seconds, CompletionHandler<void()>&& completionHandler) >@@ -1361,10 +1356,8 @@ void WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval(Seconds seconds, > > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > >- for (auto& processPool : processPools()) { >- if (auto* process = processPool->networkProcess()) >- process->setMinimumTimeBetweenDataRecordsRemoval(m_sessionID, seconds, [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); >- } >+ for (auto& processPool : processPools()) >+ processPool->ensureNetworkProcess().setMinimumTimeBetweenDataRecordsRemoval(m_sessionID, seconds, [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); > } > > void WebsiteDataStore::dumpResourceLoadStatistics(CompletionHandler<void(const String&)>&& completionHandler) >@@ -1425,8 +1418,7 @@ void WebsiteDataStore::setPrevalentResource(const URL& url, CompletionHandler<vo > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > > for (auto& processPool : processPools()) { >- if (auto* process = processPool->networkProcess()) >- process->setPrevalentResource(m_sessionID, WebCore::ResourceLoadStatistics::primaryDomain(url), [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); >+ processPool->ensureNetworkProcess().setPrevalentResource(m_sessionID, WebCore::ResourceLoadStatistics::primaryDomain(url), [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); > } > } > >@@ -1508,10 +1500,8 @@ void WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval(bool v > > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > >- for (auto& processPool : processPools()) { >- if (auto* process = processPool->networkProcess()) >- process->setShouldClassifyResourcesBeforeDataRecordsRemoval(m_sessionID, value, [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); >- } >+ for (auto& processPool : processPools()) >+ processPool->ensureNetworkProcess().setShouldClassifyResourcesBeforeDataRecordsRemoval(m_sessionID, value, [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); > } > > void WebsiteDataStore::setSubframeUnderTopFrameOrigin(const URL& subframe, const URL& topFrame, CompletionHandler<void()>&& completionHandler) >@@ -1755,7 +1745,7 @@ void WebsiteDataStore::submitTelemetry() > } > } > >-void WebsiteDataStore::scheduleClearInMemoryAndPersistent(WallTime modifiedSince, ShouldGrandfather shouldGrandfather, CompletionHandler<void()>&& completionHandler) >+void WebsiteDataStore::scheduleClearInMemoryAndPersistent(WallTime modifiedSince, ShouldGrandfatherStatistics shouldGrandfather, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); > >@@ -1772,7 +1762,7 @@ void WebsiteDataStore::scheduleClearInMemoryAndPersistent(WallTime modifiedSince > } > } > >-void WebsiteDataStore::scheduleClearInMemoryAndPersistent(ShouldGrandfather shouldGrandfather, CompletionHandler<void()>&& completionHandler) >+void WebsiteDataStore::scheduleClearInMemoryAndPersistent(ShouldGrandfatherStatistics shouldGrandfather, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); > >@@ -1837,10 +1827,8 @@ void WebsiteDataStore::setAgeCapForClientSideCookies(Optional<Seconds> seconds, > { > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > >- for (auto& processPool : processPools()) { >- if (auto* process = processPool->networkProcess()) >- process->setAgeCapForClientSideCookies(m_sessionID, seconds, [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); >- } >+ 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) >@@ -1873,10 +1861,8 @@ void WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned(bool value, Comp > > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > >- for (auto& processPool : processPools()) { >- if (auto* process = processPool->networkProcess()) >- process->setNotifyPagesWhenDataRecordsWereScanned(m_sessionID, value, [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); >- } >+ for (auto& processPool : processPools()) >+ processPool->ensureNetworkProcess().setNotifyPagesWhenDataRecordsWereScanned(m_sessionID, value, [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); > } > > void WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured(bool value, CompletionHandler<void()>&& completionHandler) >@@ -1888,10 +1874,8 @@ void WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured(bool value, Comple > > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > >- for (auto& processPool : processPools()) { >- if (auto* process = processPool->networkProcess()) >- process->setNotifyPagesWhenTelemetryWasCaptured(m_sessionID, value, [processPool, callbackAggregator = callbackAggregator.copyRef()] { }); >- } >+ 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) >@@ -2021,10 +2005,8 @@ void WebsiteDataStore::setTimeToLiveUserInteraction(Seconds seconds, CompletionH > > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > >- for (auto& processPool : processPools()) { >- if (auto* networkProcess = processPool->networkProcess()) >- networkProcess->setTimeToLiveUserInteraction(m_sessionID, seconds, [callbackAggregator = callbackAggregator.copyRef()] { }); >- } >+ for (auto& processPool : processPools()) >+ processPool->ensureNetworkProcess().setTimeToLiveUserInteraction(m_sessionID, seconds, [callbackAggregator = callbackAggregator.copyRef()] { }); > } > > void WebsiteDataStore::logUserInteraction(const URL& url, CompletionHandler<void()>&& completionHandler) >@@ -2145,10 +2127,8 @@ void WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources(Seconds seconds, C > #if ENABLE(RESOURCE_LOAD_STATISTICS) > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > >- for (auto& processPool : processPools()) { >- if (auto* networkProcess = processPool->networkProcess()) >- networkProcess->setCacheMaxAgeCapForPrevalentResources(m_sessionID, seconds, [callbackAggregator = callbackAggregator.copyRef()] { }); >- } >+ for (auto& processPool : processPools()) >+ processPool->ensureNetworkProcess().setCacheMaxAgeCapForPrevalentResources(m_sessionID, seconds, [callbackAggregator = callbackAggregator.copyRef()] { }); > #else > UNUSED_PARAM(seconds); > completionHandler(); >@@ -2380,10 +2360,8 @@ void WebsiteDataStore::setResourceLoadStatisticsDebugMode(bool enabled, Completi > > auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); > >- for (auto& processPool : processPools()) { >- if (auto* process = processPool->networkProcess()) >- process->setResourceLoadStatisticsDebugMode(m_sessionID, enabled, [callbackAggregator = callbackAggregator.copyRef()] { }); >- } >+ for (auto& processPool : processPools()) >+ processPool->ensureNetworkProcess().setResourceLoadStatisticsDebugMode(m_sessionID, enabled, [callbackAggregator = callbackAggregator.copyRef()] { }); > #else > UNUSED_PARAM(enabled); > UNUSED_PARAM(completionHandler); >diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h >index c650528a1abf0fcdb96d5b91610b2fab511614cc..e528f6dd36c871643d7f2ab01f3f23105e2cf172 100644 >--- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h >+++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h >@@ -72,8 +72,8 @@ struct WebsiteDataRecord; > struct WebsiteDataStoreParameters; > > #if ENABLE(RESOURCE_LOAD_STATISTICS) >-enum class ShouldGrandfather; >-enum class StorageAccessStatus : unsigned; >+enum class ShouldGrandfatherStatistics : bool; >+enum class StorageAccessStatus : uint8_t; > enum class StorageAccessPromptStatus; > #endif > >@@ -143,8 +143,8 @@ public: > void removePrevalentDomains(const Vector<String>& domains); > void resetParametersToDefaultValues(CompletionHandler<void()>&&); > void scheduleCookieBlockingUpdate(CompletionHandler<void()>&&); >- void scheduleClearInMemoryAndPersistent(WallTime modifiedSince, ShouldGrandfather, CompletionHandler<void()>&&); >- void scheduleClearInMemoryAndPersistent(ShouldGrandfather, 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()>&&); >diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >index 959e28364be689f157d1662d50288fcbc6eda906..a0b70ca478d5e3341a38359cbf24d98de4409186 100644 >--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj >+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >@@ -1092,6 +1092,8 @@ > 762B748D120BC75C00819339 /* WKPreferencesRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 762B7484120BBA2D00819339 /* WKPreferencesRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 7A1E2A851EEFE8920037A0E0 /* APINotificationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A1E2A841EEFE88A0037A0E0 /* APINotificationProvider.h */; }; > 7A3ACE1B1EEEF79B00A864A4 /* APIInjectedBundlePageLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A3ACE1A1EEEF78C00A864A4 /* APIInjectedBundlePageLoaderClient.h */; }; >+ 7A3FECA221F7C09700F267CD /* StorageAccessStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A3FECA121F7C09700F267CD /* StorageAccessStatus.h */; }; >+ 7A41E9FB21F81DAD00B88CDB /* ShouldGrandfatherStatistics.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A41E9FA21F81DAC00B88CDB /* ShouldGrandfatherStatistics.h */; }; > 7A772C8D1DDD4A25000F34F1 /* com.apple.WebKit.plugin-common.sb in Copy Plug-in Sandbox Profiles */ = {isa = PBXBuildFile; fileRef = 7A1506721DD56298001F4B58 /* com.apple.WebKit.plugin-common.sb */; }; > 7A791EFA1C7CFCF100C4C52B /* WebResourceLoadStatisticsStoreMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A791EF91C7CFB3700C4C52B /* WebResourceLoadStatisticsStoreMessageReceiver.cpp */; }; > 7A791EFB1C7CFD0100C4C52B /* WebResourceLoadStatisticsStoreMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A791EF81C7CFB1000C4C52B /* WebResourceLoadStatisticsStoreMessages.h */; }; >@@ -3511,6 +3513,8 @@ > 7A1506721DD56298001F4B58 /* com.apple.WebKit.plugin-common.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "com.apple.WebKit.plugin-common.sb"; path = "DerivedSources/WebKit2/com.apple.WebKit.plugin-common.sb"; sourceTree = BUILT_PRODUCTS_DIR; }; > 7A1E2A841EEFE88A0037A0E0 /* APINotificationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APINotificationProvider.h; sourceTree = "<group>"; }; > 7A3ACE1A1EEEF78C00A864A4 /* APIInjectedBundlePageLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIInjectedBundlePageLoaderClient.h; sourceTree = "<group>"; }; >+ 7A3FECA121F7C09700F267CD /* StorageAccessStatus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StorageAccessStatus.h; path = Classifier/StorageAccessStatus.h; sourceTree = "<group>"; }; >+ 7A41E9FA21F81DAC00B88CDB /* ShouldGrandfatherStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ShouldGrandfatherStatistics.h; path = Classifier/ShouldGrandfatherStatistics.h; sourceTree = "<group>"; }; > 7A5E39491D5BD8A700B4B7CE /* com.macromedia.Flash Player ESR.plugin.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "com.macromedia.Flash Player ESR.plugin.sb"; sourceTree = "<group>"; }; > 7A791EF81C7CFB1000C4C52B /* WebResourceLoadStatisticsStoreMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebResourceLoadStatisticsStoreMessages.h; path = DerivedSources/WebKit2/WebResourceLoadStatisticsStoreMessages.h; sourceTree = BUILT_PRODUCTS_DIR; }; > 7A791EF91C7CFB3700C4C52B /* WebResourceLoadStatisticsStoreMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebResourceLoadStatisticsStoreMessageReceiver.cpp; path = DerivedSources/WebKit2/WebResourceLoadStatisticsStoreMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; >@@ -6895,6 +6899,8 @@ > 7AFBD36521E51BAB005DBACB /* ResourceLoadStatisticsMemoryStore.h */, > 7AFBD36921E542E8005DBACB /* ResourceLoadStatisticsPersistentStorage.cpp */, > 7AFBD36821E542E8005DBACB /* ResourceLoadStatisticsPersistentStorage.h */, >+ 7A41E9FA21F81DAC00B88CDB /* ShouldGrandfatherStatistics.h */, >+ 7A3FECA121F7C09700F267CD /* StorageAccessStatus.h */, > 7A843A1A21E41FB200DEF663 /* WebResourceLoadStatisticsStore.cpp */, > 7AFBD36221E50F39005DBACB /* WebResourceLoadStatisticsStore.h */, > 7AFBD36C21E54544005DBACB /* WebResourceLoadStatisticsTelemetry.cpp */, >@@ -9299,11 +9305,13 @@ > 8313F7EE1F7DAE0800B944EB /* SharedStringHashTable.h in Headers */, > 83F9644E1FA0F76E00C47750 /* SharedStringHashTableReadOnly.h in Headers */, > 1D67B339212E1F6100FAA786 /* ShareSheetCallbackID.h in Headers */, >+ 7A41E9FB21F81DAD00B88CDB /* ShouldGrandfatherStatistics.h in Headers */, > 995226D6207D184600F78420 /* SimulatedInputDispatcher.h in Headers */, > 2DAF06D618BD1A470081CEB1 /* SmartMagnificationController.h in Headers */, > 2DE6943E18BD2A68005C15E5 /* SmartMagnificationControllerMessages.h in Headers */, > 5272B28B1406985D0096A5D0 /* StatisticsData.h in Headers */, > 514BDED316C98EDD00E4E25E /* StatisticsRequest.h in Headers */, >+ 7A3FECA221F7C09700F267CD /* StorageAccessStatus.h in Headers */, > 1AD3306F16B1D991004F60E7 /* StorageAreaImpl.h in Headers */, > 1ACECD2517162DB1001FC9EF /* StorageAreaMap.h in Headers */, > 1A334DEE16DE8F88006A8E38 /* StorageAreaMapMessages.h in Headers */, >@@ -10699,6 +10707,7 @@ > buildActionMask = 2147483647; > files = ( > 2D92A784212B6AB100F493FD /* ActivityAssertion.cpp in Sources */, >+ 5CE43B7221F7CC020093BCC5 /* APIHTTPCookieStoreCocoa.mm in Sources */, > 2D92A77B212B6A7100F493FD /* ArgumentCoders.cpp in Sources */, > 2DEB1D2E2127473600933906 /* ArgumentCodersCF.cpp in Sources */, > 2D92A77C212B6A7100F493FD /* Attachment.cpp in Sources */,
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193659
:
359803
|
359805
|
359816
|
359844
|
359906
|
359915
|
359916