[SOUP] Move cookiePersistentStoragePath and cookiePersistentStorageType from NetworkP...
authormcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Jan 2019 15:04:30 +0000 (15:04 +0000)
committermcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Jan 2019 15:04:30 +0000 (15:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194075

Reviewed by Alex Christensen.

Move cookiePersistentStoragePath and cookiePersistentStorageType from NetworkProcess to
NetworkSession to reduce globals. This removes two of the six soup-specific variables in
NetworkProcessCreationParameters

* NetworkProcess/Cookies/WebCookieManager.h:
* NetworkProcess/Cookies/WebCookieManager.messages.in:
* NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
(WebKit::WebCookieManager::setCookiePersistentStorage):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::privateSessionParameters):
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
* NetworkProcess/soup/NetworkSessionSoup.cpp:
(WebKit::NetworkSessionSoup::NetworkSessionSoup):
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/glib/WebKitCookieManager.cpp:
(webkit_cookie_manager_set_persistent_storage):
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::WebCookieManagerProxy):
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.h:
* UIProcess/WebsiteData/curl/WebsiteDataStoreCurl.cpp:
(WebKit::WebsiteDataStore::platformSetNetworkParameters):
(WebKit::WebsiteDataStore::platformSetParameters): Deleted.
* UIProcess/soup/WebCookieManagerProxySoup.cpp:
(WebKit::WebCookieManagerProxy::setCookiePersistentStorage):
(WebKit::WebCookieManagerProxy::getCookiePersistentStorage const):
* UIProcess/soup/WebProcessPoolSoup.cpp:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240785 268f45cc-cd09-0410-ab3c-d52691b4dbfc

21 files changed:
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/Cookies/WebCookieManager.h
Source/WebKit/NetworkProcess/Cookies/WebCookieManager.messages.in
Source/WebKit/NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp
Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp
Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h
Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp
Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h
Source/WebKit/NetworkProcess/soup/NetworkProcessSoup.cpp
Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp
Source/WebKit/SourcesGTK.txt
Source/WebKit/SourcesWPE.txt
Source/WebKit/UIProcess/API/glib/WebKitCookieManager.cpp
Source/WebKit/UIProcess/WebCookieManagerProxy.cpp
Source/WebKit/UIProcess/WebCookieManagerProxy.h
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
Source/WebKit/UIProcess/WebsiteData/curl/WebsiteDataStoreCurl.cpp
Source/WebKit/UIProcess/WebsiteData/soup/WebsiteDataStoreSoup.cpp [new file with mode: 0644]
Source/WebKit/UIProcess/soup/WebCookieManagerProxySoup.cpp
Source/WebKit/UIProcess/soup/WebProcessPoolSoup.cpp

