WebKit Bugzilla
Attachment 358746 Details for
Bug 193261
: Create a WebResourceLoadStatisticsStore attached to the NetworkSession
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193261-20190109145120.patch (text/plain), 43.04 KB, created by
Brent Fulgham
on 2019-01-09 14:51:21 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Brent Fulgham
Created:
2019-01-09 14:51:21 PST
Size:
43.04 KB
patch
obsolete
>Subversion Revision: 239773 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 891a4f5f895eadbe11fc3e45d24f21f0b5014564..17247109c89256dc88204cd890d5408e2aa931c9 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,77 @@ >+2019-01-09 Brent Fulgham <bfulgham@apple.com> >+ >+ Create a WebResourceLoadStatisticsStore attached to the NetworkSession >+ https://bugs.webkit.org/show_bug.cgi?id=193261 >+ <rdar://problem/47158616> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch modifies NetworkSession so that it owns a WebResourceLoadStatisticsStore >+ object. This object is only created if the ResourceLoadStatistics feature is turned on. >+ >+ The patch also modifies WebResourceLoadStatisticsStore so that it can be constructed >+ with an owning NetworkSession as an alternative to the current practice of using a >+ WebsiteData object. >+ >+ Two initial messages from the WebContent process are added (logFrameNavigation and >+ logUserNavigation) that notify the network process of these actions. Currently they >+ are called in addition the calls to the WebSiteData object. These redundant calls >+ will be removed in a future patch. >+ >+ This patch forces the ResourceLoadStatistics code in the NetworkSession to be off by >+ default, so there should be no change in behavior with this patch. >+ >+ * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: >+ (WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap): >+ * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: >+ (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): >+ (WebKit::WebResourceLoadStatisticsStore::hasStorageAccessForFrame): >+ (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler): >+ (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess): >+ (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler): >+ (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess): >+ (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation): >+ (WebKit::WebResourceLoadStatisticsStore::logUserInteraction): >+ (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCapForPrevalentResources): >+ (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap): >+ (WebKit::WebResourceLoadStatisticsStore::updatePrevalentDomainsToBlockCookiesFor): >+ (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler): >+ (WebKit::WebResourceLoadStatisticsStore::removePrevalentDomains): >+ (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler): >+ * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: >+ * NetworkProcess/NetworkProcess.cpp: >+ (WebKit::NetworkProcess::initializeNetworkProcess): >+ (WebKit::NetworkProcess::logFrameNavigation): >+ (WebKit::NetworkProcess::logUserInteraction): >+ * NetworkProcess/NetworkProcess.h: >+ * NetworkProcess/NetworkProcess.messages.in: >+ * NetworkProcess/NetworkSession.cpp: >+ (WebKit::NetworkSession::enableResourceLoadStatistics): >+ * NetworkProcess/NetworkSession.h: >+ (WebKit::NetworkSession::resourceLoadStatistics const): >+ * NetworkProcess/NetworkSessionCreationParameters.cpp: >+ (WebKit::NetworkSessionCreationParameters::privateSessionParameters): >+ (WebKit::NetworkSessionCreationParameters::encode const): >+ (WebKit::NetworkSessionCreationParameters::decode): >+ * NetworkProcess/NetworkSessionCreationParameters.h: >+ * NetworkProcess/cocoa/NetworkSessionCocoa.mm: >+ (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): >+ * UIProcess/Cocoa/WebProcessPoolCocoa.mm: >+ (WebKit::WebProcessPool::platformInitializeNetworkProcess): >+ * UIProcess/Network/NetworkProcessProxy.cpp: >+ (WebKit::NetworkProcessProxy::didLogUserInteraction): >+ * UIProcess/Network/NetworkProcessProxy.h: >+ * UIProcess/Network/NetworkProcessProxy.messages.in: >+ * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: >+ (WebsiteDataStore::parameters): >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::WebPageProxy::decidePolicyForNavigationAction): >+ (WebKit::WebPageProxy::logFrameNavigation): >+ * UIProcess/WebPageProxy.h: >+ * UIProcess/WebProcessPool.cpp: >+ (WebKit::WebProcessPool::ensureNetworkProcess): >+ (WebKit::WebProcessPool::initializeNewWebProcess): >+ > 2019-01-09 Michael Catanzaro <mcatanzaro@igalia.com> > > [GTK] Add missing autocleanups >diff --git a/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp b/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp >index 19c38e1c47ced6082578e7d1938151fd50f754fd..8d62d68c1c49f49f79160dfebb6afa69087fee5a 100644 >--- a/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp >+++ b/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp >@@ -27,6 +27,7 @@ > #include "ResourceLoadStatisticsMemoryStore.h" > > #include "Logging.h" >+#include "NetworkSession.h" > #include "PluginProcessManager.h" > #include "PluginProcessProxy.h" > #include "ResourceLoadStatisticsPersistentStorage.h" >@@ -34,6 +35,7 @@ > #include "WebResourceLoadStatisticsTelemetry.h" > #include "WebsiteDataStore.h" > #include <WebCore/KeyedCoding.h> >+#include <WebCore/NetworkStorageSession.h> > #include <WebCore/ResourceLoadStatistics.h> > #include <wtf/CallbackAggregator.h> > #include <wtf/DateMath.h> >@@ -862,6 +864,8 @@ void ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap() > 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); > }); > #endif > } >diff --git a/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp b/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp >index 451e7108d7810e41a56473408c2511dfa10fbbc3..fcfad982eeda053ed6c4be691ded9d4666565542 100644 >--- a/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp >+++ b/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016-2018 Apple Inc. All rights reserved. >+ * Copyright (C) 2016-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 >@@ -27,6 +27,7 @@ > #include "WebResourceLoadStatisticsStore.h" > > #include "Logging.h" >+#include "NetworkSession.h" > #include "ResourceLoadStatisticsMemoryStore.h" > #include "ResourceLoadStatisticsPersistentStorage.h" > #include "WebFrameProxy.h" >@@ -37,6 +38,7 @@ > #include "WebResourceLoadStatisticsTelemetry.h" > #include "WebsiteDataFetchOption.h" > #include "WebsiteDataStore.h" >+#include <WebCore/NetworkStorageSession.h> > #include <WebCore/ResourceLoadStatistics.h> > #include <wtf/CallbackAggregator.h> > #include <wtf/CrossThreadCopier.h> >@@ -121,6 +123,21 @@ WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore(WebsiteDataStore& > 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)) >+ , m_dailyTasksTimer(RunLoop::main(), this, &WebResourceLoadStatisticsStore::performDailyTasks) >+{ >+ ASSERT(RunLoop::isMain()); >+ >+ postTask([this, resourceLoadStatisticsDirectory = resourceLoadStatisticsDirectory.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() > { > ASSERT(RunLoop::isMain()); >@@ -236,6 +253,13 @@ void WebResourceLoadStatisticsStore::hasStorageAccess(String&& subFrameHost, Str > }); > } > >+#if ENABLE(RESOURCE_LOAD_STATISTICS) >+bool WebResourceLoadStatisticsStore::hasStorageAccessForFrame(const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID) >+{ >+ return m_networkSession ? m_networkSession->networkStorageSession().hasStorageAccess(resourceDomain, firstPartyDomain, frameID, pageID) : false; >+} >+#endif >+ > void WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler(const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID, CompletionHandler<void(bool hasAccess)>&& callback) > { > ASSERT(RunLoop::isMain()); >@@ -244,6 +268,9 @@ void WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler(const S > if (m_websiteDataStore) { > m_websiteDataStore->hasStorageAccessForFrameHandler(resourceDomain, firstPartyDomain, frameID, pageID, WTFMove(callback)); > return; >+ } else { >+ callback(hasStorageAccessForFrame(resourceDomain, firstPartyDomain, frameID, pageID)); >+ return; > } > #endif > callback(false); >@@ -309,6 +336,21 @@ void WebResourceLoadStatisticsStore::grantStorageAccess(String&& subFrameHost, S > }); > } > >+#if ENABLE(RESOURCE_LOAD_STATISTICS) >+bool WebResourceLoadStatisticsStore::grantStorageAccess(const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID) >+{ >+ bool isStorageGranted = false; >+ >+ if (m_networkSession) { >+ m_networkSession->networkStorageSession().grantStorageAccess(resourceDomain, firstPartyDomain, frameID, pageID); >+ ASSERT(m_networkSession->networkStorageSession().hasStorageAccess(resourceDomain, firstPartyDomain, frameID, pageID)); >+ isStorageGranted = true; >+ } >+ >+ return isStorageGranted; >+} >+#endif >+ > void WebResourceLoadStatisticsStore::callGrantStorageAccessHandler(const String& subFramePrimaryDomain, const String& topFramePrimaryDomain, Optional<uint64_t> frameID, uint64_t pageID, CompletionHandler<void(bool)>&& callback) > { > ASSERT(RunLoop::isMain()); >@@ -317,6 +359,9 @@ void WebResourceLoadStatisticsStore::callGrantStorageAccessHandler(const String& > if (m_websiteDataStore) { > m_websiteDataStore->grantStorageAccessHandler(subFramePrimaryDomain, topFramePrimaryDomain, frameID, pageID, WTFMove(callback)); > return; >+ } else { >+ callback(grantStorageAccess(subFramePrimaryDomain, topFramePrimaryDomain, frameID, pageID)); >+ return; > } > #endif > callback(false); >@@ -333,18 +378,26 @@ void WebResourceLoadStatisticsStore::didCreateNetworkProcess() > }); > } > >+#if ENABLE(RESOURCE_LOAD_STATISTICS) >+void WebResourceLoadStatisticsStore::removeAllStorageAccess() >+{ >+ if (m_networkSession) >+ m_networkSession->networkStorageSession().removeAllStorageAccess(); >+} >+#endif >+ > void WebResourceLoadStatisticsStore::removeAllStorageAccess(CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); > > #if ENABLE(RESOURCE_LOAD_STATISTICS) >- if (m_websiteDataStore) >+ if (m_websiteDataStore) { > m_websiteDataStore->removeAllStorageAccessHandler(WTFMove(completionHandler)); >- else >- completionHandler(); >-#else >- completionHandler(); >+ return; >+ } >+ removeAllStorageAccess(); > #endif >+ completionHandler(); > } > > void WebResourceLoadStatisticsStore::applicationWillTerminate() >@@ -402,7 +455,12 @@ void WebResourceLoadStatisticsStore::logFrameNavigation(const WebFrameProxy& fra > auto mainFramePrimaryDomain = ResourceLoadStatistics::primaryDomain(pageURL); > auto sourcePrimaryDomain = ResourceLoadStatistics::primaryDomain(sourceURL); > >- postTask([this, targetPrimaryDomain = targetPrimaryDomain.isolatedCopy(), mainFramePrimaryDomain = mainFramePrimaryDomain.isolatedCopy(), sourcePrimaryDomain = sourcePrimaryDomain.isolatedCopy(), targetHost = targetHost.toString().isolatedCopy(), mainFrameHost = mainFrameHost.toString().isolatedCopy(), isRedirect, isMainFrame = frame.isMainFrame()] { >+ logFrameNavigation(targetPrimaryDomain, mainFramePrimaryDomain, sourcePrimaryDomain, targetHost.toString(), mainFrameHost.toString(), isRedirect, frame.isMainFrame()); >+} >+ >+void WebResourceLoadStatisticsStore::logFrameNavigation(const String& targetPrimaryDomain, const String& mainFramePrimaryDomain, const String& sourcePrimaryDomain, const String& targetHost, const String& mainFrameHost, bool isRedirect, bool isMainFrame) >+{ >+ postTask([this, targetPrimaryDomain = targetPrimaryDomain.isolatedCopy(), mainFramePrimaryDomain = mainFramePrimaryDomain.isolatedCopy(), sourcePrimaryDomain = sourcePrimaryDomain.isolatedCopy(), targetHost = targetHost.isolatedCopy(), mainFrameHost = mainFrameHost.isolatedCopy(), isRedirect, isMainFrame] { > > if (m_memoryStore) > m_memoryStore->logFrameNavigation(targetPrimaryDomain, mainFramePrimaryDomain, sourcePrimaryDomain, targetHost, mainFrameHost, isRedirect, isMainFrame); >@@ -418,7 +476,18 @@ void WebResourceLoadStatisticsStore::logUserInteraction(const URL& url, Completi > return; > } > >- postTask([this, primaryDomain = isolatedPrimaryDomain(url), completionHandler = WTFMove(completionHandler)]() mutable { >+ logUserInteraction(isolatedPrimaryDomain(url), [this, primaryDomain = isolatedPrimaryDomain(url), completionHandler = WTFMove(completionHandler)]() mutable { >+ if (m_memoryStore) >+ m_memoryStore->logUserInteraction(primaryDomain); >+ postTaskReply(WTFMove(completionHandler)); >+ }); >+} >+ >+void WebResourceLoadStatisticsStore::logUserInteraction(const String& targetPrimaryDomain, CompletionHandler<void()>&& completionHandler) >+{ >+ ASSERT(RunLoop::isMain()); >+ >+ postTask([this, primaryDomain = targetPrimaryDomain.isolatedCopy(), completionHandler = WTFMove(completionHandler)]() mutable { > if (m_memoryStore) > m_memoryStore->logUserInteraction(primaryDomain); > postTaskReply(WTFMove(completionHandler)); >@@ -823,6 +892,14 @@ void WebResourceLoadStatisticsStore::setGrandfatheringTime(Seconds seconds) > }); > } > >+#if ENABLE(RESOURCE_LOAD_STATISTICS) >+void WebResourceLoadStatisticsStore::setCacheMaxAgeCapForPrevalentResources(Seconds seconds) >+{ >+ if (m_networkSession) >+ m_networkSession->networkStorageSession().setCacheMaxAgeCapForPrevalentResources(seconds); >+} >+#endif >+ > void WebResourceLoadStatisticsStore::setCacheMaxAgeCap(Seconds seconds, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -833,10 +910,19 @@ void WebResourceLoadStatisticsStore::setCacheMaxAgeCap(Seconds seconds, Completi > m_websiteDataStore->setCacheMaxAgeCapForPrevalentResources(seconds, WTFMove(completionHandler)); > return; > } >+ setCacheMaxAgeCapForPrevalentResources(seconds); > #endif > completionHandler(); > } > >+#if ENABLE(RESOURCE_LOAD_STATISTICS) >+void WebResourceLoadStatisticsStore::updatePrevalentDomainsToBlockCookiesFor(const Vector<String>& domainsToBlock) >+{ >+ if (m_networkSession) >+ m_networkSession->networkStorageSession().setPrevalentDomainsToBlockCookiesFor(domainsToBlock); >+} >+#endif >+ > void WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler(const Vector<String>& domainsToBlock, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >@@ -846,10 +932,19 @@ void WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesFor > m_websiteDataStore->updatePrevalentDomainsToBlockCookiesFor(domainsToBlock, WTFMove(completionHandler)); > return; > } >+ updatePrevalentDomainsToBlockCookiesFor(domainsToBlock); > #endif > completionHandler(); > } > >+#if ENABLE(RESOURCE_LOAD_STATISTICS) >+void WebResourceLoadStatisticsStore::removePrevalentDomains(const Vector<String>& domains) >+{ >+ if (m_networkSession) >+ m_networkSession->networkStorageSession().removePrevalentDomains(domains); >+} >+#endif >+ > void WebResourceLoadStatisticsStore::callRemoveDomainsHandler(const Vector<String>& domains) > { > ASSERT(RunLoop::isMain()); >@@ -857,6 +952,7 @@ void WebResourceLoadStatisticsStore::callRemoveDomainsHandler(const Vector<Strin > #if ENABLE(RESOURCE_LOAD_STATISTICS) > if (m_websiteDataStore) > m_websiteDataStore->removePrevalentDomains(domains); >+ removePrevalentDomains(domains); > #endif > } > >diff --git a/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h b/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h >index 581704a4ef299dc083d279f534c77281cfa76b4e..00236a39553ec21cd184cc67255870fda57efad7 100644 >--- a/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h >+++ b/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h >@@ -46,6 +46,7 @@ struct ResourceLoadStatistics; > > namespace WebKit { > >+class NetworkSession; > class ResourceLoadStatisticsMemoryStore; > class ResourceLoadStatisticsPersistentStorage; > class WebFrameProxy; >@@ -65,6 +66,11 @@ public: > return adoptRef(*new WebResourceLoadStatisticsStore(websiteDataStore)); > } > >+ static Ref<WebResourceLoadStatisticsStore> create(NetworkSession& networkSession, const String& resourceLoadStatisticsDirectory) >+ { >+ return adoptRef(*new WebResourceLoadStatisticsStore(networkSession, resourceLoadStatisticsDirectory)); >+ } >+ > ~WebResourceLoadStatisticsStore(); > > static const OptionSet<WebsiteDataType>& monitoredDataTypes(); >@@ -83,9 +89,13 @@ public: > void applicationWillTerminate(); > > 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 clearUserInteraction(const URL&, CompletionHandler<void()>&&); >+ bool grantStorageAccess(const String& resourceDomain, const String& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID); > void hasHadUserInteraction(const URL&, CompletionHandler<void(bool)>&&); >+ bool hasStorageAccessForFrame(const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID); > void setLastSeen(const URL&, Seconds, CompletionHandler<void()>&&); > void setPrevalentResource(const URL&, CompletionHandler<void()>&&); > void setVeryPrevalentResource(const URL&, CompletionHandler<void()>&&); >@@ -98,6 +108,9 @@ public: > void clearPrevalentResource(const URL&, CompletionHandler<void()>&&); > void setGrandfathered(const URL&, bool); > void isGrandfathered(const URL&, CompletionHandler<void(bool)>&&); >+ void removeAllStorageAccess(); >+ void removePrevalentDomains(const Vector<String>& domainsToBlock); >+ void setCacheMaxAgeCapForPrevalentResources(Seconds); > void setSubframeUnderTopFrameOrigin(const URL& subframe, const URL& topFrame); > void setSubresourceUnderTopFrameOrigin(const URL& subresource, const URL& topFrame); > void setSubresourceUniqueRedirectTo(const URL& subresource, const URL& hostNameRedirectedTo); >@@ -109,6 +122,7 @@ public: > void scheduleClearBlockingStateForDomains(const Vector<String>& domains, CompletionHandler<void()>&&); > void scheduleStatisticsAndDataRecordsProcessing(); > void submitTelemetry(); >+ void updatePrevalentDomainsToBlockCookiesFor(const Vector<String>& domainsToBlock); > > enum class ShouldGrandfather { > No, >@@ -140,9 +154,11 @@ public: > void didCreateNetworkProcess(); > > WebsiteDataStore* websiteDataStore() { return m_websiteDataStore.get(); } >+ NetworkSession* networkSession() { return m_networkSession.get(); } > > private: > explicit WebResourceLoadStatisticsStore(WebsiteDataStore&); >+ explicit WebResourceLoadStatisticsStore(NetworkSession&, const String&); > > void postTask(WTF::Function<void()>&&); > static void postTaskReply(WTF::Function<void()>&&); >@@ -161,6 +177,7 @@ private: > void flushAndDestroyPersistentStore(); > > WeakPtr<WebsiteDataStore> m_websiteDataStore; >+ WeakPtr<NetworkSession> m_networkSession; > Ref<WorkQueue> m_statisticsQueue; > std::unique_ptr<ResourceLoadStatisticsMemoryStore> m_memoryStore; > std::unique_ptr<ResourceLoadStatisticsPersistentStorage> m_persistentStorage; >diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.cpp b/Source/WebKit/NetworkProcess/NetworkProcess.cpp >index 16f9f7d0b17c32cdef895f309a06518e3ce7362f..4e31480b418fa4d72a9ef01fe4c68843e4af3cf5 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcess.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkProcess.cpp >@@ -54,6 +54,7 @@ > #include "WebCookieManager.h" > #include "WebPageProxyMessages.h" > #include "WebProcessPoolMessages.h" >+#include "WebResourceLoadStatisticsStore.h" > #include "WebSWOriginStore.h" > #include "WebSWServerConnection.h" > #include "WebSWServerToContextConnection.h" >@@ -301,6 +302,8 @@ void NetworkProcess::initializeNetworkProcess(NetworkProcessCreationParameters&& > if (parameters.shouldUseTestingNetworkSession) > NetworkStorageSession::switchToNewTestingSession(); > >+ SandboxExtension::consumePermanently(parameters.defaultDataStoreParameters.networkSessionParameters.resourceLoadStatisticsDirectoryExtensionHandle); >+ > auto sessionID = parameters.defaultDataStoreParameters.networkSessionParameters.sessionID; > SessionTracker::setSession(sessionID, NetworkSession::create(*this, WTFMove(parameters.defaultDataStoreParameters.networkSessionParameters))); > >@@ -523,6 +526,27 @@ void NetworkProcess::grantStorageAccess(PAL::SessionID sessionID, const String& > parentProcessConnection()->send(Messages::NetworkProcessProxy::StorageAccessRequestResult(isStorageGranted, contextId), 0); > } > >+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) >+{ >+ if (auto* networkSession = SessionTracker::networkSession(sessionID)) { >+ if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics()) >+ resourceLoadStatistics->logFrameNavigation(targetPrimaryDomain, mainFramePrimaryDomain, sourcePrimaryDomain, targetHost, mainFrameHost, isRedirect, isMainFrame); >+ } else >+ ASSERT_NOT_REACHED(); >+} >+ >+void NetworkProcess::logUserInteraction(PAL::SessionID sessionID, const String& targetPrimaryDomain, uint64_t contextId) >+{ >+ if (auto* networkSession = SessionTracker::networkSession(sessionID)) { >+ if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics()) { >+ resourceLoadStatistics->logUserInteraction(targetPrimaryDomain, [this, contextId] { >+ parentProcessConnection()->send(Messages::NetworkProcessProxy::DidLogUserInteraction(contextId), 0); >+ }); >+ } >+ } else >+ ASSERT_NOT_REACHED(); >+} >+ > void NetworkProcess::removeAllStorageAccess(PAL::SessionID sessionID, uint64_t contextId) > { > if (auto* networkStorageSession = NetworkStorageSession::storageSession(sessionID)) >diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.h b/Source/WebKit/NetworkProcess/NetworkProcess.h >index cec88ee5441b8f5d55774315932cbb49f591cfb3..33e75dac1ed712bb47c705ed214d551b64c677c6 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcess.h >+++ b/Source/WebKit/NetworkProcess/NetworkProcess.h >@@ -157,6 +157,8 @@ public: > 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, uint64_t contextId); >+ 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, uint64_t contextId); > void removeAllStorageAccess(PAL::SessionID, uint64_t contextId); > void removePrevalentDomains(PAL::SessionID, const Vector<String>& domains); > void setCacheMaxAgeCapForPrevalentResources(PAL::SessionID, Seconds, uint64_t contextId); >diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.messages.in b/Source/WebKit/NetworkProcess/NetworkProcess.messages.in >index 8d87224bf311e77e55a210873a4a7a543d1e1f02..8ba1675dc88e64b659acc9f413e86a5c1c36e7d9 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcess.messages.in >+++ b/Source/WebKit/NetworkProcess/NetworkProcess.messages.in >@@ -90,6 +90,8 @@ messages -> NetworkProcess LegacyReceiver { > HasStorageAccessForFrame(PAL::SessionID sessionID, String resourceDomain, String firstPartyDomain, uint64_t frameID, uint64_t pageID, uint64_t contextId) > GetAllStorageAccessEntries(PAL::SessionID sessionID, uint64_t contextId) > GrantStorageAccess(PAL::SessionID sessionID, String resourceDomain, String firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID, uint64_t contextId) >+ LogFrameNavigation(PAL::SessionID sessionID, String targetPrimaryDomain, String mainFramePrimaryDomain, String sourcePrimaryDomain, String targetHost, String mainFrameHost, bool isRedirect, bool isMainFrame) >+ LogUserInteraction(PAL::SessionID sessionID, String targetPrimaryDomain, uint64_t contextId) > RemoveAllStorageAccess(PAL::SessionID sessionID, uint64_t contextId) > RemovePrevalentDomains(PAL::SessionID sessionID, Vector<String> domainsWithInteraction) > SetCacheMaxAgeCapForPrevalentResources(PAL::SessionID sessionID, Seconds seconds, uint64_t contextId) >diff --git a/Source/WebKit/NetworkProcess/NetworkSession.cpp b/Source/WebKit/NetworkProcess/NetworkSession.cpp >index 5ba5c1cce4e6182a4cd2ecde0095066af549dbef..820546d85abfad43a9d690338cba4919b145c386 100644 >--- a/Source/WebKit/NetworkProcess/NetworkSession.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkSession.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 >@@ -26,6 +26,7 @@ > #include "config.h" > #include "NetworkSession.h" > >+#include "WebResourceLoadStatisticsStore.h" > #include <WebCore/NetworkStorageSession.h> > > #if PLATFORM(COCOA) >@@ -77,4 +78,12 @@ void NetworkSession::invalidateAndCancel() > task->invalidateAndCancel(); > } > >+void NetworkSession::enableResourceLoadStatistics() >+{ >+ if (m_resourceLoadStatistics) >+ return; >+ >+ m_resourceLoadStatistics = WebResourceLoadStatisticsStore::create(*this, m_resourceLoadStatisticsDirectory); >+} >+ > } // namespace WebKit >diff --git a/Source/WebKit/NetworkProcess/NetworkSession.h b/Source/WebKit/NetworkProcess/NetworkSession.h >index c0487da2ed1b9ecdfe471f9319f5219c29b92e6a..4292db757a9381b85a4b95ce325659a7fa39c7be 100644 >--- a/Source/WebKit/NetworkProcess/NetworkSession.h >+++ b/Source/WebKit/NetworkProcess/NetworkSession.h >@@ -30,6 +30,8 @@ > #include <wtf/Ref.h> > #include <wtf/RefCounted.h> > #include <wtf/Seconds.h> >+#include <wtf/WeakPtr.h> >+#include <wtf/text/WTFString.h> > > namespace WebCore { > class NetworkStorageSession; >@@ -39,9 +41,10 @@ namespace WebKit { > > class NetworkDataTask; > class NetworkProcess; >+class WebResourceLoadStatisticsStore; > struct NetworkSessionCreationParameters; > >-class NetworkSession : public RefCounted<NetworkSession> { >+class NetworkSession : public RefCounted<NetworkSession>, public CanMakeWeakPtr<NetworkSession> { > public: > static Ref<NetworkSession> create(NetworkProcess&, NetworkSessionCreationParameters&&); > virtual ~NetworkSession(); >@@ -58,12 +61,17 @@ public: > void registerNetworkDataTask(NetworkDataTask& task) { m_dataTaskSet.add(&task); } > void unregisterNetworkDataTask(NetworkDataTask& task) { m_dataTaskSet.remove(&task); } > >+ WebResourceLoadStatisticsStore* resourceLoadStatistics() const { return m_resourceLoadStatistics.get(); } >+ void enableResourceLoadStatistics(); >+ > protected: > NetworkSession(NetworkProcess&, PAL::SessionID); > > PAL::SessionID m_sessionID; > Ref<NetworkProcess> m_networkProcess; > HashSet<NetworkDataTask*> m_dataTaskSet; >+ String m_resourceLoadStatisticsDirectory; >+ RefPtr<WebResourceLoadStatisticsStore> m_resourceLoadStatistics; > }; > > } // namespace WebKit >diff --git a/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp b/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp >index 5d6454c37546688912d33023f1fd9afc82368d0e..270ae4320598966589e97a6a16b37548cbda7fce 100644 >--- a/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp >@@ -47,6 +47,7 @@ NetworkSessionCreationParameters NetworkSessionCreationParameters::privateSessio > #if USE(CURL) > , { }, { } > #endif >+ , { }, { }, false > }; > } > >@@ -68,6 +69,9 @@ void NetworkSessionCreationParameters::encode(IPC::Encoder& encoder) const > encoder << cookiePersistentStorageFile; > encoder << proxySettings; > #endif >+ encoder << resourceLoadStatisticsDirectory; >+ encoder << resourceLoadStatisticsDirectoryExtensionHandle; >+ encoder << enableResourceLoadStatistics; > } > > Optional<NetworkSessionCreationParameters> NetworkSessionCreationParameters::decode(IPC::Decoder& decoder) >@@ -133,7 +137,22 @@ Optional<NetworkSessionCreationParameters> NetworkSessionCreationParameters::dec > if (!proxySettings) > return WTF::nullopt; > #endif >- >+ >+ Optional<String> resourceLoadStatisticsDirectory; >+ decoder >> resourceLoadStatisticsDirectory; >+ if (!resourceLoadStatisticsDirectory) >+ return WTF::nullopt; >+ >+ Optional<SandboxExtension::Handle> resourceLoadStatisticsDirectoryExtensionHandle; >+ decoder >> resourceLoadStatisticsDirectoryExtensionHandle; >+ if (!resourceLoadStatisticsDirectoryExtensionHandle) >+ return WTF::nullopt; >+ >+ Optional<bool> enableResourceLoadStatistics; >+ decoder >> enableResourceLoadStatistics; >+ if (!enableResourceLoadStatistics) >+ return WTF::nullopt; >+ > return {{ > sessionID > , WTFMove(*boundInterfaceIdentifier) >@@ -151,6 +170,9 @@ Optional<NetworkSessionCreationParameters> NetworkSessionCreationParameters::dec > , WTFMove(*cookiePersistentStorageFile) > , WTFMove(*proxySettings) > #endif >+ , WTFMove(*resourceLoadStatisticsDirectory) >+ , WTFMove(*resourceLoadStatisticsDirectoryExtensionHandle) >+ , WTFMove(*enableResourceLoadStatistics) > }}; > } > >diff --git a/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h b/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h >index 09af3332313ceb718b4ff04d3016331911c94370..6f9de8b80138d41869d71cbf06db921cb943149e 100644 >--- a/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h >+++ b/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h >@@ -25,6 +25,7 @@ > > #pragma once > >+#include "SandboxExtension.h" > #include <pal/SessionID.h> > #include <wtf/Seconds.h> > #include <wtf/URL.h> >@@ -69,6 +70,9 @@ struct NetworkSessionCreationParameters { > String cookiePersistentStorageFile; > WebCore::CurlProxySettings proxySettings; > #endif >+ String resourceLoadStatisticsDirectory; >+ SandboxExtension::Handle resourceLoadStatisticsDirectoryExtensionHandle; >+ bool enableResourceLoadStatistics { false }; > }; > > } // namespace WebKit >diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >index 36554d3431962388c40213c10ba09992d87f377a..2d9bee32b1778e0b5ad3ce8b6b07f902d103372f 100644 >--- a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >+++ b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >@@ -932,6 +932,10 @@ NetworkSessionCocoa::NetworkSessionCocoa(NetworkProcess& networkProcess, Network > > m_statelessSessionDelegate = adoptNS([[WKNetworkSessionDelegate alloc] initWithNetworkSession:*this withCredentials:false]); > m_statelessSession = [NSURLSession sessionWithConfiguration:configuration delegate:static_cast<id>(m_statelessSessionDelegate.get()) delegateQueue:[NSOperationQueue mainQueue]]; >+ >+ m_resourceLoadStatisticsDirectory = parameters.resourceLoadStatisticsDirectory; >+ if (parameters.enableResourceLoadStatistics) >+ enableResourceLoadStatistics(); > } > > NetworkSessionCocoa::~NetworkSessionCocoa() >diff --git a/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp b/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp >index 4a791f35c30face474d459f1f22225f86d9595da..f74edf8e67988cee691dcbded3faefe2093d0378 100644 >--- a/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp >+++ b/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp >@@ -419,6 +419,13 @@ void NetworkProcessProxy::didUpdateBlockCookies(uint64_t callbackId) > m_updateBlockCookiesCallbackMap.take(callbackId)(); > } > >+void NetworkProcessProxy::didLogUserInteraction(uint64_t contextId) >+{ >+ // FIXME(193297): Implement when activating automated test cases. >+ UNUSED_PARAM(contextId); >+ notImplemented(); >+} >+ > void NetworkProcessProxy::setAgeCapForClientSideCookies(PAL::SessionID sessionID, Optional<Seconds> seconds, CompletionHandler<void()>&& completionHandler) > { > if (!canSendMessage()) { >diff --git a/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h b/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h >index 4fe5ce7a456edb5b432c018f377b39243cfa547e..e348a85b954de28fa511c38f12da506c88819786 100644 >--- a/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h >+++ b/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h >@@ -142,6 +142,7 @@ private: > void logDiagnosticMessageWithResult(uint64_t pageID, const String& message, const String& description, uint32_t result, WebCore::ShouldSample); > void logDiagnosticMessageWithValue(uint64_t pageID, const String& message, const String& description, double value, unsigned significantFigures, WebCore::ShouldSample); > #if ENABLE(RESOURCE_LOAD_STATISTICS) >+ void didLogUserInteraction(uint64_t contextId); > void didUpdateBlockCookies(uint64_t contextId); > void didSetAgeCapForClientSideCookies(uint64_t contextId); > void storageAccessRequestResult(bool wasGranted, uint64_t contextId); >diff --git a/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in b/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in >index b5641f969050820d55ef87d8be058991c9c763cc..2aae3eb4a872afb507137a313cf78caa68ac1c30 100644 >--- a/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in >+++ b/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in >@@ -40,6 +40,7 @@ messages -> NetworkProcessProxy LegacyReceiver { > LogDiagnosticMessageWithValue(uint64_t pageID, String message, String description, double value, unsigned significantFigures, enum:bool WebCore::ShouldSample shouldSample) > > #if ENABLE(RESOURCE_LOAD_STATISTICS) >+ DidLogUserInteraction(uint64_t callbackId) > DidUpdateBlockCookies(uint64_t callbackId) > DidSetAgeCapForClientSideCookies(uint64_t callbackId) > StorageAccessRequestResult(bool wasGranted, uint64_t contextId) >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index a298e3ff44f1b864ec83ea5cab60c1cabbbb6c27..d8a1f846439ca48c46f230624889cae381f0c2e4 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -221,10 +221,6 @@ > #include "WebAuthenticatorCoordinatorProxy.h" > #endif > >-#if ENABLE(RESOURCE_LOAD_STATISTICS) >-#include "WebResourceLoadStatisticsStore.h" >-#endif >- > #if ENABLE(REMOTE_INSPECTOR) > #include <JavaScriptCore/RemoteInspector.h> > #endif >@@ -4455,8 +4451,11 @@ void WebPageProxy::decidePolicyForNavigationAction(WebFrameProxy& frame, WebCore > API::Navigation* mainFrameNavigation = frame.isMainFrame() ? navigation.get() : nullptr; > WebFrameProxy* originatingFrame = m_process->webFrame(originatingFrameInfoData.frameID); > >+#if ENABLE(RESOURCE_LOAD_STATISTICS) > if (auto* resourceLoadStatisticsStore = websiteDataStore().resourceLoadStatistics()) > resourceLoadStatisticsStore->logFrameNavigation(frame, URL(URL(), m_pageLoadState.url()), request, redirectResponse.url()); >+ logFrameNavigation(frame, URL(URL(), m_pageLoadState.url()), request, redirectResponse.url()); >+#endif > > if (m_policyClient) > m_policyClient->decidePolicyForNavigationAction(*this, &frame, WTFMove(navigationActionData), originatingFrame, originalRequest, WTFMove(request), WTFMove(listener), m_process->transformHandlesToObjects(userData.object()).get()); >@@ -4479,6 +4478,38 @@ void WebPageProxy::decidePolicyForNavigationAction(WebFrameProxy& frame, WebCore > m_shouldSuppressAppLinksInNextNavigationPolicyDecision = false; > } > >+#if ENABLE(RESOURCE_LOAD_STATISTICS) >+void WebPageProxy::logFrameNavigation(const WebFrameProxy& frame, const URL& pageURL, const WebCore::ResourceRequest& request, const URL& redirectURL) >+{ >+ ASSERT(RunLoop::isMain()); >+ >+ auto sourceURL = redirectURL; >+ bool isRedirect = !redirectURL.isNull(); >+ if (!isRedirect) { >+ sourceURL = frame.url(); >+ if (sourceURL.isNull()) >+ sourceURL = pageURL; >+ } >+ >+ auto& targetURL = request.url(); >+ >+ if (!targetURL.isValid() || !pageURL.isValid()) >+ return; >+ >+ auto targetHost = targetURL.host(); >+ auto mainFrameHost = pageURL.host(); >+ >+ if (targetHost.isEmpty() || mainFrameHost.isEmpty() || targetHost == sourceURL.host()) >+ return; >+ >+ auto targetPrimaryDomain = ResourceLoadStatistics::primaryDomain(targetURL); >+ auto mainFramePrimaryDomain = ResourceLoadStatistics::primaryDomain(pageURL); >+ auto sourcePrimaryDomain = ResourceLoadStatistics::primaryDomain(sourceURL); >+ >+ m_process->processPool().sendToNetworkingProcess(Messages::NetworkProcess::LogFrameNavigation(m_websiteDataStore->sessionID(), targetPrimaryDomain, mainFramePrimaryDomain, sourcePrimaryDomain, targetHost.toString(), mainFrameHost.toString(), isRedirect, frame.isMainFrame())); >+} >+#endif >+ > void WebPageProxy::decidePolicyForNavigationActionSync(uint64_t frameID, bool isMainFrame, WebCore::SecurityOriginData&& frameSecurityOrigin, uint64_t navigationID, NavigationActionData&& navigationActionData, FrameInfoData&& frameInfoData, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&& request, IPC::FormDataReference&& requestBody, WebCore::ResourceResponse&& redirectResponse, const UserData& userData, Messages::WebPageProxy::DecidePolicyForNavigationActionSync::DelayedReply&& reply) > { > auto sender = PolicyDecisionSender::create(WTFMove(reply)); >diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h >index 456c8a29ec38675668dd5ccb21e45538f97799df..c0e5b1fee7e3408b40c1388563ef865f712a536e 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.h >+++ b/Source/WebKit/UIProcess/WebPageProxy.h >@@ -1907,6 +1907,10 @@ private: > void setNeedsFontAttributes(bool); > void updateFontAttributesAfterEditorStateChange(); > >+#if ENABLE(RESOURCE_LOAD_STATISTICS) >+ void logFrameNavigation(const WebFrameProxy&, const URL& pageURL, const WebCore::ResourceRequest&, const URL& redirectURL); >+#endif >+ > WeakPtr<PageClient> m_pageClient; > Ref<API::PageConfiguration> m_configuration; > >diff --git a/Source/WebKit/UIProcess/WebProcessPool.cpp b/Source/WebKit/UIProcess/WebProcessPool.cpp >index 2578d3cb40acac8e9c293d67a10b757306b46983..eba3a2bf2563c69d1f2edde37ed21147f7badc66 100644 >--- a/Source/WebKit/UIProcess/WebProcessPool.cpp >+++ b/Source/WebKit/UIProcess/WebProcessPool.cpp >@@ -548,6 +548,15 @@ NetworkProcessProxy& WebProcessPool::ensureNetworkProcess(WebsiteDataStore* with > parameters.shouldDisableServiceWorkerProcessTerminationDelay = m_shouldDisableServiceWorkerProcessTerminationDelay; > #endif > >+ if (m_websiteDataStore) >+ parameters.defaultDataStoreParameters.networkSessionParameters.resourceLoadStatisticsDirectory = m_websiteDataStore->websiteDataStore().resolvedResourceLoadStatisticsDirectory(); >+ if (parameters.defaultDataStoreParameters.networkSessionParameters.resourceLoadStatisticsDirectory.isEmpty()) >+ parameters.defaultDataStoreParameters.networkSessionParameters.resourceLoadStatisticsDirectory = API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory(); >+ >+ SandboxExtension::createHandleForReadWriteDirectory(parameters.defaultDataStoreParameters.networkSessionParameters.resourceLoadStatisticsDirectory, parameters.defaultDataStoreParameters.networkSessionParameters.resourceLoadStatisticsDirectoryExtensionHandle); >+ >+ parameters.defaultDataStoreParameters.networkSessionParameters.enableResourceLoadStatistics = true; // FIXME(193297): Turn on when the feature is on. >+ > // Add any platform specific parameters > platformInitializeNetworkProcess(parameters); > >diff --git a/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm b/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm >index 877edd4beaf4ee15c27dd0d24701c5f6bd437c64..069d4b9b0ac366f2ad80083ad8ce518aaf569fac 100644 >--- a/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm >+++ b/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm >@@ -83,6 +83,11 @@ WebsiteDataStoreParameters WebsiteDataStore::parameters() > if (!httpsProxy.isValid() && isSafari) > httpsProxy = URL(URL(), [defaults stringForKey:(NSString *)WebKit2HTTPSProxyDefaultsKey]); > >+ auto resourceLoadStatisticsDirectory = m_configuration->resourceLoadStatisticsDirectory(); >+ SandboxExtension::Handle resourceLoadStatisticsDirectoryHandle; >+ if (!resourceLoadStatisticsDirectory.isEmpty()) >+ SandboxExtension::createHandleForReadWriteDirectory(resourceLoadStatisticsDirectory, resourceLoadStatisticsDirectoryHandle); >+ > WebsiteDataStoreParameters parameters; > parameters.networkSessionParameters = { > m_sessionID, >@@ -95,6 +100,9 @@ WebsiteDataStoreParameters WebsiteDataStore::parameters() > Seconds { [defaults integerForKey:WebKitNetworkLoadThrottleLatencyMillisecondsDefaultsKey] / 1000. }, > WTFMove(httpProxy), > WTFMove(httpsProxy), >+ WTFMove(resourceLoadStatisticsDirectory), >+ WTFMove(resourceLoadStatisticsDirectoryHandle), >+ false // FIXME(193297): Switch to m_configuration->resourceLoadStatisticsEnabled() > }; > > auto cookieFile = resolvedCookieStorageFile();
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 193261
:
358738
|
358746
|
358760
|
358769