<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[287229] trunk/Source/WebKit</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/287229">287229</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2021-12-18 12:30:27 -0800 (Sat, 18 Dec 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move CacheStorage engines from NetworkProcess to NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=234448

Reviewed by Alex Christensen.

Move CacheStorage engines from NetworkProcess to NetworkSession, as they are per-session.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::destroySession):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains):
(WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
(WebKit::NetworkProcess::~NetworkProcess): Deleted.
(WebKit::NetworkProcess::findCacheEngine): Deleted.
(WebKit::NetworkProcess::ensureCacheEngine): Deleted.
(WebKit::NetworkProcess::removeCacheEngine): Deleted.
(WebKit::NetworkProcess::cacheStorageRootPath): Deleted.
(WebKit::NetworkProcess::setCacheStorageParameters): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::invalidateAndCancel):
(WebKit::NetworkSession::ensureCacheEngine):
(WebKit::NetworkSession::clearCacheEngine):
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::cacheEngine):
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::create):
(WebKit::CacheStorage::Engine::fetchEntries):
(WebKit::CacheStorage::Engine::open):
(WebKit::CacheStorage::Engine::remove):
(WebKit::CacheStorage::Engine::retrieveCaches):
(WebKit::CacheStorage::Engine::retrieveRecords):
(WebKit::CacheStorage::Engine::putRecords):
(WebKit::CacheStorage::Engine::deleteMatchingRecords):
(WebKit::CacheStorage::Engine::lock):
(WebKit::CacheStorage::Engine::unlock):
(WebKit::CacheStorage::Engine::clearMemoryRepresentation):
(WebKit::CacheStorage::Engine::representation):
(WebKit::CacheStorage::Engine::clearAllCaches):
(WebKit::CacheStorage::Engine::clearCachesForOrigin):
(WebKit::CacheStorage::Engine::Engine):
(WebKit::CacheStorage::Engine::from): Deleted.
(WebKit::CacheStorage::Engine::destroyEngine): Deleted.
* NetworkProcess/cache/CacheStorageEngine.h:
* NetworkProcess/cache/CacheStorageEngineConnection.cpp:
(WebKit::CacheStorageEngineConnection::~CacheStorageEngineConnection):
(WebKit::CacheStorageEngineConnection::open):
(WebKit::CacheStorageEngineConnection::remove):
(WebKit::CacheStorageEngineConnection::caches):
(WebKit::CacheStorageEngineConnection::retrieveRecords):
(WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
(WebKit::CacheStorageEngineConnection::putRecords):
(WebKit::CacheStorageEngineConnection::reference):
(WebKit::CacheStorageEngineConnection::dereference):
(WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
(WebKit::CacheStorageEngineConnection::engineRepresentation):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkProcesscpp">trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkProcessh">trunk/Source/WebKit/NetworkProcess/NetworkProcess.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkProcessmessagesin">trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkSessioncpp">trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkSessionh">trunk/Source/WebKit/NetworkProcess/NetworkSession.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcesscacheCacheStorageEnginecpp">trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcesscacheCacheStorageEngineh">trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcesscacheCacheStorageEngineConnectioncpp">trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessNetworkNetworkProcessProxycpp">trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessNetworkNetworkProcessProxyh">trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessNetworkNetworkProcessProxymessagesin">trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (287228 => 287229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-12-18 20:11:35 UTC (rev 287228)
+++ trunk/Source/WebKit/ChangeLog       2021-12-18 20:30:27 UTC (rev 287229)
</span><span class="lines">@@ -1,3 +1,69 @@
</span><ins>+2021-12-18  Chris Dumez  <cdumez@apple.com>
+
+        Move CacheStorage engines from NetworkProcess to NetworkSession
+        https://bugs.webkit.org/show_bug.cgi?id=234448
+
+        Reviewed by Alex Christensen.
+
+        Move CacheStorage engines from NetworkProcess to NetworkSession, as they are per-session.
+
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::destroySession):
+        (WebKit::NetworkProcess::fetchWebsiteData):
+        (WebKit::NetworkProcess::deleteWebsiteData):
+        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
+        (WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains):
+        (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
+        (WebKit::NetworkProcess::~NetworkProcess): Deleted.
+        (WebKit::NetworkProcess::findCacheEngine): Deleted.
+        (WebKit::NetworkProcess::ensureCacheEngine): Deleted.
+        (WebKit::NetworkProcess::removeCacheEngine): Deleted.
+        (WebKit::NetworkProcess::cacheStorageRootPath): Deleted.
+        (WebKit::NetworkProcess::setCacheStorageParameters): Deleted.
+        * NetworkProcess/NetworkProcess.h:
+        * NetworkProcess/NetworkProcess.messages.in:
+        * NetworkProcess/NetworkSession.cpp:
+        (WebKit::NetworkSession::invalidateAndCancel):
+        (WebKit::NetworkSession::ensureCacheEngine):
+        (WebKit::NetworkSession::clearCacheEngine):
+        * NetworkProcess/NetworkSession.h:
+        (WebKit::NetworkSession::cacheEngine):
+        * NetworkProcess/cache/CacheStorageEngine.cpp:
+        (WebKit::CacheStorage::Engine::create):
+        (WebKit::CacheStorage::Engine::fetchEntries):
+        (WebKit::CacheStorage::Engine::open):
+        (WebKit::CacheStorage::Engine::remove):
+        (WebKit::CacheStorage::Engine::retrieveCaches):
+        (WebKit::CacheStorage::Engine::retrieveRecords):
+        (WebKit::CacheStorage::Engine::putRecords):
+        (WebKit::CacheStorage::Engine::deleteMatchingRecords):
+        (WebKit::CacheStorage::Engine::lock):
+        (WebKit::CacheStorage::Engine::unlock):
+        (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
+        (WebKit::CacheStorage::Engine::representation):
+        (WebKit::CacheStorage::Engine::clearAllCaches):
+        (WebKit::CacheStorage::Engine::clearCachesForOrigin):
+        (WebKit::CacheStorage::Engine::Engine):
+        (WebKit::CacheStorage::Engine::from): Deleted.
+        (WebKit::CacheStorage::Engine::destroyEngine): Deleted.
+        * NetworkProcess/cache/CacheStorageEngine.h:
+        * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
+        (WebKit::CacheStorageEngineConnection::~CacheStorageEngineConnection):
+        (WebKit::CacheStorageEngineConnection::open):
+        (WebKit::CacheStorageEngineConnection::remove):
+        (WebKit::CacheStorageEngineConnection::caches):
+        (WebKit::CacheStorageEngineConnection::retrieveRecords):
+        (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
+        (WebKit::CacheStorageEngineConnection::putRecords):
+        (WebKit::CacheStorageEngineConnection::reference):
+        (WebKit::CacheStorageEngineConnection::dereference):
+        (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
+        (WebKit::CacheStorageEngineConnection::engineRepresentation):
+        * UIProcess/Network/NetworkProcessProxy.cpp:
+        (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
+        * UIProcess/Network/NetworkProcessProxy.h:
+        * UIProcess/Network/NetworkProcessProxy.messages.in:
+
</ins><span class="cx"> 2021-12-17  Simon Fraser  <simon.fraser@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Read the default value of the ScrollAnimatorEnabled setting from NSUserDefaults
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp (287228 => 287229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp    2021-12-18 20:11:35 UTC (rev 287228)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp       2021-12-18 20:30:27 UTC (rev 287229)
</span><span class="lines">@@ -185,13 +185,7 @@
</span><span class="cx">     initialize(WTFMove(parameters));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-NetworkProcess::~NetworkProcess()
-{
-    for (auto& callbacks : m_cacheStorageParametersCallbacks.values()) {
-        for (auto& callback : callbacks)
-            callback(String { });
-    }
-}
</del><ins>+NetworkProcess::~NetworkProcess() = default;
</ins><span class="cx"> 
</span><span class="cx"> AuthenticationManager& NetworkProcess::authenticationManager()
</span><span class="cx"> {
</span><span class="lines">@@ -538,7 +532,6 @@
</span><span class="cx">         session->invalidateAndCancel();
</span><span class="cx">     m_networkStorageSessions.remove(sessionID);
</span><span class="cx">     m_sessionsControlledByAutomation.remove(sessionID);
</span><del>-    CacheStorage::Engine::destroyEngine(*this, sessionID);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
</span><span class="lines">@@ -1447,8 +1440,8 @@
</span><span class="cx">             callbackAggregator->m_websiteData.entries.append({ securityOrigin, WebsiteDataType::Credentials, 0 });
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (websiteDataTypes.contains(WebsiteDataType::DOMCache)) {
-        CacheStorage::Engine::fetchEntries(*this, sessionID, fetchOptions.contains(WebsiteDataFetchOption::ComputeSizes), [callbackAggregator](auto entries) mutable {
</del><ins>+    if (websiteDataTypes.contains(WebsiteDataType::DOMCache) && session) {
+        CacheStorage::Engine::fetchEntries(*session, fetchOptions.contains(WebsiteDataFetchOption::ComputeSizes), [callbackAggregator](auto entries) mutable {
</ins><span class="cx">             callbackAggregator->m_websiteData.entries.appendVector(entries);
</span><span class="cx">         });
</span><span class="cx">     }
</span><span class="lines">@@ -1528,8 +1521,8 @@
</span><span class="cx"> 
</span><span class="cx">     auto clearTasksHandler = WTF::CallbackAggregator::create(WTFMove(completionHandler));
</span><span class="cx"> 
</span><del>-    if (websiteDataTypes.contains(WebsiteDataType::DOMCache))
-        CacheStorage::Engine::clearAllCaches(*this, sessionID, [clearTasksHandler] { });
</del><ins>+    if (websiteDataTypes.contains(WebsiteDataType::DOMCache) && session)
+        CacheStorage::Engine::clearAllCaches(*session, [clearTasksHandler] { });
</ins><span class="cx"> 
</span><span class="cx">     if (websiteDataTypes.contains(WebsiteDataType::IndexedDBDatabases) && !sessionID.isEphemeral() && session)
</span><span class="cx">         session->ensureWebIDBServer().closeAndDeleteDatabasesModifiedSince(modifiedSince, [clearTasksHandler] { });
</span><span class="lines">@@ -1621,9 +1614,9 @@
</span><span class="cx">             session->clearPrivateClickMeasurementForRegistrableDomain(RegistrableDomain::uncheckedCreateFromHost(originData.host), [clearTasksHandler] { });
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (websiteDataTypes.contains(WebsiteDataType::DOMCache)) {
</del><ins>+    if (websiteDataTypes.contains(WebsiteDataType::DOMCache) && session) {
</ins><span class="cx">         for (auto& originData : originDatas)
</span><del>-            CacheStorage::Engine::clearCachesForOrigin(*this, sessionID, SecurityOriginData { originData }, [clearTasksHandler] { });
</del><ins>+            CacheStorage::Engine::clearCachesForOrigin(*session, SecurityOriginData { originData }, [clearTasksHandler] { });
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (websiteDataTypes.contains(WebsiteDataType::IndexedDBDatabases) && !sessionID.isEphemeral() && session)
</span><span class="lines">@@ -1803,8 +1796,8 @@
</span><span class="cx">         WebCore::CredentialStorage::removeSessionCredentialsWithOrigins(originsToDelete);
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    if (websiteDataTypes.contains(WebsiteDataType::DOMCache)) {
-        CacheStorage::Engine::fetchEntries(*this, sessionID, fetchOptions.contains(WebsiteDataFetchOption::ComputeSizes), [this, domainsToDeleteAllNonCookieWebsiteDataFor, sessionID, callbackAggregator](auto entries) mutable {
</del><ins>+    if (websiteDataTypes.contains(WebsiteDataType::DOMCache) && session) {
+        CacheStorage::Engine::fetchEntries(*session, fetchOptions.contains(WebsiteDataFetchOption::ComputeSizes), [domainsToDeleteAllNonCookieWebsiteDataFor, session = WeakPtr { session }, callbackAggregator](auto entries) mutable {
</ins><span class="cx">             
</span><span class="cx">             auto entriesToDelete = filterForRegistrableDomains(domainsToDeleteAllNonCookieWebsiteDataFor, entries);
</span><span class="cx"> 
</span><span class="lines">@@ -1811,8 +1804,10 @@
</span><span class="cx">             for (const auto& entry : entriesToDelete)
</span><span class="cx">                 callbackAggregator->m_domains.add(RegistrableDomain::uncheckedCreateFromHost(entry.origin.host));
</span><span class="cx"> 
</span><del>-            for (auto& entry : entriesToDelete)
-                CacheStorage::Engine::clearCachesForOrigin(*this, sessionID, SecurityOriginData { entry.origin }, [callbackAggregator] { });
</del><ins>+            if (session) {
+                for (auto& entry : entriesToDelete)
+                    CacheStorage::Engine::clearCachesForOrigin(*session, SecurityOriginData { entry.origin }, [callbackAggregator] { });
+            }
</ins><span class="cx">         });
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1956,8 +1951,8 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    if (websiteDataTypes.contains(WebsiteDataType::DOMCache)) {
-        CacheStorage::Engine::fetchEntries(*this, sessionID, fetchOptions.contains(WebsiteDataFetchOption::ComputeSizes), [callbackAggregator](auto entries) mutable {
</del><ins>+    if (websiteDataTypes.contains(WebsiteDataType::DOMCache) && session) {
+        CacheStorage::Engine::fetchEntries(*session, fetchOptions.contains(WebsiteDataFetchOption::ComputeSizes), [callbackAggregator](auto entries) mutable {
</ins><span class="cx">             callbackAggregator->m_websiteData.entries.appendVector(entries);
</span><span class="cx">         });
</span><span class="cx">     }
</span><span class="lines">@@ -1994,21 +1989,6 @@
</span><span class="cx"> }
</span><span class="cx"> #endif // ENABLE(INTELLIGENT_TRACKING_PREVENTION)
</span><span class="cx"> 
</span><del>-CacheStorage::Engine* NetworkProcess::findCacheEngine(PAL::SessionID sessionID)
-{
-    return m_cacheEngines.get(sessionID);
-}
-
-CacheStorage::Engine& NetworkProcess::ensureCacheEngine(PAL::SessionID sessionID, Function<Ref<CacheStorage::Engine>()>&& functor)
-{
-    return m_cacheEngines.ensure(sessionID, WTFMove(functor)).iterator->value;
-}
-
-void NetworkProcess::removeCacheEngine(PAL::SessionID sessionID)
-{
-    m_cacheEngines.remove(sessionID);
-}
-
</del><span class="cx"> void NetworkProcess::downloadRequest(PAL::SessionID sessionID, DownloadID downloadID, const ResourceRequest& request, std::optional<NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain, const String& suggestedFilename)
</span><span class="cx"> {
</span><span class="cx">     downloadManager().startDownload(sessionID, downloadID, request, isNavigatingToAppBoundDomain, suggestedFilename);
</span><span class="lines">@@ -2250,27 +2230,6 @@
</span><span class="cx">     WebCore::prefetchDNS(hostname);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkProcess::cacheStorageRootPath(PAL::SessionID sessionID, CacheStorageRootPathCallback&& callback)
-{
-    m_cacheStorageParametersCallbacks.ensure(sessionID, [&] {
-        parentProcessConnection()->send(Messages::NetworkProcessProxy::RetrieveCacheStorageParameters { sessionID }, 0);
-        return Vector<CacheStorageRootPathCallback> { };
-    }).iterator->value.append(WTFMove(callback));
-}
-
-void NetworkProcess::setCacheStorageParameters(PAL::SessionID sessionID, String&& cacheStorageDirectory, SandboxExtension::Handle&& handle)
-{
-    auto iterator = m_cacheStorageParametersCallbacks.find(sessionID);
-    if (iterator == m_cacheStorageParametersCallbacks.end())
-        return;
-
-    SandboxExtension::consumePermanently(handle);
-    auto callbacks = WTFMove(iterator->value);
-    m_cacheStorageParametersCallbacks.remove(iterator);
-    for (auto& callback : callbacks)
-        callback(String { cacheStorageDirectory });
-}
-
</del><span class="cx"> void NetworkProcess::registerURLSchemeAsSecure(const String& scheme) const
</span><span class="cx"> {
</span><span class="cx">     LegacySchemeRegistry::registerURLSchemeAsSecure(scheme);
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.h (287228 => 287229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.h      2021-12-18 20:11:35 UTC (rev 287228)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.h 2021-12-18 20:30:27 UTC (rev 287229)
</span><span class="lines">@@ -276,9 +276,6 @@
</span><span class="cx">     bool privateClickMeasurementEnabled() const;
</span><span class="cx">     void setPrivateClickMeasurementDebugMode(PAL::SessionID, bool);
</span><span class="cx"> 
</span><del>-    using CacheStorageRootPathCallback = CompletionHandler<void(String&&)>;
-    void cacheStorageRootPath(PAL::SessionID, CacheStorageRootPathCallback&&);
-
</del><span class="cx">     void preconnectTo(PAL::SessionID, WebPageProxyIdentifier, WebCore::PageIdentifier, const URL&, const String&, WebCore::StoredCredentialsPolicy, std::optional<NavigatingToAppBoundDomain>, LastNavigationWasAppInitiated);
</span><span class="cx"> 
</span><span class="cx">     void setSessionIsControlledByAutomation(PAL::SessionID, bool);
</span><span class="lines">@@ -311,9 +308,6 @@
</span><span class="cx">     void ref() const override { ThreadSafeRefCounted<NetworkProcess>::ref(); }
</span><span class="cx">     void deref() const override { ThreadSafeRefCounted<NetworkProcess>::deref(); }
</span><span class="cx"> 
</span><del>-    CacheStorage::Engine* findCacheEngine(PAL::SessionID);
-    CacheStorage::Engine& ensureCacheEngine(PAL::SessionID, Function<Ref<CacheStorage::Engine>()>&&);
-    void removeCacheEngine(PAL::SessionID);
</del><span class="cx">     void requestStorageSpace(PAL::SessionID, const WebCore::ClientOrigin&, uint64_t quota, uint64_t currentSize, uint64_t spaceRequired, CompletionHandler<void(std::optional<uint64_t>)>&&);
</span><span class="cx"> 
</span><span class="cx">     void storePrivateClickMeasurement(PAL::SessionID, WebCore::PrivateClickMeasurement&&);
</span><span class="lines">@@ -425,7 +419,6 @@
</span><span class="cx"> 
</span><span class="cx">     void clearCachedCredentials(PAL::SessionID);
</span><span class="cx"> 
</span><del>-    void setCacheStorageParameters(PAL::SessionID, String&& cacheStorageDirectory, SandboxExtension::Handle&&);
</del><span class="cx">     void initializeQuotaUsers(WebCore::StorageQuotaManager&, PAL::SessionID, const WebCore::ClientOrigin&);
</span><span class="cx"> 
</span><span class="cx">     // FIXME: This should take a session ID so we can identify which disk cache to delete.
</span><span class="lines">@@ -528,13 +521,10 @@
</span><span class="cx">     String m_uiProcessBundleIdentifier;
</span><span class="cx">     DownloadManager m_downloadManager;
</span><span class="cx"> 
</span><del>-    HashMap<PAL::SessionID, Ref<CacheStorage::Engine>> m_cacheEngines;
-
</del><span class="cx">     typedef HashMap<const char*, std::unique_ptr<NetworkProcessSupplement>, PtrHash<const char*>> NetworkProcessSupplementMap;
</span><span class="cx">     NetworkProcessSupplementMap m_supplements;
</span><span class="cx"> 
</span><span class="cx">     HashSet<PAL::SessionID> m_sessionsControlledByAutomation;
</span><del>-    HashMap<PAL::SessionID, Vector<CacheStorageRootPathCallback>> m_cacheStorageParametersCallbacks;
</del><span class="cx"> 
</span><span class="cx">     HashMap<PAL::SessionID, std::unique_ptr<NetworkSession>> m_networkSessions;
</span><span class="cx">     HashMap<PAL::SessionID, std::unique_ptr<WebCore::NetworkStorageSession>> m_networkStorageSessions;
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in (287228 => 287229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in    2021-12-18 20:11:35 UTC (rev 287228)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in       2021-12-18 20:30:27 UTC (rev 287229)
</span><span class="lines">@@ -156,8 +156,6 @@
</span><span class="cx">     RegisterURLSchemeAsLocal(String scheme)
</span><span class="cx">     RegisterURLSchemeAsNoAccess(String scheme)
</span><span class="cx"> 
</span><del>-    SetCacheStorageParameters(PAL::SessionID sessionID, String cacheStorageDirectory, WebKit::SandboxExtension::Handle handle);
-
</del><span class="cx">     SyncLocalStorage() -> () Async
</span><span class="cx"> 
</span><span class="cx">     StorePrivateClickMeasurement(PAL::SessionID sessionID, WebCore::PrivateClickMeasurement privateClickMeasurement)
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkSessioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp (287228 => 287229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp    2021-12-18 20:11:35 UTC (rev 287228)
+++ trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp       2021-12-18 20:30:27 UTC (rev 287229)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "NetworkSession.h"
</span><span class="cx"> 
</span><ins>+#include "CacheStorageEngine.h"
</ins><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "NetworkBroadcastChannelRegistry.h"
</span><span class="cx"> #include "NetworkLoadScheduler.h"
</span><span class="lines">@@ -204,6 +205,7 @@
</span><span class="cx">         server->close();
</span><span class="cx">     if (auto manager = std::exchange(m_storageManager, nullptr))
</span><span class="cx">         manager->close();
</span><ins>+    m_cacheEngine = nullptr;
</ins><span class="cx"> #if ASSERT_ENABLED
</span><span class="cx">     m_isInvalidated = true;
</span><span class="cx"> #endif
</span><span class="lines">@@ -699,4 +701,30 @@
</span><span class="cx">     m_storageManager = NetworkStorageManager::create(sessionID(), generalStoragePath, localStoragePath);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void NetworkSession::ensureCacheEngine(Function<void(CacheStorage::Engine&)>&& callback)
+{
+    if (m_cacheEngine)
+        return callback(*m_cacheEngine);
+
+    m_cacheStorageParametersCallbacks.append(WTFMove(callback));
+    if (m_cacheStorageParametersCallbacks.size() > 1)
+        return;
+
+    m_networkProcess->parentProcessConnection()->sendWithAsyncReply(Messages::NetworkProcessProxy::RetrieveCacheStorageParameters { sessionID() }, [this, weakThis = WeakPtr { *this }](String&& cacheStorageDirectory, SandboxExtension::Handle&& cacheStorageDirectoryHandle) {
+        if (!weakThis)
+            return;
+
+        SandboxExtension::consumePermanently(cacheStorageDirectoryHandle);
+        ASSERT(!m_cacheEngine);
+        m_cacheEngine = CacheStorage::Engine::create(*this, WTFMove(cacheStorageDirectory));
+        for (auto& callback : std::exchange(m_cacheStorageParametersCallbacks, { }))
+            callback(*m_cacheEngine);
+    }, 0);
+}
+
+void NetworkSession::clearCacheEngine()
+{
+    m_cacheEngine = nullptr;
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkSessionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkSession.h (287228 => 287229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkSession.h      2021-12-18 20:11:35 UTC (rev 287228)
+++ trunk/Source/WebKit/NetworkProcess/NetworkSession.h 2021-12-18 20:30:27 UTC (rev 287229)
</span><span class="lines">@@ -86,6 +86,10 @@
</span><span class="cx"> 
</span><span class="cx"> enum class WebsiteDataType : uint32_t;
</span><span class="cx"> 
</span><ins>+namespace CacheStorage {
+class Engine;
+}
+
</ins><span class="cx"> namespace NetworkCache {
</span><span class="cx"> class Cache;
</span><span class="cx"> }
</span><span class="lines">@@ -214,6 +218,10 @@
</span><span class="cx">     NetworkStorageManager* storageManager() { return m_storageManager.get(); }
</span><span class="cx">     void addStorageManagerSession(const String& generalStoragePath, SandboxExtension::Handle& generalStoragePathHandle, const String& localStoragePath, SandboxExtension::Handle& localStoragePathHandle);
</span><span class="cx"> 
</span><ins>+    CacheStorage::Engine* cacheEngine() { return m_cacheEngine.get(); }
+    void ensureCacheEngine(Function<void(CacheStorage::Engine&)>&&);
+    void clearCacheEngine();
+
</ins><span class="cx">     NetworkLoadScheduler& networkLoadScheduler();
</span><span class="cx">     PCM::ManagerInterface& privateClickMeasurement() { return m_privateClickMeasurement.get(); }
</span><span class="cx">     void setPrivateClickMeasurementDebugMode(bool);
</span><span class="lines">@@ -310,6 +318,8 @@
</span><span class="cx">     RefPtr<WebIDBServer> m_webIDBServer;
</span><span class="cx"> 
</span><span class="cx">     RefPtr<NetworkStorageManager> m_storageManager;
</span><ins>+    RefPtr<CacheStorage::Engine> m_cacheEngine;
+    Vector<Function<void(CacheStorage::Engine&)>> m_cacheStorageParametersCallbacks;
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     AppPrivacyReportTestingData m_appPrivacyReportTestingData;
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcesscacheCacheStorageEnginecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp (287228 => 287229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp  2021-12-18 20:11:35 UTC (rev 287228)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp     2021-12-18 20:30:27 UTC (rev 287229)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include "NetworkCacheFileSystem.h"
</span><span class="cx"> #include "NetworkCacheIOChannel.h"
</span><span class="cx"> #include "NetworkProcess.h"
</span><ins>+#include "NetworkSession.h"
</ins><span class="cx"> #include "WebsiteDataType.h"
</span><span class="cx"> #include <WebCore/CacheQueryOptions.h>
</span><span class="cx"> #include <WebCore/RetrieveRecordsOptions.h>
</span><span class="lines">@@ -59,6 +60,11 @@
</span><span class="cx">     return FileSystem::pathByAppendingComponent(rootPath(), key.hashAsString());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Ref<Engine> Engine::create(NetworkSession& networkSession, String&& rootPath)
+{
+    return adoptRef(*new Engine(networkSession, WTFMove(rootPath)));
+}
+
</ins><span class="cx"> Engine::~Engine()
</span><span class="cx"> {
</span><span class="cx">     for (auto& caches : m_caches.values())
</span><span class="lines">@@ -81,119 +87,94 @@
</span><span class="cx">         callback(Data { }, 1);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Engine::from(NetworkProcess& networkProcess, PAL::SessionID sessionID, Function<void(Engine&)>&& callback)
</del><ins>+void Engine::fetchEntries(NetworkSession& networkSession, bool shouldComputeSize, CompletionHandler<void(Vector<WebsiteData::Entry>)>&& completionHandler)
</ins><span class="cx"> {
</span><del>-    if (auto* engine = networkProcess.findCacheEngine(sessionID)) {
-        callback(*engine);
-        return;
-    }
-
-    networkProcess.cacheStorageRootPath(sessionID, [networkProcess = Ref { networkProcess }, sessionID, callback = WTFMove(callback)] (auto&& rootPath) mutable {
-        callback(networkProcess->ensureCacheEngine(sessionID, [&] {
-            return adoptRef(*new Engine { sessionID, networkProcess.get(), WTFMove(rootPath) });
-        }));
-    });
-}
-
-void Engine::destroyEngine(NetworkProcess& networkProcess, PAL::SessionID sessionID)
-{
-#if !USE(SOUP) && !USE(CURL)
-    // cURL and Soup based ports destroy the default session right before the process exits to avoid leaking
-    // network resources like the cookies database.
-    ASSERT(sessionID != PAL::SessionID::defaultSessionID());
-#endif
-
-    networkProcess.removeCacheEngine(sessionID);
-}
-
-void Engine::fetchEntries(NetworkProcess& networkProcess, PAL::SessionID sessionID, bool shouldComputeSize, CompletionHandler<void(Vector<WebsiteData::Entry>)>&& completionHandler)
-{
-    from(networkProcess, sessionID, [shouldComputeSize, completionHandler = WTFMove(completionHandler)] (auto& engine) mutable {
</del><ins>+    networkSession.ensureCacheEngine([shouldComputeSize, completionHandler = WTFMove(completionHandler)] (auto& engine) mutable {
</ins><span class="cx">         engine.fetchEntries(shouldComputeSize, WTFMove(completionHandler));
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Engine::open(NetworkProcess& networkProcess, PAL::SessionID sessionID, WebCore::ClientOrigin&& origin, String&& cacheName, WebCore::DOMCacheEngine::CacheIdentifierCallback&& callback)
</del><ins>+void Engine::open(NetworkSession& networkSession, WebCore::ClientOrigin&& origin, String&& cacheName, WebCore::DOMCacheEngine::CacheIdentifierCallback&& callback)
</ins><span class="cx"> {
</span><del>-    from(networkProcess, sessionID, [origin = WTFMove(origin), cacheName = WTFMove(cacheName), callback = WTFMove(callback)](auto& engine) mutable {
</del><ins>+    networkSession.ensureCacheEngine([origin = WTFMove(origin), cacheName = WTFMove(cacheName), callback = WTFMove(callback)](auto& engine) mutable {
</ins><span class="cx">         engine.open(origin, cacheName, WTFMove(callback));
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Engine::remove(NetworkProcess& networkProcess, PAL::SessionID sessionID, uint64_t cacheIdentifier, WebCore::DOMCacheEngine::CacheIdentifierCallback&& callback)
</del><ins>+void Engine::remove(NetworkSession& networkSession, uint64_t cacheIdentifier, WebCore::DOMCacheEngine::CacheIdentifierCallback&& callback)
</ins><span class="cx"> {
</span><del>-    from(networkProcess, sessionID, [cacheIdentifier, callback = WTFMove(callback)](auto& engine) mutable {
</del><ins>+    networkSession.ensureCacheEngine([cacheIdentifier, callback = WTFMove(callback)](auto& engine) mutable {
</ins><span class="cx">         engine.remove(cacheIdentifier, WTFMove(callback));
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Engine::retrieveCaches(NetworkProcess& networkProcess, PAL::SessionID sessionID, WebCore::ClientOrigin&& origin, uint64_t updateCounter, WebCore::DOMCacheEngine::CacheInfosCallback&& callback)
</del><ins>+void Engine::retrieveCaches(NetworkSession& networkSession, WebCore::ClientOrigin&& origin, uint64_t updateCounter, WebCore::DOMCacheEngine::CacheInfosCallback&& callback)
</ins><span class="cx"> {
</span><del>-    from(networkProcess, sessionID, [origin = WTFMove(origin), updateCounter, callback = WTFMove(callback)](auto& engine) mutable {
</del><ins>+    networkSession.ensureCacheEngine([origin = WTFMove(origin), updateCounter, callback = WTFMove(callback)](auto& engine) mutable {
</ins><span class="cx">         engine.retrieveCaches(origin, updateCounter, WTFMove(callback));
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-void Engine::retrieveRecords(NetworkProcess& networkProcess, PAL::SessionID sessionID, uint64_t cacheIdentifier, WebCore::RetrieveRecordsOptions&& options, WebCore::DOMCacheEngine::RecordsCallback&& callback)
</del><ins>+void Engine::retrieveRecords(NetworkSession& networkSession, uint64_t cacheIdentifier, WebCore::RetrieveRecordsOptions&& options, WebCore::DOMCacheEngine::RecordsCallback&& callback)
</ins><span class="cx"> {
</span><del>-    from(networkProcess, sessionID, [cacheIdentifier, options = WTFMove(options), callback = WTFMove(callback)](auto& engine) mutable {
</del><ins>+    networkSession.ensureCacheEngine([cacheIdentifier, options = WTFMove(options), callback = WTFMove(callback)](auto& engine) mutable {
</ins><span class="cx">         engine.retrieveRecords(cacheIdentifier, WTFMove(options), WTFMove(callback));
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Engine::putRecords(NetworkProcess& networkProcess, PAL::SessionID sessionID, uint64_t cacheIdentifier, Vector<WebCore::DOMCacheEngine::Record>&& records, WebCore::DOMCacheEngine::RecordIdentifiersCallback&& callback)
</del><ins>+void Engine::putRecords(NetworkSession& networkSession, uint64_t cacheIdentifier, Vector<WebCore::DOMCacheEngine::Record>&& records, WebCore::DOMCacheEngine::RecordIdentifiersCallback&& callback)
</ins><span class="cx"> {
</span><del>-    from(networkProcess, sessionID, [cacheIdentifier, records = WTFMove(records), callback = WTFMove(callback)](auto& engine) mutable {
</del><ins>+    networkSession.ensureCacheEngine([cacheIdentifier, records = WTFMove(records), callback = WTFMove(callback)](auto& engine) mutable {
</ins><span class="cx">         engine.putRecords(cacheIdentifier, WTFMove(records), WTFMove(callback));
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Engine::deleteMatchingRecords(NetworkProcess& networkProcess, PAL::SessionID sessionID, uint64_t cacheIdentifier, WebCore::ResourceRequest&& request, WebCore::CacheQueryOptions&& options, WebCore::DOMCacheEngine::RecordIdentifiersCallback&& callback)
</del><ins>+void Engine::deleteMatchingRecords(NetworkSession& networkSession, uint64_t cacheIdentifier, WebCore::ResourceRequest&& request, WebCore::CacheQueryOptions&& options, WebCore::DOMCacheEngine::RecordIdentifiersCallback&& callback)
</ins><span class="cx"> {
</span><del>-    from(networkProcess, sessionID, [cacheIdentifier, request = WTFMove(request), options = WTFMove(options), callback = WTFMove(callback)](auto& engine) mutable {
</del><ins>+    networkSession.ensureCacheEngine([cacheIdentifier, request = WTFMove(request), options = WTFMove(options), callback = WTFMove(callback)](auto& engine) mutable {
</ins><span class="cx">         engine.deleteMatchingRecords(cacheIdentifier, WTFMove(request), WTFMove(options), WTFMove(callback));
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Engine::lock(NetworkProcess& networkProcess, PAL::SessionID sessionID, uint64_t cacheIdentifier)
</del><ins>+void Engine::lock(NetworkSession& networkSession, uint64_t cacheIdentifier)
</ins><span class="cx"> {
</span><del>-    from(networkProcess, sessionID, [cacheIdentifier](auto& engine) mutable {
</del><ins>+    networkSession.ensureCacheEngine([cacheIdentifier](auto& engine) mutable {
</ins><span class="cx">         engine.lock(cacheIdentifier);
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Engine::unlock(NetworkProcess& networkProcess, PAL::SessionID sessionID, uint64_t cacheIdentifier)
</del><ins>+void Engine::unlock(NetworkSession& networkSession, uint64_t cacheIdentifier)
</ins><span class="cx"> {
</span><del>-    from(networkProcess, sessionID, [cacheIdentifier](auto& engine) mutable {
</del><ins>+    networkSession.ensureCacheEngine([cacheIdentifier](auto& engine) mutable {
</ins><span class="cx">         engine.unlock(cacheIdentifier);
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Engine::clearMemoryRepresentation(NetworkProcess& networkProcess, PAL::SessionID sessionID, WebCore::ClientOrigin&& origin, WebCore::DOMCacheEngine::CompletionCallback&& callback)
</del><ins>+void Engine::clearMemoryRepresentation(NetworkSession& networkSession, WebCore::ClientOrigin&& origin, WebCore::DOMCacheEngine::CompletionCallback&& callback)
</ins><span class="cx"> {
</span><del>-    from(networkProcess, sessionID, [origin = WTFMove(origin), callback = WTFMove(callback)](auto& engine) mutable {
</del><ins>+    networkSession.ensureCacheEngine([origin = WTFMove(origin), callback = WTFMove(callback)](auto& engine) mutable {
</ins><span class="cx">         engine.clearMemoryRepresentation(origin, WTFMove(callback));
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Engine::representation(NetworkProcess& networkProcess, PAL::SessionID sessionID, CompletionHandler<void(String&&)>&& callback)
</del><ins>+void Engine::representation(NetworkSession& networkSession, CompletionHandler<void(String&&)>&& callback)
</ins><span class="cx"> {
</span><del>-    from(networkProcess, sessionID, [callback = WTFMove(callback)](auto& engine) mutable {
</del><ins>+    networkSession.ensureCacheEngine([callback = WTFMove(callback)](auto& engine) mutable {
</ins><span class="cx">         callback(engine.representation());
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Engine::clearAllCaches(NetworkProcess& networkProcess, PAL::SessionID sessionID, CompletionHandler<void()>&& completionHandler)
</del><ins>+void Engine::clearAllCaches(NetworkSession& networkSession, CompletionHandler<void()>&& completionHandler)
</ins><span class="cx"> {
</span><del>-    from(networkProcess, sessionID, [completionHandler = WTFMove(completionHandler)](auto& engine) mutable {
</del><ins>+    networkSession.ensureCacheEngine([completionHandler = WTFMove(completionHandler)](auto& engine) mutable {
</ins><span class="cx">         engine.clearAllCaches(WTFMove(completionHandler));
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Engine::clearCachesForOrigin(NetworkProcess& networkProcess, PAL::SessionID sessionID, WebCore::SecurityOriginData&& originData, CompletionHandler<void()>&& completionHandler)
</del><ins>+void Engine::clearCachesForOrigin(NetworkSession& networkSession, WebCore::SecurityOriginData&& originData, CompletionHandler<void()>&& completionHandler)
</ins><span class="cx"> {
</span><del>-    from(networkProcess, sessionID, [originData = WTFMove(originData), completionHandler = WTFMove(completionHandler)](auto& engine) mutable {
</del><ins>+    networkSession.ensureCacheEngine([originData = WTFMove(originData), completionHandler = WTFMove(completionHandler)](auto& engine) mutable {
</ins><span class="cx">         engine.clearCachesForOrigin(originData, WTFMove(completionHandler));
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="lines">@@ -258,9 +239,9 @@
</span><span class="cx">     storageQuotaManager->requestSpaceOnMainThread(spaceRequested, WTFMove(callback));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Engine::Engine(PAL::SessionID sessionID, NetworkProcess& process, String&& rootPath)
-    : m_sessionID(sessionID)
-    , m_networkProcess(process)
</del><ins>+Engine::Engine(NetworkSession& networkSession, String&& rootPath)
+    : m_sessionID(networkSession.sessionID())
+    , m_networkProcess(networkSession.networkProcess())
</ins><span class="cx">     , m_rootPath(WTFMove(rootPath))
</span><span class="cx"> {
</span><span class="cx">     if (!m_rootPath.isNull())
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcesscacheCacheStorageEngineh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h (287228 => 287229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h    2021-12-18 20:11:35 UTC (rev 287228)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h       2021-12-18 20:30:27 UTC (rev 287229)
</span><span class="lines">@@ -51,6 +51,7 @@
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> class NetworkProcess;
</span><ins>+class NetworkSession;
</ins><span class="cx"> 
</span><span class="cx"> namespace CacheStorage {
</span><span class="cx"> 
</span><span class="lines">@@ -59,30 +60,29 @@
</span><span class="cx"> 
</span><span class="cx"> class Engine : public RefCounted<Engine>, public CanMakeWeakPtr<Engine> {
</span><span class="cx"> public:
</span><ins>+    static Ref<Engine> create(NetworkSession&, String&& rootPath);
</ins><span class="cx">     ~Engine();
</span><span class="cx"> 
</span><del>-    static void from(NetworkProcess&, PAL::SessionID, Function<void(Engine&)>&&);
-    static void destroyEngine(NetworkProcess&, PAL::SessionID);
-    static void fetchEntries(NetworkProcess&, PAL::SessionID, bool shouldComputeSize, CompletionHandler<void(Vector<WebsiteData::Entry>)>&&);
</del><ins>+    static void fetchEntries(NetworkSession&, bool shouldComputeSize, CompletionHandler<void(Vector<WebsiteData::Entry>)>&&);
</ins><span class="cx"> 
</span><del>-    static void open(NetworkProcess&, PAL::SessionID, WebCore::ClientOrigin&&, String&& cacheName, WebCore::DOMCacheEngine::CacheIdentifierCallback&&);
-    static void remove(NetworkProcess&, PAL::SessionID, uint64_t cacheIdentifier, WebCore::DOMCacheEngine::CacheIdentifierCallback&&);
-    static void retrieveCaches(NetworkProcess&, PAL::SessionID, WebCore::ClientOrigin&&, uint64_t updateCounter, WebCore::DOMCacheEngine::CacheInfosCallback&&);
</del><ins>+    static void open(NetworkSession&, WebCore::ClientOrigin&&, String&& cacheName, WebCore::DOMCacheEngine::CacheIdentifierCallback&&);
+    static void remove(NetworkSession&, uint64_t cacheIdentifier, WebCore::DOMCacheEngine::CacheIdentifierCallback&&);
+    static void retrieveCaches(NetworkSession&, WebCore::ClientOrigin&&, uint64_t updateCounter, WebCore::DOMCacheEngine::CacheInfosCallback&&);
</ins><span class="cx"> 
</span><del>-    static void retrieveRecords(NetworkProcess&, PAL::SessionID, uint64_t cacheIdentifier, WebCore::RetrieveRecordsOptions&&, WebCore::DOMCacheEngine::RecordsCallback&&);
-    static void putRecords(NetworkProcess&, PAL::SessionID, uint64_t cacheIdentifier, Vector<WebCore::DOMCacheEngine::Record>&&, WebCore::DOMCacheEngine::RecordIdentifiersCallback&&);
-    static void deleteMatchingRecords(NetworkProcess&, PAL::SessionID, uint64_t cacheIdentifier, WebCore::ResourceRequest&&, WebCore::CacheQueryOptions&&, WebCore::DOMCacheEngine::RecordIdentifiersCallback&&);
</del><ins>+    static void retrieveRecords(NetworkSession&, uint64_t cacheIdentifier, WebCore::RetrieveRecordsOptions&&, WebCore::DOMCacheEngine::RecordsCallback&&);
+    static void putRecords(NetworkSession&, uint64_t cacheIdentifier, Vector<WebCore::DOMCacheEngine::Record>&&, WebCore::DOMCacheEngine::RecordIdentifiersCallback&&);
+    static void deleteMatchingRecords(NetworkSession&, uint64_t cacheIdentifier, WebCore::ResourceRequest&&, WebCore::CacheQueryOptions&&, WebCore::DOMCacheEngine::RecordIdentifiersCallback&&);
</ins><span class="cx"> 
</span><del>-    static void lock(NetworkProcess&, PAL::SessionID, uint64_t cacheIdentifier);
-    static void unlock(NetworkProcess&, PAL::SessionID, uint64_t cacheIdentifier);
</del><ins>+    static void lock(NetworkSession&, uint64_t cacheIdentifier);
+    static void unlock(NetworkSession&, uint64_t cacheIdentifier);
</ins><span class="cx"> 
</span><del>-    static void clearMemoryRepresentation(NetworkProcess&, PAL::SessionID, WebCore::ClientOrigin&&, WebCore::DOMCacheEngine::CompletionCallback&&);
-    static void representation(NetworkProcess&, PAL::SessionID, CompletionHandler<void(String&&)>&&);
</del><ins>+    static void clearMemoryRepresentation(NetworkSession&, WebCore::ClientOrigin&&, WebCore::DOMCacheEngine::CompletionCallback&&);
+    static void representation(NetworkSession&, CompletionHandler<void(String&&)>&&);
</ins><span class="cx"> 
</span><del>-    static void clearAllCaches(NetworkProcess&, PAL::SessionID, CompletionHandler<void()>&&);
-    static void clearCachesForOrigin(NetworkProcess&, PAL::SessionID, WebCore::SecurityOriginData&&, CompletionHandler<void()>&&);
</del><ins>+    static void clearAllCaches(NetworkSession&, CompletionHandler<void()>&&);
+    static void clearCachesForOrigin(NetworkSession&, WebCore::SecurityOriginData&&, CompletionHandler<void()>&&);
</ins><span class="cx"> 
</span><del>-    static void initializeQuotaUser(NetworkProcess&, PAL::SessionID, const WebCore::ClientOrigin&, CompletionHandler<void()>&&);
</del><ins>+    static void initializeQuotaUser(NetworkSession&, const WebCore::ClientOrigin&, CompletionHandler<void()>&&);
</ins><span class="cx"> 
</span><span class="cx">     static uint64_t diskUsage(const String& rootPath, const WebCore::ClientOrigin&);
</span><span class="cx">     void requestSpace(const WebCore::ClientOrigin&, uint64_t spaceRequested, CompletionHandler<void(WebCore::StorageQuotaManager::Decision)>&&);
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx">     uint64_t nextCacheIdentifier() { return ++m_nextCacheIdentifier; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    Engine(PAL::SessionID, NetworkProcess&, String&& rootPath);
</del><ins>+    Engine(NetworkSession&, String&& rootPath);
</ins><span class="cx"> 
</span><span class="cx">     void open(const WebCore::ClientOrigin&, const String& cacheName, WebCore::DOMCacheEngine::CacheIdentifierCallback&&);
</span><span class="cx">     void remove(uint64_t cacheIdentifier, WebCore::DOMCacheEngine::CacheIdentifierCallback&&);
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcesscacheCacheStorageEngineConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.cpp (287228 => 287229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.cpp        2021-12-18 20:11:35 UTC (rev 287228)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.cpp   2021-12-18 20:30:27 UTC (rev 287229)
</span><span class="lines">@@ -52,9 +52,11 @@
</span><span class="cx"> 
</span><span class="cx"> CacheStorageEngineConnection::~CacheStorageEngineConnection()
</span><span class="cx"> {
</span><del>-    for (auto& references : m_cachesLocks) {
-        ASSERT(references.value);
-        Engine::unlock(m_connection.networkProcess(), sessionID(), references.key);
</del><ins>+    if (auto* session = m_connection.networkSession()) {
+        for (auto& references : m_cachesLocks) {
+            ASSERT(references.value);
+            Engine::unlock(*session, references.key);
+        }
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -61,7 +63,11 @@
</span><span class="cx"> void CacheStorageEngineConnection::open(WebCore::ClientOrigin&& origin, String&& cacheName, CacheIdentifierCallback&& callback)
</span><span class="cx"> {
</span><span class="cx">     CACHE_STORAGE_RELEASE_LOG("open cache");
</span><del>-    Engine::open(m_connection.networkProcess(), sessionID(), WTFMove(origin), WTFMove(cacheName), [callback = WTFMove(callback), sessionID = this->sessionID()](auto& result) mutable {
</del><ins>+    auto* session = m_connection.networkSession();
+    if (!session)
+        return callback(makeUnexpected(WebCore::DOMCacheEngine::Error::Internal));
+
+    Engine::open(*session, WTFMove(origin), WTFMove(cacheName), [callback = WTFMove(callback), sessionID = this->sessionID()](auto& result) mutable {
</ins><span class="cx">         CACHE_STORAGE_RELEASE_LOG_FUNCTION_IN_CALLBACK("open", "cache identifier is %" PRIu64, [](const auto& value) { return value.identifier; });
</span><span class="cx">         callback(result);
</span><span class="cx">     });
</span><span class="lines">@@ -70,7 +76,11 @@
</span><span class="cx"> void CacheStorageEngineConnection::remove(uint64_t cacheIdentifier, CacheIdentifierCallback&& callback)
</span><span class="cx"> {
</span><span class="cx">     CACHE_STORAGE_RELEASE_LOG("remove cache %" PRIu64, cacheIdentifier);
</span><del>-    Engine::remove(m_connection.networkProcess(), sessionID(), cacheIdentifier, [callback = WTFMove(callback), sessionID = this->sessionID()](auto& result) mutable {
</del><ins>+    auto* session = m_connection.networkSession();
+    if (!session)
+        return callback(makeUnexpected(WebCore::DOMCacheEngine::Error::Internal));
+
+    Engine::remove(*session, cacheIdentifier, [callback = WTFMove(callback), sessionID = this->sessionID()](auto& result) mutable {
</ins><span class="cx">         CACHE_STORAGE_RELEASE_LOG_FUNCTION_IN_CALLBACK("remove", "removed cache %" PRIu64, [](const auto& value) { return value.identifier; });
</span><span class="cx">         callback(result);
</span><span class="cx">     });
</span><span class="lines">@@ -79,7 +89,11 @@
</span><span class="cx"> void CacheStorageEngineConnection::caches(WebCore::ClientOrigin&& origin, uint64_t updateCounter, CacheInfosCallback&& callback)
</span><span class="cx"> {
</span><span class="cx">     CACHE_STORAGE_RELEASE_LOG("caches");
</span><del>-    Engine::retrieveCaches(m_connection.networkProcess(), sessionID(), WTFMove(origin), updateCounter, [callback = WTFMove(callback), origin, sessionID = this->sessionID()](auto&& result) mutable {
</del><ins>+    auto* session = m_connection.networkSession();
+    if (!session)
+        return callback(makeUnexpected(WebCore::DOMCacheEngine::Error::Internal));
+
+    Engine::retrieveCaches(*session, WTFMove(origin), updateCounter, [callback = WTFMove(callback), origin, sessionID = this->sessionID()](auto&& result) mutable {
</ins><span class="cx">         CACHE_STORAGE_RELEASE_LOG_FUNCTION_IN_CALLBACK("caches", "caches size is %lu", [](const auto& value) { return value.infos.size(); });
</span><span class="cx">         callback(WTFMove(result));
</span><span class="cx">     });
</span><span class="lines">@@ -88,7 +102,11 @@
</span><span class="cx"> void CacheStorageEngineConnection::retrieveRecords(uint64_t cacheIdentifier, WebCore::RetrieveRecordsOptions&& options, RecordsCallback&& callback)
</span><span class="cx"> {
</span><span class="cx">     CACHE_STORAGE_RELEASE_LOG("retrieveRecords in cache %" PRIu64, cacheIdentifier);
</span><del>-    Engine::retrieveRecords(m_connection.networkProcess(), sessionID(), cacheIdentifier, WTFMove(options), [callback = WTFMove(callback), sessionID = this->sessionID()](auto&& result) mutable {
</del><ins>+    auto* session = m_connection.networkSession();
+    if (!session)
+        return callback(makeUnexpected(WebCore::DOMCacheEngine::Error::Internal));
+
+    Engine::retrieveRecords(*session, cacheIdentifier, WTFMove(options), [callback = WTFMove(callback), sessionID = this->sessionID()](auto&& result) mutable {
</ins><span class="cx">         CACHE_STORAGE_RELEASE_LOG_FUNCTION_IN_CALLBACK("retrieveRecords", "records size is %lu", [](const auto& value) { return value.size(); });
</span><span class="cx">         callback(WTFMove(result));
</span><span class="cx">     });
</span><span class="lines">@@ -97,7 +115,11 @@
</span><span class="cx"> void CacheStorageEngineConnection::deleteMatchingRecords(uint64_t cacheIdentifier, WebCore::ResourceRequest&& request, WebCore::CacheQueryOptions&& options, RecordIdentifiersCallback&& callback)
</span><span class="cx"> {
</span><span class="cx">     CACHE_STORAGE_RELEASE_LOG("deleteMatchingRecords in cache %" PRIu64, cacheIdentifier);
</span><del>-    Engine::deleteMatchingRecords(m_connection.networkProcess(), sessionID(), cacheIdentifier, WTFMove(request), WTFMove(options), [callback = WTFMove(callback), sessionID = this->sessionID()](auto&& result) mutable {
</del><ins>+    auto* session = m_connection.networkSession();
+    if (!session)
+        return callback(makeUnexpected(WebCore::DOMCacheEngine::Error::Internal));
+
+    Engine::deleteMatchingRecords(*session, cacheIdentifier, WTFMove(request), WTFMove(options), [callback = WTFMove(callback), sessionID = this->sessionID()](auto&& result) mutable {
</ins><span class="cx">         CACHE_STORAGE_RELEASE_LOG_FUNCTION_IN_CALLBACK("deleteMatchingRecords", "deleted %lu records",  [](const auto& value) { return value.size(); });
</span><span class="cx">         callback(WTFMove(result));
</span><span class="cx">     });
</span><span class="lines">@@ -106,7 +128,11 @@
</span><span class="cx"> void CacheStorageEngineConnection::putRecords(uint64_t cacheIdentifier, Vector<Record>&& records, RecordIdentifiersCallback&& callback)
</span><span class="cx"> {
</span><span class="cx">     CACHE_STORAGE_RELEASE_LOG("putRecords in cache %" PRIu64 ", %lu records", cacheIdentifier, records.size());
</span><del>-    Engine::putRecords(m_connection.networkProcess(), sessionID(), cacheIdentifier, WTFMove(records), [callback = WTFMove(callback), sessionID = this->sessionID()](auto&& result) mutable {
</del><ins>+    auto* session = m_connection.networkSession();
+    if (!session)
+        return callback(makeUnexpected(WebCore::DOMCacheEngine::Error::Internal));
+
+    Engine::putRecords(*session, cacheIdentifier, WTFMove(records), [callback = WTFMove(callback), sessionID = this->sessionID()](auto&& result) mutable {
</ins><span class="cx">         CACHE_STORAGE_RELEASE_LOG_FUNCTION_IN_CALLBACK("putRecords", "put %lu records",  [](const auto& value) { return value.size(); });
</span><span class="cx">         callback(WTFMove(result));
</span><span class="cx">     });
</span><span class="lines">@@ -115,6 +141,10 @@
</span><span class="cx"> void CacheStorageEngineConnection::reference(uint64_t cacheIdentifier)
</span><span class="cx"> {
</span><span class="cx">     CACHE_STORAGE_RELEASE_LOG("reference cache %" PRIu64, cacheIdentifier);
</span><ins>+    auto* session = m_connection.networkSession();
+    if (!session)
+        return;
+
</ins><span class="cx">     ASSERT(m_cachesLocks.isValidKey(cacheIdentifier));
</span><span class="cx">     if (!m_cachesLocks.isValidKey(cacheIdentifier))
</span><span class="cx">         return;
</span><span class="lines">@@ -123,12 +153,16 @@
</span><span class="cx">         return 0;
</span><span class="cx">     }).iterator->value;
</span><span class="cx">     if (!counter++)
</span><del>-        Engine::lock(m_connection.networkProcess(), sessionID(), cacheIdentifier);
</del><ins>+        Engine::lock(*session, cacheIdentifier);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CacheStorageEngineConnection::dereference(uint64_t cacheIdentifier)
</span><span class="cx"> {
</span><span class="cx">     CACHE_STORAGE_RELEASE_LOG("dereference cache %" PRIu64, cacheIdentifier);
</span><ins>+    auto* session = m_connection.networkSession();
+    if (!session)
+        return;
+
</ins><span class="cx">     ASSERT(m_cachesLocks.isValidKey(cacheIdentifier));
</span><span class="cx">     if (!m_cachesLocks.isValidKey(cacheIdentifier))
</span><span class="cx">         return;
</span><span class="lines">@@ -141,18 +175,26 @@
</span><span class="cx">     if (--referenceResult->value)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    Engine::unlock(m_connection.networkProcess(), sessionID(), cacheIdentifier);
</del><ins>+    Engine::unlock(*session, cacheIdentifier);
</ins><span class="cx">     m_cachesLocks.remove(referenceResult);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CacheStorageEngineConnection::clearMemoryRepresentation(WebCore::ClientOrigin&& origin, CompletionHandler<void(std::optional<Error>&&)>&& completionHandler)
</span><span class="cx"> {
</span><del>-    Engine::clearMemoryRepresentation(m_connection.networkProcess(), sessionID(), WTFMove(origin), WTFMove(completionHandler));
</del><ins>+    auto* session = m_connection.networkSession();
+    if (!session)
+        return completionHandler(WebCore::DOMCacheEngine::Error::Internal);
+
+    Engine::clearMemoryRepresentation(*session, WTFMove(origin), WTFMove(completionHandler));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CacheStorageEngineConnection::engineRepresentation(CompletionHandler<void(String&&)>&& completionHandler)
</span><span class="cx"> {
</span><del>-    Engine::representation(m_connection.networkProcess(), sessionID(), WTFMove(completionHandler));
</del><ins>+    auto* session = m_connection.networkSession();
+    if (!session)
+        return completionHandler({ });
+
+    Engine::representation(*session, WTFMove(completionHandler));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PAL::SessionID CacheStorageEngineConnection::sessionID() const
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessNetworkNetworkProcessProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (287228 => 287229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp    2021-12-18 20:11:35 UTC (rev 287228)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp       2021-12-18 20:30:27 UTC (rev 287229)
</span><span class="lines">@@ -1370,13 +1370,12 @@
</span><span class="cx">     return WebsiteDataStore::existingDataStoreForSessionID(sessionID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkProcessProxy::retrieveCacheStorageParameters(PAL::SessionID sessionID)
</del><ins>+void NetworkProcessProxy::retrieveCacheStorageParameters(PAL::SessionID sessionID, CompletionHandler<void(const String& cacheStorageDirectory, const WebKit::SandboxExtension::Handle& handle)>&& completionHandler)
</ins><span class="cx"> {
</span><span class="cx">     auto* store = websiteDataStoreFromSessionID(sessionID);
</span><del>-
</del><span class="cx">     if (!store) {
</span><span class="cx">         RELEASE_LOG_ERROR(CacheStorage, "%p - NetworkProcessProxy is unable to retrieve CacheStorage parameters from the given session ID %" PRIu64, this, sessionID.toUInt64());
</span><del>-        send(Messages::NetworkProcess::SetCacheStorageParameters { sessionID, { }, { } }, 0);
</del><ins>+        completionHandler({ }, { });
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1387,7 +1386,7 @@
</span><span class="cx">             cacheStorageDirectoryExtensionHandle = WTFMove(*handle);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    send(Messages::NetworkProcess::SetCacheStorageParameters { sessionID, cacheStorageDirectory, cacheStorageDirectoryExtensionHandle }, 0);
</del><ins>+    completionHandler(cacheStorageDirectory, cacheStorageDirectoryExtensionHandle);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessNetworkNetworkProcessProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h (287228 => 287229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h      2021-12-18 20:11:35 UTC (rev 287228)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h 2021-12-18 20:30:27 UTC (rev 287229)
</span><span class="lines">@@ -319,7 +319,7 @@
</span><span class="cx">     void notifyWebsiteDataDeletionForRegistrableDomainsFinished();
</span><span class="cx">     void notifyWebsiteDataScanForRegistrableDomainsFinished();
</span><span class="cx"> #endif
</span><del>-    void retrieveCacheStorageParameters(PAL::SessionID);
</del><ins>+    void retrieveCacheStorageParameters(PAL::SessionID, CompletionHandler<void(const String& cacheStorageDirectory, const WebKit::SandboxExtension::Handle& handle)>&&);
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="cx">     void contentExtensionRules(UserContentControllerIdentifier);
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessNetworkNetworkProcessProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in (287228 => 287229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in    2021-12-18 20:11:35 UTC (rev 287228)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in       2021-12-18 20:30:27 UTC (rev 287229)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx">     ContentExtensionRules(WebKit::UserContentControllerIdentifier identifier)
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    RetrieveCacheStorageParameters(PAL::SessionID sessionID)
</del><ins>+    RetrieveCacheStorageParameters(PAL::SessionID sessionID) -> (String cacheStorageDirectory, WebKit::SandboxExtension::Handle handle) Async
</ins><span class="cx"> 
</span><span class="cx">     TerminateWebProcess(WebCore::ProcessIdentifier webProcessIdentifier)
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>