index a483ced..7d0ced4 100644 (file)
@@ -1,3 +1,50 @@
+2019-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        [SOUP] Move cookiePersistentStoragePath and cookiePersistentStorageType from NetworkProcess to NetworkSession
+        https://bugs.webkit.org/show_bug.cgi?id=194075
+
+        Reviewed by Alex Christensen.
+
+        Move cookiePersistentStoragePath and cookiePersistentStorageType from NetworkProcess to
+        NetworkSession to reduce globals. This removes two of the six soup-specific variables in
+        NetworkProcessCreationParameters
+
+        * NetworkProcess/Cookies/WebCookieManager.h:
+        * NetworkProcess/Cookies/WebCookieManager.messages.in:
+        * NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
+        (WebKit::WebCookieManager::setCookiePersistentStorage):
+        * NetworkProcess/NetworkProcessCreationParameters.cpp:
+        (WebKit::NetworkProcessCreationParameters::encode const):
+        (WebKit::NetworkProcessCreationParameters::decode):
+        * NetworkProcess/NetworkProcessCreationParameters.h:
+        * NetworkProcess/NetworkSessionCreationParameters.cpp:
+        (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
+        (WebKit::NetworkSessionCreationParameters::encode const):
+        (WebKit::NetworkSessionCreationParameters::decode):
+        * NetworkProcess/NetworkSessionCreationParameters.h:
+        * NetworkProcess/soup/NetworkProcessSoup.cpp:
+        (WebKit::NetworkProcess::platformInitializeNetworkProcess):
+        * NetworkProcess/soup/NetworkSessionSoup.cpp:
+        (WebKit::NetworkSessionSoup::NetworkSessionSoup):
+        * SourcesGTK.txt:
+        * SourcesWPE.txt:
+        * UIProcess/API/glib/WebKitCookieManager.cpp:
+        (webkit_cookie_manager_set_persistent_storage):
+        * UIProcess/WebCookieManagerProxy.cpp:
+        (WebKit::WebCookieManagerProxy::WebCookieManagerProxy):
+        * UIProcess/WebCookieManagerProxy.h:
+        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+        (WebKit::WebsiteDataStore::parameters):
+        * UIProcess/WebsiteData/WebsiteDataStore.h:
+        * UIProcess/WebsiteData/curl/WebsiteDataStoreCurl.cpp:
+        (WebKit::WebsiteDataStore::platformSetNetworkParameters):
+        (WebKit::WebsiteDataStore::platformSetParameters): Deleted.
+        * UIProcess/soup/WebCookieManagerProxySoup.cpp:
+        (WebKit::WebCookieManagerProxy::setCookiePersistentStorage):
+        (WebKit::WebCookieManagerProxy::getCookiePersistentStorage const):
+        * UIProcess/soup/WebProcessPoolSoup.cpp:
+        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
+
 2019-01-31  Ryosuke Niwa  <rniwa@webkit.org>
 
         iOS: Crash in InteractiveUpdateHandler set by ViewGestureController::beginSwipeGesture
index 88722e7..3156466 100644 (file)
@@ -58,7 +58,7 @@ public:
     void setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy, OptionalCallbackID);
 
 #if USE(SOUP)
-    void setCookiePersistentStorage(const String& storagePath, uint32_t storageType);
+    void setCookiePersistentStorage(PAL::SessionID, const String& storagePath, uint32_t storageType);
 #endif
 
     void notifyCookiesDidChange(PAL::SessionID);
index 0b1fd55..2ee06ad 100644 (file)
@@ -42,6 +42,6 @@
     void StopObservingCookieChanges(PAL::SessionID sessionID)
 
 #if USE(SOUP)
-    SetCookiePersistentStorage(String storagePath, uint32_t storageType)
+    SetCookiePersistentStorage(PAL::SessionID sessionID, String storagePath, uint32_t storageType)
 #endif
 }
index af30fae..6898c7f 100644 (file)
@@ -71,7 +71,7 @@ HTTPCookieAcceptPolicy WebCookieManager::platformGetHTTPCookieAcceptPolicy()
     return HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain;
 }
 
-void WebCookieManager::setCookiePersistentStorage(const String& storagePath, uint32_t storageType)
+void WebCookieManager::setCookiePersistentStorage(PAL::SessionID sessionID, const String& storagePath, uint32_t storageType)
 {
     GRefPtr<SoupCookieJar> jar;
     switch (storageType) {
@@ -85,9 +85,10 @@ void WebCookieManager::setCookiePersistentStorage(const String& storagePath, uin
         ASSERT_NOT_REACHED();
     }
 
-    auto& storageSession = m_process.defaultStorageSession();
-    soup_cookie_jar_set_accept_policy(jar.get(), soup_cookie_jar_get_accept_policy(storageSession.cookieStorage()));
-    storageSession.setCookieStorage(jar.get());
+    if (auto* storageSession = m_process.storageSession(sessionID)) {
+        soup_cookie_jar_set_accept_policy(jar.get(), soup_cookie_jar_get_accept_policy(storageSession->cookieStorage()));
+        storageSession->setCookieStorage(jar.get());
+    }
 }
 
 } // namespace WebKit
