Use sendWithAsyncReply for cookie getting/clearing functions
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Oct 2019 16:41:45 +0000 (16:41 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Oct 2019 16:41:45 +0000 (16:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=202841

Patch by Alex Christensen <achristensen@webkit.org> on 2019-10-11
Reviewed by Carlos Garcia Campos.

No change in behavior.  This just simplifies the message sending a bit.

* NetworkProcess/Cookies/WebCookieManager.cpp:
(WebKit::WebCookieManager::getHostnamesWithCookies):
(WebKit::WebCookieManager::deleteAllCookies):
(WebKit::WebCookieManager::deleteCookie):
(WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
(WebKit::WebCookieManager::getAllCookies):
(WebKit::WebCookieManager::getCookies):
(WebKit::WebCookieManager::setCookie):
(WebKit::WebCookieManager::setCookies):
(WebKit::WebCookieManager::setHTTPCookieAcceptPolicy):
(WebKit::WebCookieManager::getHTTPCookieAcceptPolicy):
* NetworkProcess/Cookies/WebCookieManager.h:
* NetworkProcess/Cookies/WebCookieManager.messages.in:
* NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
* UIProcess/API/APIHTTPCookieStore.cpp:
(API::HTTPCookieStore::cookies):
(API::HTTPCookieStore::setCookies):
(API::HTTPCookieStore::deleteCookie):
(API::HTTPCookieStore::setHTTPCookieAcceptPolicy):
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _setCookieAcceptPolicy:]):
* UIProcess/API/glib/WebKitCookieManager.cpp:
(webkit_cookie_manager_set_accept_policy):
(webkit_cookie_manager_get_accept_policy):
(webkit_cookie_manager_add_cookie):
(webkit_cookie_manager_get_cookies):
(webkit_cookie_manager_delete_cookie):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::addSingleCookie):
* UIProcess/AuxiliaryProcessProxy.h:
(WebKit::AuxiliaryProcessProxy::sendWithAsyncReply):
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::processPoolDestroyed):
(WebKit::WebCookieManagerProxy::processDidClose):
(WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
(WebKit::WebCookieManagerProxy::deleteCookie):
(WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
(WebKit::WebCookieManagerProxy::setCookies):
(WebKit::WebCookieManagerProxy::getAllCookies):
(WebKit::WebCookieManagerProxy::getCookies):
(WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
(WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
(WebKit::WebCookieManagerProxy::didGetHostnamesWithCookies): Deleted.
(WebKit::WebCookieManagerProxy::didSetCookies): Deleted.
(WebKit::WebCookieManagerProxy::didGetCookies): Deleted.
(WebKit::WebCookieManagerProxy::didDeleteCookies): Deleted.
(WebKit::WebCookieManagerProxy::didGetHTTPCookieAcceptPolicy): Deleted.
(WebKit::WebCookieManagerProxy::didSetHTTPCookieAcceptPolicy): Deleted.
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebCookieManagerProxy.messages.in:

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

16 files changed:
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/Cookies/WebCookieManager.cpp
Source/WebKit/NetworkProcess/Cookies/WebCookieManager.h
Source/WebKit/NetworkProcess/Cookies/WebCookieManager.messages.in
Source/WebKit/NetworkProcess/Cookies/curl/WebCookieManagerCurl.cpp
Source/WebKit/NetworkProcess/Cookies/mac/WebCookieManagerMac.mm
Source/WebKit/NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp
Source/WebKit/NetworkProcess/soup/NetworkProcessSoup.cpp
Source/WebKit/UIProcess/API/APIHTTPCookieStore.cpp
Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm
Source/WebKit/UIProcess/API/glib/WebKitCookieManager.cpp
Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp
Source/WebKit/UIProcess/AuxiliaryProcessProxy.h
Source/WebKit/UIProcess/WebCookieManagerProxy.cpp
Source/WebKit/UIProcess/WebCookieManagerProxy.h
Source/WebKit/UIProcess/WebCookieManagerProxy.messages.in

index b48cd2e..99dc572 100644 (file)
@@ -1,3 +1,63 @@
+2019-10-11  Alex Christensen  <achristensen@webkit.org>
+
+        Use sendWithAsyncReply for cookie getting/clearing functions
+        https://bugs.webkit.org/show_bug.cgi?id=202841
+
+        Reviewed by Carlos Garcia Campos.
+
+        No change in behavior.  This just simplifies the message sending a bit.
+
+        * NetworkProcess/Cookies/WebCookieManager.cpp:
+        (WebKit::WebCookieManager::getHostnamesWithCookies):
+        (WebKit::WebCookieManager::deleteAllCookies):
+        (WebKit::WebCookieManager::deleteCookie):
+        (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
+        (WebKit::WebCookieManager::getAllCookies):
+        (WebKit::WebCookieManager::getCookies):
+        (WebKit::WebCookieManager::setCookie):
+        (WebKit::WebCookieManager::setCookies):
+        (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy):
+        (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy):
+        * NetworkProcess/Cookies/WebCookieManager.h:
+        * NetworkProcess/Cookies/WebCookieManager.messages.in:
+        * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
+        * UIProcess/API/APIHTTPCookieStore.cpp:
+        (API::HTTPCookieStore::cookies):
+        (API::HTTPCookieStore::setCookies):
+        (API::HTTPCookieStore::deleteCookie):
+        (API::HTTPCookieStore::setHTTPCookieAcceptPolicy):
+        * UIProcess/API/Cocoa/WKProcessPool.mm:
+        (-[WKProcessPool _setCookieAcceptPolicy:]):
+        * UIProcess/API/glib/WebKitCookieManager.cpp:
+        (webkit_cookie_manager_set_accept_policy):
+        (webkit_cookie_manager_get_accept_policy):
+        (webkit_cookie_manager_add_cookie):
+        (webkit_cookie_manager_get_cookies):
+        (webkit_cookie_manager_delete_cookie):
+        * UIProcess/Automation/WebAutomationSession.cpp:
+        (WebKit::WebAutomationSession::addSingleCookie):
+        * UIProcess/AuxiliaryProcessProxy.h:
+        (WebKit::AuxiliaryProcessProxy::sendWithAsyncReply):
+        * UIProcess/WebCookieManagerProxy.cpp:
+        (WebKit::WebCookieManagerProxy::processPoolDestroyed):
+        (WebKit::WebCookieManagerProxy::processDidClose):
+        (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
+        (WebKit::WebCookieManagerProxy::deleteCookie):
+        (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
+        (WebKit::WebCookieManagerProxy::setCookies):
+        (WebKit::WebCookieManagerProxy::getAllCookies):
+        (WebKit::WebCookieManagerProxy::getCookies):
+        (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
+        (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
+        (WebKit::WebCookieManagerProxy::didGetHostnamesWithCookies): Deleted.
+        (WebKit::WebCookieManagerProxy::didSetCookies): Deleted.
+        (WebKit::WebCookieManagerProxy::didGetCookies): Deleted.
+        (WebKit::WebCookieManagerProxy::didDeleteCookies): Deleted.
+        (WebKit::WebCookieManagerProxy::didGetHTTPCookieAcceptPolicy): Deleted.
+        (WebKit::WebCookieManagerProxy::didSetHTTPCookieAcceptPolicy): Deleted.
+        * UIProcess/WebCookieManagerProxy.h:
+        * UIProcess/WebCookieManagerProxy.messages.in:
+
 2019-10-10  Alex Christensen  <achristensen@webkit.org>
 
         Remove unused WebProcessPool::requestNetworkingStatistics
index cb8a1a1..5d6f052 100644 (file)
@@ -54,13 +54,12 @@ WebCookieManager::WebCookieManager(NetworkProcess& process)
 
 WebCookieManager::~WebCookieManager() = default;
 
-void WebCookieManager::getHostnamesWithCookies(PAL::SessionID sessionID, CallbackID callbackID)
+void WebCookieManager::getHostnamesWithCookies(PAL::SessionID sessionID, CompletionHandler<void(Vector<String>&&)>&& completionHandler)
 {
     HashSet<String> hostnames;
     if (auto* storageSession = m_process.storageSession(sessionID))
         storageSession->getHostnamesWithCookies(hostnames);
-
-    m_process.send(Messages::WebCookieManagerProxy::DidGetHostnamesWithCookies(copyToVector(hostnames), callbackID), 0);
+    completionHandler(copyToVector(hostnames));
 }
 
 void WebCookieManager::deleteCookiesForHostnames(PAL::SessionID sessionID, const Vector<String>& hostnames)
@@ -75,56 +74,50 @@ void WebCookieManager::deleteAllCookies(PAL::SessionID sessionID)
         storageSession->deleteAllCookies();
 }
 
-void WebCookieManager::deleteCookie(PAL::SessionID sessionID, const Cookie& cookie, CallbackID callbackID)
+void WebCookieManager::deleteCookie(PAL::SessionID sessionID, const Cookie& cookie, CompletionHandler<void()>&& completionHandler)
 {
     if (auto* storageSession = m_process.storageSession(sessionID))
         storageSession->deleteCookie(cookie);
-
-    m_process.send(Messages::WebCookieManagerProxy::DidDeleteCookies(callbackID), 0);
+    completionHandler();
 }
 
-void WebCookieManager::deleteAllCookiesModifiedSince(PAL::SessionID sessionID, WallTime time, CallbackID callbackID)
+void WebCookieManager::deleteAllCookiesModifiedSince(PAL::SessionID sessionID, WallTime time, CompletionHandler<void()>&& completionHandler)
 {
     if (auto* storageSession = m_process.storageSession(sessionID))
         storageSession->deleteAllCookiesModifiedSince(time);
-
-    m_process.send(Messages::WebCookieManagerProxy::DidDeleteCookies(callbackID), 0);
+    completionHandler();
 }
 
-void WebCookieManager::getAllCookies(PAL::SessionID sessionID, CallbackID callbackID)
+void WebCookieManager::getAllCookies(PAL::SessionID sessionID, CompletionHandler<void(Vector<WebCore::Cookie>&&)>&& completionHandler)
 {
     Vector<Cookie> cookies;
     if (auto* storageSession = m_process.storageSession(sessionID))
         cookies = storageSession->getAllCookies();
-
-    m_process.send(Messages::WebCookieManagerProxy::DidGetCookies(cookies, callbackID), 0);
+    completionHandler(WTFMove(cookies));
 }
 
-void WebCookieManager::getCookies(PAL::SessionID sessionID, const URL& url, CallbackID callbackID)
+void WebCookieManager::getCookies(PAL::SessionID sessionID, const URL& url, CompletionHandler<void(Vector<WebCore::Cookie>&&)>&& completionHandler)
 {
     Vector<Cookie> cookies;
     if (auto* storageSession = m_process.storageSession(sessionID))
         cookies = storageSession->getCookies(url);
-
-    m_process.send(Messages::WebCookieManagerProxy::DidGetCookies(cookies, callbackID), 0);
+    completionHandler(WTFMove(cookies));
 }
 
-void WebCookieManager::setCookie(PAL::SessionID sessionID, const Vector<Cookie>& cookies, CallbackID callbackID)
+void WebCookieManager::setCookie(PAL::SessionID sessionID, const Vector<Cookie>& cookies, CompletionHandler<void()>&& completionHandler)
 {
     if (auto* storageSession = m_process.storageSession(sessionID)) {
         for (auto& cookie : cookies)
             storageSession->setCookie(cookie);
     }
-
-    m_process.send(Messages::WebCookieManagerProxy::DidSetCookies(callbackID), 0);
+    completionHandler();
 }
 
-void WebCookieManager::setCookies(PAL::SessionID sessionID, const Vector<Cookie>& cookies, const URL& url, const URL& mainDocumentURL, CallbackID callbackID)
+void WebCookieManager::setCookies(PAL::SessionID sessionID, const Vector<Cookie>& cookies, const URL& url, const URL& mainDocumentURL, CompletionHandler<void()>&& completionHandler)
 {
     if (auto* storageSession = m_process.storageSession(sessionID))
         storageSession->setCookies(cookies, url, mainDocumentURL);
-
-    m_process.send(Messages::WebCookieManagerProxy::DidSetCookies(callbackID), 0);
+    completionHandler();
 }
 
 void WebCookieManager::notifyCookiesDidChange(PAL::SessionID sessionID)
@@ -148,17 +141,16 @@ void WebCookieManager::stopObservingCookieChanges(PAL::SessionID sessionID)
         WebCore::stopObservingCookieChanges(*storageSession);
 }
 
-void WebCookieManager::setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy policy, OptionalCallbackID callbackID)
+void WebCookieManager::setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy policy, CompletionHandler<void()>&& completionHandler)
 {
     platformSetHTTPCookieAcceptPolicy(policy);
 
-    if (callbackID)
-        m_process.send(Messages::WebCookieManagerProxy::DidSetHTTPCookieAcceptPolicy(callbackID.callbackID()), 0);
+    completionHandler();
 }
 
-void WebCookieManager::getHTTPCookieAcceptPolicy(CallbackID callbackID)
+void WebCookieManager::getHTTPCookieAcceptPolicy(CompletionHandler<void(HTTPCookieAcceptPolicy)>&& completionHandler)
 {
-    m_process.send(Messages::WebCookieManagerProxy::DidGetHTTPCookieAcceptPolicy(platformGetHTTPCookieAcceptPolicy(), callbackID), 0);
+    completionHandler(platformGetHTTPCookieAcceptPolicy());
 }
 
 } // namespace WebKit
index bbe3984..406bb90 100644 (file)
 
 #pragma once
 
-#include "CallbackID.h"
-#include "HTTPCookieAcceptPolicy.h"
 #include "MessageReceiver.h"
 #include "NetworkProcessSupplement.h"
-#include "OptionalCallbackID.h"
 #include <pal/SessionID.h>
 #include <stdint.h>
 #include <wtf/Forward.h>
 #include <wtf/Noncopyable.h>
+#include <wtf/WallTime.h>
 
 #if USE(SOUP)
 #include "SoupCookiePersistentStorageType.h"
@@ -46,6 +44,7 @@ struct Cookie;
 namespace WebKit {
 
 class NetworkProcess;
+enum class HTTPCookieAcceptPolicy : uint8_t;
 
 class WebCookieManager : public NetworkProcessSupplement, public IPC::MessageReceiver {
     WTF_MAKE_FAST_ALLOCATED;
@@ -56,7 +55,7 @@ public:
 
     static const char* supplementName();
 
-    void setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy, OptionalCallbackID);
+    void setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy, CompletionHandler<void()>&&);
 
 #if USE(SOUP)
     void setCookiePersistentStorage(PAL::SessionID, const String& storagePath, SoupCookiePersistentStorageType);
@@ -68,20 +67,20 @@ private:
     // IPC::MessageReceiver
     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
 
-    void getHostnamesWithCookies(PAL::SessionID, CallbackID);
+    void getHostnamesWithCookies(PAL::SessionID, CompletionHandler<void(Vector<String>&&)>&&);
 
-    void deleteCookie(PAL::SessionID, const WebCore::Cookie&, CallbackID);
+    void deleteCookie(PAL::SessionID, const WebCore::Cookie&, CompletionHandler<void()>&&);
     void deleteCookiesForHostnames(PAL::SessionID, const Vector<String>&);
     void deleteAllCookies(PAL::SessionID);
-    void deleteAllCookiesModifiedSince(PAL::SessionID, WallTime, CallbackID);
+    void deleteAllCookiesModifiedSince(PAL::SessionID, WallTime, CompletionHandler<void()>&&);
 
-    void setCookie(PAL::SessionID, const Vector<WebCore::Cookie>&, CallbackID);
-    void setCookies(PAL::SessionID, const Vector<WebCore::Cookie>&, const URL&, const URL& mainDocumentURL, CallbackID);
-    void getAllCookies(PAL::SessionID, CallbackID);
-    void getCookies(PAL::SessionID, const URL&, CallbackID);
+    void setCookie(PAL::SessionID, const Vector<WebCore::Cookie>&, CompletionHandler<void()>&&);
+    void setCookies(PAL::SessionID, const Vector<WebCore::Cookie>&, const URL&, const URL& mainDocumentURL, CompletionHandler<void()>&&);
+    void getAllCookies(PAL::SessionID, CompletionHandler<void(Vector<WebCore::Cookie>&&)>&&);
+    void getCookies(PAL::SessionID, const URL&, CompletionHandler<void(Vector<WebCore::Cookie>&&)>&&);
 
     void platformSetHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy);
-    void getHTTPCookieAcceptPolicy(CallbackID);
+    void getHTTPCookieAcceptPolicy(CompletionHandler<void(HTTPCookieAcceptPolicy)>&&);
     HTTPCookieAcceptPolicy platformGetHTTPCookieAcceptPolicy();
 
     void startObservingCookieChanges(PAL::SessionID);
index 518d11c..f29fed3 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
  
- messages -> WebCookieManager {
-    void GetHostnamesWithCookies(PAL::SessionID sessionID, WebKit::CallbackID callbackID)
+messages -> WebCookieManager {
+    void GetHostnamesWithCookies(PAL::SessionID sessionID) -> (Vector<String> hostnames) Async
     void DeleteCookiesForHostnames(PAL::SessionID sessionID, Vector<String> hostnames)
     void DeleteAllCookies(PAL::SessionID sessionID)
 
-    void SetCookie(PAL::SessionID sessionID, Vector<WebCore::Cookie> cookie, WebKit::CallbackID callbackID)
-    void SetCookies(PAL::SessionID sessionID, Vector<WebCore::Cookie> cookies, URL url, URL mainDocumentURL, WebKit::CallbackID callbackID)
-    void GetAllCookies(PAL::SessionID sessionID, WebKit::CallbackID callbackID)
-    void GetCookies(PAL::SessionID sessionID, URL url, WebKit::CallbackID callbackID)
-    void DeleteCookie(PAL::SessionID sessionID, struct WebCore::Cookie cookie, WebKit::CallbackID callbackID)
-    void DeleteAllCookiesModifiedSince(PAL::SessionID sessionID, WallTime time, WebKit::CallbackID callbackID)
+    void SetCookie(PAL::SessionID sessionID, Vector<WebCore::Cookie> cookie) -> () Async
+    void SetCookies(PAL::SessionID sessionID, Vector<WebCore::Cookie> cookies, URL url, URL mainDocumentURL) -> () Async
+    void GetAllCookies(PAL::SessionID sessionID) -> (Vector<WebCore::Cookie> cookies) Async
+    void GetCookies(PAL::SessionID sessionID, URL url) -> (Vector<WebCore::Cookie> cookies) Async
+    void DeleteCookie(PAL::SessionID sessionID, struct WebCore::Cookie cookie) -> () Async
+    void DeleteAllCookiesModifiedSince(PAL::SessionID sessionID, WallTime time) -> () Async
 
-    void SetHTTPCookieAcceptPolicy(enum:uint8_t WebKit::HTTPCookieAcceptPolicy policy, WebKit::OptionalCallbackID callbackID)
-    void GetHTTPCookieAcceptPolicy(WebKit::CallbackID callbackID)
+    void SetHTTPCookieAcceptPolicy(enum:uint8_t WebKit::HTTPCookieAcceptPolicy policy) -> () Async
+    void GetHTTPCookieAcceptPolicy() -> (enum:uint8_t WebKit::HTTPCookieAcceptPolicy policy) Async
     
     void StartObservingCookieChanges(PAL::SessionID sessionID)
     void StopObservingCookieChanges(PAL::SessionID sessionID)
index 80f3b49..c1a36cd 100644 (file)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "WebCookieManager.h"
 
+#include "HTTPCookieAcceptPolicy.h"
 #include "NetworkProcess.h"
 #include <WebCore/NetworkStorageSession.h>
 
index ee46ae5..bc9e924 100644 (file)
@@ -26,6 +26,7 @@
 #import "config.h"
 #import "WebCookieManager.h"
 
+#import "HTTPCookieAcceptPolicy.h"
 #import "NetworkProcess.h"
 #import "NetworkSession.h"
 #import <WebCore/NetworkStorageSession.h>
index 4d97da7..ea91522 100644 (file)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "WebCookieManager.h"
 
+#include "HTTPCookieAcceptPolicy.h"
 #include "NetworkProcess.h"
 #include "NetworkSessionSoup.h"
 #include "SoupCookiePersistentStorageType.h"
index 82d26c2..5a6ce81 100644 (file)
@@ -131,7 +131,7 @@ void NetworkProcess::platformInitializeNetworkProcess(const NetworkProcessCreati
     g_resolver_set_default(cachedResolver.get());
 
     m_cacheOptions = { NetworkCache::CacheOption::RegisterNotify };
-    supplement<WebCookieManager>()->setHTTPCookieAcceptPolicy(parameters.cookieAcceptPolicy, OptionalCallbackID());
+    supplement<WebCookieManager>()->setHTTPCookieAcceptPolicy(parameters.cookieAcceptPolicy, []() { });
 
     if (!parameters.languages.isEmpty())
         userPreferredLanguagesChanged(parameters.languages);
index cf706d5..c2f7ea2 100644 (file)
@@ -69,7 +69,7 @@ void HTTPCookieStore::cookies(CompletionHandler<void(const Vector<WebCore::Cooki
     }
 
     auto* cookieManager = pool->supplement<WebKit::WebCookieManagerProxy>();
-    cookieManager->getAllCookies(m_owningDataStore->sessionID(), [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)] (const Vector<WebCore::Cookie>& cookies, CallbackBase::Error error) mutable {
+    cookieManager->getAllCookies(m_owningDataStore->sessionID(), [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)] (const Vector<WebCore::Cookie>& cookies) mutable {
         completionHandler(cookies);
     });
 }
@@ -91,7 +91,7 @@ void HTTPCookieStore::setCookies(const Vector<WebCore::Cookie>& cookies, Complet
     }
 
     auto* cookieManager = pool->supplement<WebKit::WebCookieManagerProxy>();
-    cookieManager->setCookies(m_owningDataStore->sessionID(), cookies, [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)] (CallbackBase::Error error) mutable {
+    cookieManager->setCookies(m_owningDataStore->sessionID(), cookies, [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)] () mutable {
         completionHandler();
     });
 }
@@ -112,7 +112,7 @@ void HTTPCookieStore::deleteCookie(const WebCore::Cookie& cookie, CompletionHand
     }
 
     auto* cookieManager = pool->supplement<WebKit::WebCookieManagerProxy>();
-    cookieManager->deleteCookie(m_owningDataStore->sessionID(), cookie, [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)](CallbackBase::Error error) mutable {
+    cookieManager->deleteCookie(m_owningDataStore->sessionID(), cookie, [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)]() mutable {
         completionHandler();
     });
 }
@@ -144,7 +144,7 @@ void HTTPCookieStore::setHTTPCookieAcceptPolicy(WebKit::HTTPCookieAcceptPolicy p
     }
 
     auto* cookieManager = pool->supplement<WebKit::WebCookieManagerProxy>();
-    cookieManager->setHTTPCookieAcceptPolicy(m_owningDataStore->sessionID(), policy, [completionHandler = WTFMove(completionHandler)] (CallbackBase::Error) mutable {
+    cookieManager->setHTTPCookieAcceptPolicy(m_owningDataStore->sessionID(), policy, [completionHandler = WTFMove(completionHandler)] () mutable {
         completionHandler();
     });
 }
index c2a9566..238ced3 100644 (file)
@@ -217,7 +217,7 @@ static WebKit::HTTPCookieAcceptPolicy toHTTPCookieAcceptPolicy(NSHTTPCookieAccep
 
 - (void)_setCookieAcceptPolicy:(NSHTTPCookieAcceptPolicy)policy
 {
-    _processPool->supplement<WebKit::WebCookieManagerProxy>()->setHTTPCookieAcceptPolicy(PAL::SessionID::defaultSessionID(), toHTTPCookieAcceptPolicy(policy), [](WebKit::CallbackBase::Error){});
+    _processPool->supplement<WebKit::WebCookieManagerProxy>()->setHTTPCookieAcceptPolicy(PAL::SessionID::defaultSessionID(), toHTTPCookieAcceptPolicy(policy), []() { });
 }
 
 - (id)_objectForBundleParameter:(NSString *)parameter
index d36d0b7..b8c5090 100644 (file)
@@ -190,7 +190,7 @@ void webkit_cookie_manager_set_accept_policy(WebKitCookieManager* manager, WebKi
     g_return_if_fail(WEBKIT_IS_COOKIE_MANAGER(manager));
 
     for (auto* processPool : webkitWebsiteDataManagerGetProcessPools(manager->priv->dataManager))
-        processPool->supplement<WebCookieManagerProxy>()->setHTTPCookieAcceptPolicy(manager->priv->sessionID(), toHTTPCookieAcceptPolicy(policy), [](CallbackBase::Error) { });
+        processPool->supplement<WebCookieManagerProxy>()->setHTTPCookieAcceptPolicy(manager->priv->sessionID(), toHTTPCookieAcceptPolicy(policy), []() { });
 }
 
 /**
@@ -218,7 +218,7 @@ void webkit_cookie_manager_get_accept_policy(WebKitCookieManager* manager, GCanc
         return;
     }
 
-    processPools[0]->supplement<WebCookieManagerProxy>()->getHTTPCookieAcceptPolicy(manager->priv->sessionID(), [task = WTFMove(task)](HTTPCookieAcceptPolicy policy, CallbackBase::Error) {
+    processPools[0]->supplement<WebCookieManagerProxy>()->getHTTPCookieAcceptPolicy(manager->priv->sessionID(), [task = WTFMove(task)](HTTPCookieAcceptPolicy policy) {
         g_task_return_int(task.get(), toWebKitCookieAcceptPolicy(policy));
     });
 }
@@ -267,14 +267,7 @@ void webkit_cookie_manager_add_cookie(WebKitCookieManager* manager, SoupCookie*
     // Cookies are read/written from/to the same SQLite database on disk regardless
     // of the process we access them from, so just use the first process pool.
     const auto& processPools = webkitWebsiteDataManagerGetProcessPools(manager->priv->dataManager);
-    processPools[0]->supplement<WebCookieManagerProxy>()->setCookies(manager->priv->sessionID(), { WebCore::Cookie(cookie) }, [task = WTFMove(task)](CallbackBase::Error error) {
-        if (error != CallbackBase::Error::None) {
-            // This can only happen in cases where the web process is not available,
-            // consider the operation "cancelled" from the point of view of the client.
-            g_task_return_new_error(task.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED, _("Operation was cancelled"));
-            return;
-        }
-
+    processPools[0]->supplement<WebCookieManagerProxy>()->setCookies(manager->priv->sessionID(), { WebCore::Cookie(cookie) }, [task = WTFMove(task)]() {
         g_task_return_boolean(task.get(), TRUE);
     });
 }
@@ -325,14 +318,7 @@ void webkit_cookie_manager_get_cookies(WebKitCookieManager* manager, const gchar
     // Cookies are read/written from/to the same SQLite database on disk regardless
     // of the process we access them from, so just use the first process pool.
     const auto& processPools = webkitWebsiteDataManagerGetProcessPools(manager->priv->dataManager);
-    processPools[0]->supplement<WebCookieManagerProxy>()->getCookies(manager->priv->sessionID(), URL(URL(), String::fromUTF8(uri)), [task = WTFMove(task)](const Vector<WebCore::Cookie>& cookies, CallbackBase::Error error) {
-        if (error != CallbackBase::Error::None) {
-            // This can only happen in cases where the web process is not available,
-            // consider the operation "cancelled" from the point of view of the client.
-            g_task_return_new_error(task.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED, _("Operation was cancelled"));
-            return;
-        }
-
+    processPools[0]->supplement<WebCookieManagerProxy>()->getCookies(manager->priv->sessionID(), URL(URL(), String::fromUTF8(uri)), [task = WTFMove(task)](const Vector<WebCore::Cookie>& cookies) {
         GList* cookiesList = nullptr;
         for (auto& cookie : cookies)
             cookiesList = g_list_prepend(cookiesList, cookie.toSoupCookie());
@@ -390,14 +376,7 @@ void webkit_cookie_manager_delete_cookie(WebKitCookieManager* manager, SoupCooki
     // Cookies are read/written from/to the same SQLite database on disk regardless
     // of the process we access them from, so just use the first process pool.
     const auto& processPools = webkitWebsiteDataManagerGetProcessPools(manager->priv->dataManager);
-    processPools[0]->supplement<WebCookieManagerProxy>()->deleteCookie(manager->priv->sessionID(), WebCore::Cookie(cookie), [task = WTFMove(task)](CallbackBase::Error error) {
-        if (error != CallbackBase::Error::None) {
-            // This can only happen in cases where the web process is not available,
-            // consider the operation "cancelled" from the point of view of the client.
-            g_task_return_new_error(task.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED, _("Operation was cancelled"));
-            return;
-        }
-
+    processPools[0]->supplement<WebCookieManagerProxy>()->deleteCookie(manager->priv->sessionID(), WebCore::Cookie(cookie), [task = WTFMove(task)]() {
         g_task_return_boolean(task.get(), TRUE);
     });
 }
index 47f9174..97b4782 100644 (file)
@@ -1358,11 +1358,8 @@ void WebAutomationSession::addSingleCookie(const String& browsingContextHandle,
         ASYNC_FAIL_WITH_PREDEFINED_ERROR_AND_DETAILS(MissingParameter, "The parameter 'httpOnly' was not found.");
 
     WebCookieManagerProxy* cookieManager = m_processPool->supplement<WebCookieManagerProxy>();
-    cookieManager->setCookies(page->websiteDataStore().sessionID(), { cookie }, [callback = callback.copyRef()](CallbackBase::Error error) {
-        if (error == CallbackBase::Error::None)
-            callback->sendSuccess();
-        else
-            callback->sendFailure(STRING_FOR_PREDEFINED_ERROR_NAME(InternalError));
+    cookieManager->setCookies(page->websiteDataStore().sessionID(), { cookie }, [callback = callback.copyRef()]() {
+        callback->sendSuccess();
     });
 }
 
index a6594b2..37fda5a 100644 (file)
@@ -50,7 +50,7 @@ public:
 
     template<typename T> bool send(T&& message, uint64_t destinationID, OptionSet<IPC::SendOption> sendOptions = { });
     template<typename T> bool sendSync(T&& message, typename T::Reply&&, uint64_t destinationID, Seconds timeout = 1_s, OptionSet<IPC::SendSyncOption> sendSyncOptions = { });
-    template<typename T, typename... Args> void sendWithAsyncReply(T&&, CompletionHandler<void(Args...)>&&, uint64_t destinationID = 0, OptionSet<IPC::SendOption> = { });
+    template<typename T, typename C> void sendWithAsyncReply(T&&, C&&, uint64_t destinationID = 0, OptionSet<IPC::SendOption> = { });
     
     template<typename T, typename U>
     bool send(T&& message, ObjectIdentifier<U> destinationID, OptionSet<IPC::SendOption> sendOptions = { })
@@ -166,8 +166,8 @@ bool AuxiliaryProcessProxy::sendSync(U&& message, typename U::Reply&& reply, uin
     return connection()->sendSync(std::forward<U>(message), WTFMove(reply), destinationID, timeout, sendSyncOptions);
 }
 
-template<typename T, typename... Args>
-void AuxiliaryProcessProxy::sendWithAsyncReply(T&& message, CompletionHandler<void(Args...)>&& completionHandler, uint64_t destinationID, OptionSet<IPC::SendOption> sendOptions)
+template<typename T, typename C>
+void AuxiliaryProcessProxy::sendWithAsyncReply(T&& message, C&& completionHandler, uint64_t destinationID, OptionSet<IPC::SendOption> sendOptions)
 {
     COMPILE_ASSERT(!T::isSync, AsyncMessageExpected);
 
index 04d0da2..1b3e155 100644 (file)
@@ -69,8 +69,6 @@ void WebCookieManagerProxy::initializeClient(const WKCookieManagerClientBase* cl
 
 void WebCookieManagerProxy::processPoolDestroyed()
 {
-    m_callbacks.invalidate(CallbackBase::Error::OwnerWasInvalidated);
-
     Vector<Observer*> observers;
     for (auto& observerSet : m_cookieObservers.values()) {
         for (auto* observer : observerSet)
@@ -85,12 +83,10 @@ void WebCookieManagerProxy::processPoolDestroyed()
 
 void WebCookieManagerProxy::processDidClose(WebProcessProxy*)
 {
-    m_callbacks.invalidate(CallbackBase::Error::ProcessExited);
 }
 
 void WebCookieManagerProxy::processDidClose(NetworkProcessProxy*)
 {
-    m_callbacks.invalidate(CallbackBase::Error::ProcessExited);
 }
 
 void WebCookieManagerProxy::refWebContextSupplement()
@@ -103,21 +99,12 @@ void WebCookieManagerProxy::derefWebContextSupplement()
     API::Object::deref();
 }
 
-void WebCookieManagerProxy::getHostnamesWithCookies(PAL::SessionID sessionID, Function<void (API::Array*, CallbackBase::Error)>&& callbackFunction)
-{
-    auto callbackID = m_callbacks.put(WTFMove(callbackFunction), processPool()->ensureNetworkProcess().throttler().backgroundActivityToken());
-    processPool()->sendToNetworkingProcess(Messages::WebCookieManager::GetHostnamesWithCookies(sessionID, callbackID));
-}
-
-void WebCookieManagerProxy::didGetHostnamesWithCookies(const Vector<String>& hostnames, WebKit::CallbackID callbackID)
+void WebCookieManagerProxy::getHostnamesWithCookies(PAL::SessionID sessionID, CompletionHandler<void(Vector<String>&&)>&& callbackFunction)
 {
-    auto callback = m_callbacks.take<ArrayCallback>(callbackID);
-    if (!callback) {
-        // FIXME: Log error or assert.
-        return;
-    }
-
-    callback->performCallbackWithReturnValue(API::Array::createStringArray(hostnames).ptr());
+    auto& networkProcess = processPool()->ensureNetworkProcess();
+    networkProcess.sendWithAsyncReply(Messages::WebCookieManager::GetHostnamesWithCookies(sessionID), [callbackFunction = WTFMove(callbackFunction), token = networkProcess.throttler().backgroundActivityToken()](Vector<String>&& hostnames) mutable {
+        callbackFunction(WTFMove(hostnames));
+    });
 }
 
 void WebCookieManagerProxy::deleteCookiesForHostnames(PAL::SessionID sessionID, const Vector<String>& hostnames)
@@ -130,55 +117,52 @@ void WebCookieManagerProxy::deleteAllCookies(PAL::SessionID sessionID)
     processPool()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::DeleteAllCookies(sessionID));
 }
 
-void WebCookieManagerProxy::deleteCookie(PAL::SessionID sessionID, const Cookie& cookie, Function<void (CallbackBase::Error)>&& callbackFunction)
-{
-    auto callbackID = m_callbacks.put(WTFMove(callbackFunction), processPool()->ensureNetworkProcess().throttler().backgroundActivityToken());
-    processPool()->sendToNetworkingProcess(Messages::WebCookieManager::DeleteCookie(sessionID, cookie, callbackID));
-}
-
-void WebCookieManagerProxy::deleteAllCookiesModifiedSince(PAL::SessionID sessionID, WallTime time, Function<void (CallbackBase::Error)>&& callbackFunction)
+void WebCookieManagerProxy::deleteCookie(PAL::SessionID sessionID, const Cookie& cookie, CompletionHandler<void()>&& callbackFunction)
 {
-    auto callbackID = m_callbacks.put(WTFMove(callbackFunction), processPool()->ensureNetworkProcess().throttler().backgroundActivityToken());
-    processPool()->sendToNetworkingProcess(Messages::WebCookieManager::DeleteAllCookiesModifiedSince(sessionID, time, callbackID));
+    auto& networkProcess = processPool()->ensureNetworkProcess();
+    networkProcess.sendWithAsyncReply(Messages::WebCookieManager::DeleteCookie(sessionID, cookie), [callbackFunction = WTFMove(callbackFunction), token = networkProcess.throttler().backgroundActivityToken()]() mutable {
+        callbackFunction();
+    });
 }
 
-void WebCookieManagerProxy::setCookies(PAL::SessionID sessionID, const Vector<Cookie>& cookies, Function<void(CallbackBase::Error)>&& callbackFunction)
+void WebCookieManagerProxy::deleteAllCookiesModifiedSince(PAL::SessionID sessionID, WallTime time, CompletionHandler<void()>&& callbackFunction)
 {
-    auto callbackID = m_callbacks.put(WTFMove(callbackFunction), processPool()->ensureNetworkProcess().throttler().backgroundActivityToken());
-    processPool()->sendToNetworkingProcess(Messages::WebCookieManager::SetCookie(sessionID, cookies, callbackID));
+    auto& networkProcess = processPool()->ensureNetworkProcess();
+    networkProcess.sendWithAsyncReply(Messages::WebCookieManager::DeleteAllCookiesModifiedSince(sessionID, time), [callbackFunction = WTFMove(callbackFunction), token = networkProcess.throttler().backgroundActivityToken()]() mutable {
+        callbackFunction();
+    });
 }
 
-void WebCookieManagerProxy::setCookies(PAL::SessionID sessionID, const Vector<Cookie>& cookies, const URL& url, const URL& mainDocumentURL, Function<void (CallbackBase::Error)>&& callbackFunction)
+void WebCookieManagerProxy::setCookies(PAL::SessionID sessionID, const Vector<Cookie>& cookies, CompletionHandler<void()>&& callbackFunction)
 {
-    auto callbackID = m_callbacks.put(WTFMove(callbackFunction), processPool()->ensureNetworkProcess().throttler().backgroundActivityToken());
-    processPool()->sendToNetworkingProcess(Messages::WebCookieManager::SetCookies(sessionID, cookies, url, mainDocumentURL, callbackID));
+    auto& networkProcess = processPool()->ensureNetworkProcess();
+    networkProcess.sendWithAsyncReply(Messages::WebCookieManager::SetCookie(sessionID, cookies), [callbackFunction = WTFMove(callbackFunction), token = networkProcess.throttler().backgroundActivityToken()]() mutable {
+        callbackFunction();
+    });
 }
 
-void WebCookieManagerProxy::getAllCookies(PAL::SessionID sessionID, Function<void (const Vector<Cookie>&, CallbackBase::Error)>&& callbackFunction)
+void WebCookieManagerProxy::setCookies(PAL::SessionID sessionID, const Vector<Cookie>& cookies, const URL& url, const URL& mainDocumentURL, CompletionHandler<void()>&& callbackFunction)
 {
-    auto callbackID = m_callbacks.put(WTFMove(callbackFunction), processPool()->ensureNetworkProcess().throttler().backgroundActivityToken());
-    processPool()->sendToNetworkingProcess(Messages::WebCookieManager::GetAllCookies(sessionID, callbackID));
+    auto& networkProcess = processPool()->ensureNetworkProcess();
+    networkProcess.sendWithAsyncReply(Messages::WebCookieManager::SetCookies(sessionID, cookies, url, mainDocumentURL), [callbackFunction = WTFMove(callbackFunction), token = networkProcess.throttler().backgroundActivityToken()]() mutable {
+        callbackFunction();
+    });
 }
 
-void WebCookieManagerProxy::getCookies(PAL::SessionID sessionID, const URL& url, Function<void (const Vector<Cookie>&, CallbackBase::Error)>&& callbackFunction)
+void WebCookieManagerProxy::getAllCookies(PAL::SessionID sessionID, CompletionHandler<void(Vector<Cookie>&&)>&& callbackFunction)
 {
-    auto callbackID = m_callbacks.put(WTFMove(callbackFunction), processPool()->ensureNetworkProcess().throttler().backgroundActivityToken());
-    processPool()->sendToNetworkingProcess(Messages::WebCookieManager::GetCookies(sessionID, url, callbackID));
+    auto& networkProcess = processPool()->ensureNetworkProcess();
+    networkProcess.sendWithAsyncReply(Messages::WebCookieManager::GetAllCookies(sessionID), [callbackFunction = WTFMove(callbackFunction), token = networkProcess.throttler().backgroundActivityToken()](Vector<Cookie>&& cookies) mutable {
+        callbackFunction(WTFMove(cookies));
+    });
 }
 
-void WebCookieManagerProxy::didSetCookies(WebKit::CallbackID callbackID)
+void WebCookieManagerProxy::getCookies(PAL::SessionID sessionID, const URL& url, CompletionHandler<void(Vector<Cookie>&&)>&& callbackFunction)
 {
-    m_callbacks.take<VoidCallback>(callbackID)->performCallback();
-}
-
-void WebCookieManagerProxy::didGetCookies(const Vector<Cookie>& cookies, WebKit::CallbackID callbackID)
-{
-    m_callbacks.take<GetCookiesCallback>(callbackID)->performCallbackWithReturnValue(cookies);
-}
-
-void WebCookieManagerProxy::didDeleteCookies(WebKit::CallbackID callbackID)
-{
-    m_callbacks.take<VoidCallback>(callbackID)->performCallback();
+    auto& networkProcess = processPool()->ensureNetworkProcess();
+    networkProcess.sendWithAsyncReply(Messages::WebCookieManager::GetCookies(sessionID, url), [callbackFunction = WTFMove(callbackFunction), token = networkProcess.throttler().backgroundActivityToken()](Vector<Cookie>&& cookies) mutable {
+        callbackFunction(WTFMove(cookies));
+    });
 }
 
 void WebCookieManagerProxy::startObservingCookieChanges(PAL::SessionID sessionID)
@@ -191,7 +175,6 @@ void WebCookieManagerProxy::stopObservingCookieChanges(PAL::SessionID sessionID)
     processPool()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::StopObservingCookieChanges(sessionID));
 }
 
-
 void WebCookieManagerProxy::setCookieObserverCallback(PAL::SessionID sessionID, WTF::Function<void ()>&& callback)
 {
     if (callback)
@@ -238,7 +221,7 @@ void WebCookieManagerProxy::cookiesDidChange(PAL::SessionID sessionID)
         observer->cookiesDidChange();
 }
 
-void WebCookieManagerProxy::setHTTPCookieAcceptPolicy(PAL::SessionID, HTTPCookieAcceptPolicy policy, Function<void (CallbackBase::Error)>&& callbackFunction)
+void WebCookieManagerProxy::setHTTPCookieAcceptPolicy(PAL::SessionID, HTTPCookieAcceptPolicy policy, CompletionHandler<void()>&& callbackFunction)
 {
 #if PLATFORM(COCOA)
     if (!processPool()->isUsingTestingNetworkSession())
@@ -248,24 +231,18 @@ void WebCookieManagerProxy::setHTTPCookieAcceptPolicy(PAL::SessionID, HTTPCookie
     processPool()->setInitialHTTPCookieAcceptPolicy(policy);
 #endif
 
-    auto callbackID = m_callbacks.put(WTFMove(callbackFunction), processPool()->ensureNetworkProcess().throttler().backgroundActivityToken());
-    processPool()->sendToNetworkingProcess(Messages::WebCookieManager::SetHTTPCookieAcceptPolicy(policy, OptionalCallbackID(callbackID)));
-}
-
-void WebCookieManagerProxy::getHTTPCookieAcceptPolicy(PAL::SessionID, Function<void (HTTPCookieAcceptPolicy, CallbackBase::Error)>&& callbackFunction)
-{
-    auto callbackID = m_callbacks.put(WTFMove(callbackFunction), processPool()->ensureNetworkProcess().throttler().backgroundActivityToken());
-    processPool()->sendToNetworkingProcess(Messages::WebCookieManager::GetHTTPCookieAcceptPolicy(callbackID));
-}
-
-void WebCookieManagerProxy::didGetHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy policy, WebKit::CallbackID callbackID)
-{
-    m_callbacks.take<HTTPCookieAcceptPolicyCallback>(callbackID)->performCallbackWithReturnValue(policy);
+    auto& networkProcess = processPool()->ensureNetworkProcess();
+    networkProcess.sendWithAsyncReply(Messages::WebCookieManager::SetHTTPCookieAcceptPolicy(policy), [callbackFunction = WTFMove(callbackFunction), token = networkProcess.throttler().backgroundActivityToken()]() mutable {
+        callbackFunction();
+    });
 }
 
-void WebCookieManagerProxy::didSetHTTPCookieAcceptPolicy(WebKit::CallbackID callbackID)
+void WebCookieManagerProxy::getHTTPCookieAcceptPolicy(PAL::SessionID, CompletionHandler<void(HTTPCookieAcceptPolicy)>&& callbackFunction)
 {
-    m_callbacks.take<VoidCallback>(callbackID)->performCallback();
+    auto& networkProcess = processPool()->ensureNetworkProcess();
+    networkProcess.sendWithAsyncReply(Messages::WebCookieManager::GetHTTPCookieAcceptPolicy(), [callbackFunction = WTFMove(callbackFunction), token = networkProcess.throttler().backgroundActivityToken()](HTTPCookieAcceptPolicy policy) mutable {
+        callbackFunction(policy);
+    });
 }
 
 } // namespace WebKit
index 2c90d4c..58b82fd 100644 (file)
@@ -65,20 +65,20 @@ public:
 
     void initializeClient(const WKCookieManagerClientBase*);
     
-    void getHostnamesWithCookies(PAL::SessionID, Function<void (API::Array*, CallbackBase::Error)>&&);
-    void deleteCookie(PAL::SessionID, const WebCore::Cookie&, Function<void (CallbackBase::Error)>&&);
+    void getHostnamesWithCookies(PAL::SessionID, CompletionHandler<void(Vector<String>&&)>&&);
+    void deleteCookie(PAL::SessionID, const WebCore::Cookie&, CompletionHandler<void()>&&);
     void deleteCookiesForHostnames(PAL::SessionID, const Vector<String>&);
     void deleteAllCookies(PAL::SessionID);
-    void deleteAllCookiesModifiedSince(PAL::SessionID, WallTime, Function<void (CallbackBase::Error)>&&);
+    void deleteAllCookiesModifiedSince(PAL::SessionID, WallTime, CompletionHandler<void()>&&);
 
-    void setCookies(PAL::SessionID, const Vector<WebCore::Cookie>&, Function<void(CallbackBase::Error)>&&);
-    void setCookies(PAL::SessionID, const Vector<WebCore::Cookie>&, const URL&, const URL& mainDocumentURL, Function<void(CallbackBase::Error)>&&);
+    void setCookies(PAL::SessionID, const Vector<WebCore::Cookie>&, CompletionHandler<void()>&&);
+    void setCookies(PAL::SessionID, const Vector<WebCore::Cookie>&, const URL&, const URL& mainDocumentURL, CompletionHandler<void()>&&);
 
-    void getAllCookies(PAL::SessionID, Function<void (const Vector<WebCore::Cookie>&, CallbackBase::Error)>&& completionHandler);
-    void getCookies(PAL::SessionID, const URL&, Function<void(const Vector<WebCore::Cookie>&, CallbackBase::Error)>&& completionHandler);
+    void getAllCookies(PAL::SessionID, CompletionHandler<void(Vector<WebCore::Cookie>&&)>&&);
+    void getCookies(PAL::SessionID, const URL&, CompletionHandler<void(Vector<WebCore::Cookie>&&)>&&);
 
-    void setHTTPCookieAcceptPolicy(PAL::SessionID, HTTPCookieAcceptPolicy, Function<void (CallbackBase::Error)>&&);
-    void getHTTPCookieAcceptPolicy(PAL::SessionID, Function<void (HTTPCookieAcceptPolicy, CallbackBase::Error)>&&);
+    void setHTTPCookieAcceptPolicy(PAL::SessionID, HTTPCookieAcceptPolicy, CompletionHandler<void()>&&);
+    void getHTTPCookieAcceptPolicy(PAL::SessionID, CompletionHandler<void(HTTPCookieAcceptPolicy)>&&);
 
     void startObservingCookieChanges(PAL::SessionID);
     void stopObservingCookieChanges(PAL::SessionID);
@@ -106,14 +106,6 @@ public:
 private:
     WebCookieManagerProxy(WebProcessPool*);
 
-    void didGetHostnamesWithCookies(const Vector<String>&, WebKit::CallbackID);
-    void didGetHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy, WebKit::CallbackID);
-
-    void didSetHTTPCookieAcceptPolicy(WebKit::CallbackID);
-    void didSetCookies(WebKit::CallbackID);
-    void didGetCookies(const Vector<WebCore::Cookie>&, WebKit::CallbackID);
-    void didDeleteCookies(WebKit::CallbackID);
-
     void cookiesDidChange(PAL::SessionID);
 
     // WebContextSupplement
@@ -130,8 +122,6 @@ private:
     void persistHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy);
 #endif
 
-    CallbackMap m_callbacks;
-
     HashMap<PAL::SessionID, WTF::Function<void ()>> m_legacyCookieObservers;
     HashMap<PAL::SessionID, HashSet<Observer*>> m_cookieObservers;
 
index bb6723c..a06b77b 100644 (file)
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 messages -> WebCookieManagerProxy {
-    DidGetHostnamesWithCookies(Vector<String> hostnames, WebKit::CallbackID callbackID);
-    DidGetHTTPCookieAcceptPolicy(enum:uint8_t WebKit::HTTPCookieAcceptPolicy policy, WebKit::CallbackID callbackID);
-
-    DidSetHTTPCookieAcceptPolicy(WebKit::CallbackID callbackID);
-    DidDeleteCookies(WebKit::CallbackID callbackID);
-    DidSetCookies(WebKit::CallbackID callbackID);
-    DidGetCookies(Vector<WebCore::Cookie> cookies, WebKit::CallbackID callbackID);
-
     CookiesDidChange(PAL::SessionID sessionID)
 }