index 0ca4e28..c6df08e 100644 (file)
@@ -72,8 +72,6 @@ void NetworkProcessCreationParameters::encode(IPC::Encoder& encoder) const
 #endif
     encoder << defaultDataStoreParameters;
 #if USE(SOUP)
-    encoder << cookiePersistentStoragePath;
-    encoder << cookiePersistentStorageType;
     encoder.encodeEnum(cookieAcceptPolicy);
     encoder << ignoreTLSErrors;
     encoder << languages;
@@ -172,10 +170,6 @@ bool NetworkProcessCreationParameters::decode(IPC::Decoder& decoder, NetworkProc
     result.defaultDataStoreParameters = WTFMove(*defaultDataStoreParameters);
 
 #if USE(SOUP)
-    if (!decoder.decode(result.cookiePersistentStoragePath))
-        return false;
-    if (!decoder.decode(result.cookiePersistentStorageType))
-        return false;
     if (!decoder.decodeEnum(result.cookieAcceptPolicy))
         return false;
     if (!decoder.decode(result.ignoreTLSErrors))
index edc0a10..2fd3be9 100644 (file)
@@ -87,8 +87,6 @@ struct NetworkProcessCreationParameters {
     WebsiteDataStoreParameters defaultDataStoreParameters;
     
 #if USE(SOUP)
-    String cookiePersistentStoragePath;
-    uint32_t cookiePersistentStorageType { 0 };
     HTTPCookieAcceptPolicy cookieAcceptPolicy { HTTPCookieAcceptPolicyAlways };
     bool ignoreTLSErrors { false };
     Vector<String> languages;
index 270ae43..cfc9e10 100644 (file)
@@ -44,6 +44,9 @@ NetworkSessionCreationParameters NetworkSessionCreationParameters::privateSessio
 #if PLATFORM(COCOA)
         , { }, { }, { }, false, { }, { }, { }
 #endif
+#if USE(SOUP)
+        , { }, 0
+#endif
 #if USE(CURL)
         , { }, { }
 #endif
@@ -65,6 +68,10 @@ void NetworkSessionCreationParameters::encode(IPC::Encoder& encoder) const
     encoder << httpProxy;
     encoder << httpsProxy;
 #endif
+#if USE(SOUP)
+    encoder << cookiePersistentStoragePath;
+    encoder << cookiePersistentStorageType;
+#endif
 #if USE(CURL)
     encoder << cookiePersistentStorageFile;
     encoder << proxySettings;
@@ -125,7 +132,19 @@ Optional<NetworkSessionCreationParameters> NetworkSessionCreationParameters::dec
     if (!httpsProxy)
         return WTF::nullopt;
 #endif
-    
+
+#if USE(SOUP)
+    Optional<String> cookiePersistentStoragePath;
+    decoder >> cookiePersistentStoragePath;
+    if (!cookiePersistentStoragePath)
+        return WTF::nullopt;
+
+    Optional<uint32_t> cookiePersistentStorageType;
+    decoder >> cookiePersistentStorageType;
+    if (!cookiePersistentStorageType)
+        return WTF::nullopt;
+#endif
+
 #if USE(CURL)
     Optional<String> cookiePersistentStorageFile;
     decoder >> cookiePersistentStorageFile;
@@ -166,6 +185,10 @@ Optional<NetworkSessionCreationParameters> NetworkSessionCreationParameters::dec
         , WTFMove(*httpProxy)
         , WTFMove(*httpsProxy)
 #endif
+#if USE(SOUP)
+        , WTFMove(*cookiePersistentStoragePath)
+        , WTFMove(*cookiePersistentStorageType)
+#endif
 #if USE(CURL)
         , WTFMove(*cookiePersistentStorageFile)
         , WTFMove(*proxySettings)
index 6f9de8b..cd5cae2 100644 (file)
@@ -66,6 +66,10 @@ struct NetworkSessionCreationParameters {
     URL httpProxy;
     URL httpsProxy;
 #endif
+#if USE(SOUP)
+    String cookiePersistentStoragePath;
+    uint32_t cookiePersistentStorageType { 0 };
+#endif
 #if USE(CURL)
     String cookiePersistentStorageFile;
     WebCore::CurlProxySettings proxySettings;
index 72fb654..a0d2af6 100644 (file)
@@ -120,10 +120,6 @@ void NetworkProcess::platformInitializeNetworkProcess(const NetworkProcessCreati
 
     m_cache = NetworkCache::Cache::open(*this, m_diskCacheDirectory, cacheOptions);
 
-    if (!parameters.cookiePersistentStoragePath.isEmpty()) {
-        supplement<WebCookieManager>()->setCookiePersistentStorage(parameters.cookiePersistentStoragePath,
-            parameters.cookiePersistentStorageType);
-    }
     supplement<WebCookieManager>()->setHTTPCookieAcceptPolicy(parameters.cookieAcceptPolicy, OptionalCallbackID());
 
     if (!parameters.languages.isEmpty())
index 59de9f5..20acb1f 100644 (file)
@@ -42,6 +42,9 @@ NetworkSessionSoup::NetworkSessionSoup(NetworkProcess& networkProcess, NetworkSe
     networkStorageSession().setCookieObserverHandler([this] {
         this->networkProcess().supplement<WebCookieManager>()->notifyCookiesDidChange(m_sessionID);
     });
+
+    if (!parameters.cookiePersistentStoragePath.isEmpty())
+        this->networkProcess().supplement<WebCookieManager>()->setCookiePersistentStorage(m_sessionID, parameters.cookiePersistentStoragePath, parameters.cookiePersistentStorageType);
 }
 
 NetworkSessionSoup::~NetworkSessionSoup()
index 7e1d458..b832b7a 100644 (file)
@@ -218,6 +218,7 @@ UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp @no-unify
 
 UIProcess/WebStorage/StorageManager.cpp
 
+UIProcess/WebsiteData/soup/WebsiteDataStoreSoup.cpp
 UIProcess/WebsiteData/unix/WebsiteDataStoreUnix.cpp
 
 UIProcess/cairo/BackingStoreCairo.cpp @no-unify
index 913a2ed..05a9f92 100644 (file)
@@ -191,6 +191,7 @@ UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp
 
 UIProcess/WebStorage/StorageManager.cpp
 
+UIProcess/WebsiteData/soup/WebsiteDataStoreSoup.cpp
 UIProcess/WebsiteData/unix/WebsiteDataStoreUnix.cpp
 
 UIProcess/gstreamer/InstallMissingMediaPluginsPermissionRequest.cpp
index 7a94291..01e1a3e 100644 (file)
@@ -166,8 +166,12 @@ void webkit_cookie_manager_set_persistent_storage(WebKitCookieManager* manager,
     g_return_if_fail(filename);
     g_return_if_fail(!webkit_website_data_manager_is_ephemeral(manager->priv->dataManager));
 
+    auto sessionID = webkitWebsiteDataManagerGetDataStore(manager->priv->dataManager).websiteDataStore().sessionID();
+    if (sessionID.isEphemeral())
+        return;
+
     for (auto* processPool : webkitWebsiteDataManagerGetProcessPools(manager->priv->dataManager))
-        processPool->supplement<WebCookieManagerProxy>()->setCookiePersistentStorage(String::fromUTF8(filename), toSoupCookiePersistentStorageType(storage));
+        processPool->supplement<WebCookieManagerProxy>()->setCookiePersistentStorage(sessionID, String::fromUTF8(filename), toSoupCookiePersistentStorageType(storage));
 }
 
 /**
index 0a20d85..11ea10e 100644 (file)
@@ -51,9 +51,6 @@ Ref<WebCookieManagerProxy> WebCookieManagerProxy::create(WebProcessPool* process
 
 WebCookieManagerProxy::WebCookieManagerProxy(WebProcessPool* processPool)
     : WebContextSupplement(processPool)
-#if USE(SOUP)
-    , m_cookiePersistentStorageType(SoupCookiePersistentStorageSQLite)
-#endif
 {
     WebContextSupplement::processPool()->addMessageReceiver(Messages::WebCookieManagerProxy::messageReceiverName(), *this);
 }
index 9f240d3..e7f2e20 100644 (file)
@@ -32,6 +32,7 @@
 #include "WebCookieManagerProxyClient.h"
 #include <pal/SessionID.h>
 #include <wtf/Forward.h>
+#include <wtf/HashMap.h>
 #include <wtf/RefPtr.h>
 
 #if USE(SOUP)
@@ -97,8 +98,8 @@ public:
     void unregisterObserver(PAL::SessionID, Observer&);
 
 #if USE(SOUP)
-    void setCookiePersistentStorage(const String& storagePath, uint32_t storageType);
-    void getCookiePersistentStorage(String& storagePath, uint32_t& storageType) const;
+    void setCookiePersistentStorage(PAL::SessionID, const String& storagePath, uint32_t storageType);
+    void getCookiePersistentStorage(PAL::SessionID, String& storagePath, uint32_t& storageType) const;
 #endif
 
     using API::Object::ref;
@@ -139,8 +140,8 @@ private:
     WebCookieManagerProxyClient m_client;
 
 #if USE(SOUP)
-    String m_cookiePersistentStoragePath;
-    SoupCookiePersistentStorageType m_cookiePersistentStorageType;
+    using CookiePersistentStorageMap = HashMap<PAL::SessionID, std::pair<String, SoupCookiePersistentStorageType>>;
+    CookiePersistentStorageMap m_cookiePersistentStorageMap;
 #endif
 };
 
index a0f8f68..8a9c178 100644 (file)
@@ -36,7 +36,6 @@
 #include "ShouldGrandfatherStatistics.h"
 #include "StorageAccessStatus.h"
 #include "StorageManager.h"
-#include "WebCookieManagerProxy.h"
 #include "WebProcessMessages.h"
 #include "WebProcessPool.h"
 #include "WebResourceLoadStatisticsStore.h"
@@ -2061,7 +2060,6 @@ void WebsiteDataStore::clearPendingCookies()
 #if !PLATFORM(COCOA)
 WebsiteDataStoreParameters WebsiteDataStore::parameters()
 {
-    // FIXME: Implement cookies.
     WebsiteDataStoreParameters parameters;
     parameters.networkSessionParameters.sessionID = m_sessionID;
 
@@ -2079,9 +2077,7 @@ WebsiteDataStoreParameters WebsiteDataStore::parameters()
         SandboxExtension::createHandleForReadWriteDirectory(parameters.serviceWorkerRegistrationDirectory, parameters.serviceWorkerRegistrationDirectoryExtensionHandle);
 #endif
 
-#if USE(CURL)
-    platformSetParameters(parameters);
-#endif
+    platformSetNetworkParameters(parameters);
 
     return parameters;
 }
index db652e6..38250df 100644 (file)
@@ -204,7 +204,6 @@ public:
 #endif
 
 #if USE(CURL)
-    void platformSetParameters(WebsiteDataStoreParameters&);
     void setNetworkProxySettings(WebCore::CurlProxySettings&&);
     const WebCore::CurlProxySettings& networkProxySettings() const { return m_proxySettings; }
 #endif
@@ -249,6 +248,10 @@ private:
     void platformDestroy();
     static void platformRemoveRecentSearches(WallTime);
 
+#if USE(CURL) || USE(SOUP)
+    void platformSetNetworkParameters(WebsiteDataStoreParameters&);
+#endif
+
     HashSet<RefPtr<WebProcessPool>> processPools(size_t count = std::numeric_limits<size_t>::max(), bool ensureAPoolExists = true) const;
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
index 38b6a0d..4138aec 100644 (file)
@@ -32,7 +32,7 @@
 
 namespace WebKit {
 
-void WebsiteDataStore::platformSetParameters(WebsiteDataStoreParameters& parameters)
+void WebsiteDataStore::platformSetNetworkParameters(WebsiteDataStoreParameters& parameters)
 {
     parameters.networkSessionParameters.proxySettings = m_proxySettings;
 }
diff --git a/Source/WebKit/UIProcess/WebsiteData/soup/WebsiteDataStoreSoup.cpp b/Source/WebKit/UIProcess/WebsiteData/soup/WebsiteDataStoreSoup.cpp
new file mode 100644 (file)
index 0000000..489c3f2
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2019 Igalia S.L.
+ * Copyright (C) 2019 Metrological Group B.V.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebsiteDataStore.h"
+
+#include "WebCookieManagerProxy.h"
+#include "WebProcessPool.h"
+#include "WebsiteDataStoreParameters.h"
+
+namespace WebKit {
+
+void WebsiteDataStore::platformSetNetworkParameters(WebsiteDataStoreParameters& parameters)
+{
+    auto& networkSessionParameters = parameters.networkSessionParameters;
+
+    if (auto* processPool = processPoolForCookieStorageOperations())
+        processPool->supplement<WebCookieManagerProxy>()->getCookiePersistentStorage(m_sessionID, networkSessionParameters.cookiePersistentStoragePath, networkSessionParameters.cookiePersistentStorageType);
+}
+
+}
index fa6e2d3..06ea26d 100644 (file)
 
 namespace WebKit {
 
-void WebCookieManagerProxy::setCookiePersistentStorage(const String& storagePath, uint32_t storageType)
+void WebCookieManagerProxy::setCookiePersistentStorage(PAL::SessionID sessionID, const String& storagePath, uint32_t storageType)
 {
-    m_cookiePersistentStoragePath = storagePath;
-    m_cookiePersistentStorageType = static_cast<SoupCookiePersistentStorageType>(storageType);
-    processPool()->sendToNetworkingProcess(Messages::WebCookieManager::SetCookiePersistentStorage(storagePath, storageType));
+    m_cookiePersistentStorageMap.set(sessionID, std::make_pair(storagePath, static_cast<SoupCookiePersistentStorageType>(storageType)));
+    processPool()->sendToNetworkingProcess(Messages::WebCookieManager::SetCookiePersistentStorage(sessionID, storagePath, storageType));
 }
 
-void WebCookieManagerProxy::getCookiePersistentStorage(String& storagePath, uint32_t& storageType) const
+void WebCookieManagerProxy::getCookiePersistentStorage(PAL::SessionID sessionID, String& storagePath, uint32_t& storageType) const
 {
-    storagePath = m_cookiePersistentStoragePath;
-    storageType = static_cast<uint32_t>(m_cookiePersistentStorageType);
+    auto pair = m_cookiePersistentStorageMap.get(sessionID);
+    storagePath = pair.first;
+    storageType = static_cast<uint32_t>(pair.second);
 }
 
 }
index 3586bc3..7852292 100644 (file)
@@ -38,7 +38,6 @@ namespace WebKit {
 
 void WebProcessPool::platformInitializeNetworkProcess(NetworkProcessCreationParameters& parameters)
 {
-    supplement<WebCookieManagerProxy>()->getCookiePersistentStorage(parameters.cookiePersistentStoragePath, parameters.cookiePersistentStorageType);
     parameters.cookieAcceptPolicy = m_initialHTTPCookieAcceptPolicy;
     parameters.ignoreTLSErrors = m_ignoreTLSErrors;
     parameters.languages = userPreferredLanguages();