Title: [213947] trunk
Revision
213947
Author
[email protected]
Date
2017-03-14 15:36:52 -0700 (Tue, 14 Mar 2017)

Log Message

Rename WKHTTPCookieStorage to WKHTTPCookieStore.
https://bugs.webkit.org/show_bug.cgi?id=169630

Reviewed by Tim Horton.

Source/WebKit2:

* CMakeLists.txt:

* Shared/API/APIObject.h:
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):

* UIProcess/API/APIHTTPCookieStore.cpp: Renamed from Source/WebKit2/UIProcess/API/APIHTTPCookieStorage.cpp.
(API::HTTPCookieStore::HTTPCookieStore):
(API::HTTPCookieStore::~HTTPCookieStore):
(API::HTTPCookieStore::cookies):
(API::HTTPCookieStore::setCookie):
(API::HTTPCookieStore::setCookies):
(API::HTTPCookieStore::deleteCookie):
(API::HTTPCookieStore::removeCookiesSinceDate):
(API::HTTPCookieStore::setHTTPCookieAcceptPolicy):
(API::HTTPCookieStore::getHTTPCookieAcceptPolicy):
* UIProcess/API/APIHTTPCookieStore.h: Renamed from Source/WebKit2/UIProcess/API/APIHTTPCookieStorage.h.

* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::httpCookieStore):
(API::WebsiteDataStore::httpCookieStorage): Deleted.
* UIProcess/API/APIWebsiteDataStore.h:

* UIProcess/API/Cocoa/WKHTTPCookieStore.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorage.h.
* UIProcess/API/Cocoa/WKHTTPCookieStore.mm: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorage.mm.
(coreCookiesToNSCookies):
(-[WKHTTPCookieStore dealloc]):
(-[WKHTTPCookieStore fetchCookies:]):
(-[WKHTTPCookieStore fetchCookiesForURL:completionHandler:]):
(-[WKHTTPCookieStore setCookie:completionHandler:]):
(-[WKHTTPCookieStore deleteCookie:completionHandler:]):
(-[WKHTTPCookieStore setCookies:forURL:mainDocumentURL:completionHandler:]):
(-[WKHTTPCookieStore removeCookiesSinceDate:completionHandler:]):
(-[WKHTTPCookieStore setCookieAcceptPolicy:completionHandler:]):
(kitCookiePolicyToNSCookiePolicy):
(-[WKHTTPCookieStore fetchCookieAcceptPolicy:]):
(-[WKHTTPCookieStore _apiObject]):
* UIProcess/API/Cocoa/WKHTTPCookieStoreInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorageInternal.h.
(WebKit::wrapper):

* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _httpCookieStore]):
(-[WKWebsiteDataStore _httpCookieStorage]): Deleted.
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:

* UIProcess/WebProcessPool.cpp:
* UIProcess/WebProcessPool.h:

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::processPoolForCookieStorageOperations):

* WebKit2.xcodeproj/project.pbxproj:

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/WKHTTPCookieStorage.mm:
(TEST):

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit2/CMakeLists.txt (213946 => 213947)


--- trunk/Source/WebKit2/CMakeLists.txt	2017-03-14 22:32:10 UTC (rev 213946)
+++ trunk/Source/WebKit2/CMakeLists.txt	2017-03-14 22:36:52 UTC (rev 213947)
@@ -333,7 +333,7 @@
     UIProcess/API/APIContentExtensionStore.cpp
     UIProcess/API/APIExperimentalFeature.cpp
     UIProcess/API/APIFrameInfo.cpp
-    UIProcess/API/APIHTTPCookieStorage.cpp
+    UIProcess/API/APIHTTPCookieStore.cpp
     UIProcess/API/APIHitTestResult.cpp
     UIProcess/API/APINavigation.cpp
     UIProcess/API/APINavigationData.cpp

Modified: trunk/Source/WebKit2/ChangeLog (213946 => 213947)


--- trunk/Source/WebKit2/ChangeLog	2017-03-14 22:32:10 UTC (rev 213946)
+++ trunk/Source/WebKit2/ChangeLog	2017-03-14 22:36:52 UTC (rev 213947)
@@ -1,3 +1,63 @@
+2017-03-14  Brady Eidson  <[email protected]>
+
+        Rename WKHTTPCookieStorage to WKHTTPCookieStore.
+        https://bugs.webkit.org/show_bug.cgi?id=169630
+
+        Reviewed by Tim Horton.
+
+        * CMakeLists.txt:
+        
+        * Shared/API/APIObject.h:
+        * Shared/Cocoa/APIObject.mm:
+        (API::Object::newObject):
+        
+        * UIProcess/API/APIHTTPCookieStore.cpp: Renamed from Source/WebKit2/UIProcess/API/APIHTTPCookieStorage.cpp.
+        (API::HTTPCookieStore::HTTPCookieStore):
+        (API::HTTPCookieStore::~HTTPCookieStore):
+        (API::HTTPCookieStore::cookies):
+        (API::HTTPCookieStore::setCookie):
+        (API::HTTPCookieStore::setCookies):
+        (API::HTTPCookieStore::deleteCookie):
+        (API::HTTPCookieStore::removeCookiesSinceDate):
+        (API::HTTPCookieStore::setHTTPCookieAcceptPolicy):
+        (API::HTTPCookieStore::getHTTPCookieAcceptPolicy):
+        * UIProcess/API/APIHTTPCookieStore.h: Renamed from Source/WebKit2/UIProcess/API/APIHTTPCookieStorage.h.
+        
+        * UIProcess/API/APIWebsiteDataStore.cpp:
+        (API::WebsiteDataStore::httpCookieStore):
+        (API::WebsiteDataStore::httpCookieStorage): Deleted.
+        * UIProcess/API/APIWebsiteDataStore.h:
+        
+        * UIProcess/API/Cocoa/WKHTTPCookieStore.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorage.h.
+        * UIProcess/API/Cocoa/WKHTTPCookieStore.mm: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorage.mm.
+        (coreCookiesToNSCookies):
+        (-[WKHTTPCookieStore dealloc]):
+        (-[WKHTTPCookieStore fetchCookies:]):
+        (-[WKHTTPCookieStore fetchCookiesForURL:completionHandler:]):
+        (-[WKHTTPCookieStore setCookie:completionHandler:]):
+        (-[WKHTTPCookieStore deleteCookie:completionHandler:]):
+        (-[WKHTTPCookieStore setCookies:forURL:mainDocumentURL:completionHandler:]):
+        (-[WKHTTPCookieStore removeCookiesSinceDate:completionHandler:]):
+        (-[WKHTTPCookieStore setCookieAcceptPolicy:completionHandler:]):
+        (kitCookiePolicyToNSCookiePolicy):
+        (-[WKHTTPCookieStore fetchCookieAcceptPolicy:]):
+        (-[WKHTTPCookieStore _apiObject]):
+        * UIProcess/API/Cocoa/WKHTTPCookieStoreInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorageInternal.h.
+        (WebKit::wrapper):
+        
+        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
+        (-[WKWebsiteDataStore _httpCookieStore]):
+        (-[WKWebsiteDataStore _httpCookieStorage]): Deleted.
+        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
+        
+        * UIProcess/WebProcessPool.cpp:
+        * UIProcess/WebProcessPool.h:
+        
+        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+        (WebKit::WebsiteDataStore::processPoolForCookieStorageOperations):
+        
+        * WebKit2.xcodeproj/project.pbxproj:
+
 2017-03-14  Anders Carlsson  <[email protected]>
 
         Propagate PassKit errors

Modified: trunk/Source/WebKit2/Shared/API/APIObject.h (213946 => 213947)


--- trunk/Source/WebKit2/Shared/API/APIObject.h	2017-03-14 22:32:10 UTC (rev 213946)
+++ trunk/Source/WebKit2/Shared/API/APIObject.h	2017-03-14 22:36:52 UTC (rev 213947)
@@ -116,7 +116,7 @@
         FullScreenManager,
         GeolocationManager,
         GeolocationPermissionRequest,
-        HTTPCookieStorage,
+        HTTPCookieStore,
         HitTestResult,
         GeolocationPosition,
         GrammarDetail,

Modified: trunk/Source/WebKit2/Shared/Cocoa/APIObject.mm (213946 => 213947)


--- trunk/Source/WebKit2/Shared/Cocoa/APIObject.mm	2017-03-14 22:32:10 UTC (rev 213946)
+++ trunk/Source/WebKit2/Shared/Cocoa/APIObject.mm	2017-03-14 22:36:52 UTC (rev 213947)
@@ -36,7 +36,7 @@
 #import "WKContentExtensionInternal.h"
 #import "WKContentExtensionStoreInternal.h"
 #import "WKFrameInfoInternal.h"
-#import "WKHTTPCookieStorageInternal.h"
+#import "WKHTTPCookieStoreInternal.h"
 #import "WKNSArray.h"
 #import "WKNSData.h"
 #import "WKNSDictionary.h"
@@ -179,8 +179,8 @@
         wrapper = [WKFrameInfo alloc];
         break;
 
-    case Type::HTTPCookieStorage:
-        wrapper = [WKHTTPCookieStorage alloc];
+    case Type::HTTPCookieStore:
+        wrapper = [WKHTTPCookieStore alloc];
         break;
 
 #if PLATFORM(MAC)

Deleted: trunk/Source/WebKit2/UIProcess/API/APIHTTPCookieStorage.cpp (213946 => 213947)


--- trunk/Source/WebKit2/UIProcess/API/APIHTTPCookieStorage.cpp	2017-03-14 22:32:10 UTC (rev 213946)
+++ trunk/Source/WebKit2/UIProcess/API/APIHTTPCookieStorage.cpp	2017-03-14 22:36:52 UTC (rev 213947)
@@ -1,138 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "APIHTTPCookieStorage.h"
-
-#include "APIWebsiteDataStore.h"
-#include "WebCookieManagerProxy.h"
-#include "WebProcessPool.h"
-#include <WebCore/Cookie.h>
-
-using namespace WebKit;
-
-namespace API {
-
-HTTPCookieStorage::HTTPCookieStorage(WebsiteDataStore& websiteDataStore)
-    : m_owningDataStore(websiteDataStore)
-{
-}
-
-HTTPCookieStorage::~HTTPCookieStorage()
-{
-}
-
-void HTTPCookieStorage::cookies(Function<void (const Vector<WebCore::Cookie>&)>&& completionHandler)
-{
-    auto& dataStore = m_owningDataStore.websiteDataStore();
-    auto pool = dataStore.processPoolForCookieStorageOperations();
-    auto* cookieManager = pool->supplement<WebKit::WebCookieManagerProxy>();
-
-    cookieManager->getAllCookies(dataStore.sessionID(), [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)](const Vector<WebCore::Cookie>& cookies, CallbackBase::Error error) {
-        completionHandler(cookies);
-    });
-}
-
-void HTTPCookieStorage::cookies(const WebCore::URL& url, Function<void (const Vector<WebCore::Cookie>&)>&& completionHandler)
-{
-    auto& dataStore = m_owningDataStore.websiteDataStore();
-    auto pool = dataStore.processPoolForCookieStorageOperations();
-    auto* cookieManager = pool->supplement<WebKit::WebCookieManagerProxy>();
-
-    cookieManager->getCookies(dataStore.sessionID(), url, [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)](const Vector<WebCore::Cookie>& cookies, CallbackBase::Error error) {
-        completionHandler(cookies);
-    });
-}
-
-void HTTPCookieStorage::setCookie(const WebCore::Cookie& cookie, Function<void ()>&& completionHandler)
-{
-    auto& dataStore = m_owningDataStore.websiteDataStore();
-    auto pool = dataStore.processPoolForCookieStorageOperations();
-    auto* cookieManager = pool->supplement<WebKit::WebCookieManagerProxy>();
-
-    cookieManager->setCookie(dataStore.sessionID(), cookie, [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)](CallbackBase::Error error) {
-        completionHandler();
-    });
-}
-
-void HTTPCookieStorage::setCookies(const Vector<WebCore::Cookie>& cookies, const WebCore::URL& url, const WebCore::URL& mainDocumentURL, Function<void ()>&& completionHandler)
-{
-    auto& dataStore = m_owningDataStore.websiteDataStore();
-    auto pool = dataStore.processPoolForCookieStorageOperations();
-    auto* cookieManager = pool->supplement<WebKit::WebCookieManagerProxy>();
-
-    cookieManager->setCookies(dataStore.sessionID(), cookies, url, mainDocumentURL, [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)](CallbackBase::Error error) {
-        completionHandler();
-    });
-}
-
-void HTTPCookieStorage::deleteCookie(const WebCore::Cookie& cookie, Function<void ()>&& completionHandler)
-{
-    auto& dataStore = m_owningDataStore.websiteDataStore();
-    auto pool = dataStore.processPoolForCookieStorageOperations();
-    auto* cookieManager = pool->supplement<WebKit::WebCookieManagerProxy>();
-
-    cookieManager->deleteCookie(dataStore.sessionID(), cookie, [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)](CallbackBase::Error error) {
-        completionHandler();
-    });
-}
-
-void HTTPCookieStorage::removeCookiesSinceDate(std::chrono::system_clock::time_point date, Function<void ()>&& completionHandler)
-{
-    auto& dataStore = m_owningDataStore.websiteDataStore();
-    auto pool = dataStore.processPoolForCookieStorageOperations();
-    auto* cookieManager = pool->supplement<WebKit::WebCookieManagerProxy>();
-
-    cookieManager->deleteAllCookiesModifiedSince(dataStore.sessionID(), date, [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)](CallbackBase::Error error) {
-        completionHandler();
-    });
-}
-
-void HTTPCookieStorage::setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy policy, Function<void ()>&& completionHandler)
-{
-    auto& dataStore = m_owningDataStore.websiteDataStore();
-    auto pool = dataStore.processPoolForCookieStorageOperations();
-    auto* cookieManager = pool->supplement<WebKit::WebCookieManagerProxy>();
-
-    cookieManager->setHTTPCookieAcceptPolicy(dataStore.sessionID(), policy, [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)](CallbackBase::Error error) {
-        completionHandler();
-    });
-}
-
-void HTTPCookieStorage::getHTTPCookieAcceptPolicy(Function<void (HTTPCookieAcceptPolicy)>&& completionHandler)
-{
-    auto& dataStore = m_owningDataStore.websiteDataStore();
-    auto pool = dataStore.processPoolForCookieStorageOperations();
-    auto* cookieManager = pool->supplement<WebKit::WebCookieManagerProxy>();
-
-    cookieManager->getHTTPCookieAcceptPolicy(dataStore.sessionID(), [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)](HTTPCookieAcceptPolicy policy, CallbackBase::Error error) {
-        if (error != CallbackBase::Error::None)
-            policy = HTTPCookieAcceptPolicyNever;
-
-        completionHandler(policy);
-    });
-}
-
-} // namespace API

Deleted: trunk/Source/WebKit2/UIProcess/API/APIHTTPCookieStorage.h (213946 => 213947)


--- trunk/Source/WebKit2/UIProcess/API/APIHTTPCookieStorage.h	2017-03-14 22:32:10 UTC (rev 213946)
+++ trunk/Source/WebKit2/UIProcess/API/APIHTTPCookieStorage.h	2017-03-14 22:36:52 UTC (rev 213947)
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "APIObject.h"
-#include "HTTPCookieAcceptPolicy.h"
-#include <wtf/Function.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-class URL;
-struct Cookie;
-}
-
-namespace API {
-
-class WebsiteDataStore;
-
-class HTTPCookieStorage final : public ObjectImpl<Object::Type::HTTPCookieStorage> {
-public:
-    static Ref<HTTPCookieStorage> create(WebsiteDataStore& websiteDataStore)
-    {
-        return adoptRef(*new HTTPCookieStorage(websiteDataStore));
-    }
-
-    virtual ~HTTPCookieStorage();
-
-    void cookies(Function<void (const Vector<WebCore::Cookie>&)>&& completionHandler);
-    void cookies(const WebCore::URL&, Function<void (const Vector<WebCore::Cookie>&)>&& completionHandler);
-
-    void setCookie(const WebCore::Cookie&, Function<void ()>&& completionHandler);
-    void setCookies(const Vector<WebCore::Cookie>&, const WebCore::URL&, const WebCore::URL& mainDocumentURL, Function<void ()>&& completionHandler);
-    void deleteCookie(const WebCore::Cookie&, Function<void ()>&& completionHandler);
-
-    void removeCookiesSinceDate(std::chrono::system_clock::time_point, Function<void ()>&& completionHandler);
-
-    void setHTTPCookieAcceptPolicy(WebKit::HTTPCookieAcceptPolicy, Function<void ()>&& completionHandler);
-    void getHTTPCookieAcceptPolicy(Function<void (WebKit::HTTPCookieAcceptPolicy)>&& completionHandler);
-    
-private:
-    HTTPCookieStorage(WebsiteDataStore&);
-
-    WebsiteDataStore& m_owningDataStore;
-};
-
-}

Copied: trunk/Source/WebKit2/UIProcess/API/APIHTTPCookieStore.cpp (from rev 213946, trunk/Source/WebKit2/UIProcess/API/APIHTTPCookieStorage.cpp) (0 => 213947)


--- trunk/Source/WebKit2/UIProcess/API/APIHTTPCookieStore.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/APIHTTPCookieStore.cpp	2017-03-14 22:36:52 UTC (rev 213947)
@@ -0,0 +1,138 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "APIHTTPCookieStore.h"
+
+#include "APIWebsiteDataStore.h"
+#include "WebCookieManagerProxy.h"
+#include "WebProcessPool.h"
+#include <WebCore/Cookie.h>
+
+using namespace WebKit;
+
+namespace API {
+
+HTTPCookieStore::HTTPCookieStore(WebsiteDataStore& websiteDataStore)
+    : m_owningDataStore(websiteDataStore)
+{
+}
+
+HTTPCookieStore::~HTTPCookieStore()
+{
+}
+
+void HTTPCookieStore::cookies(Function<void (const Vector<WebCore::Cookie>&)>&& completionHandler)
+{
+    auto& dataStore = m_owningDataStore.websiteDataStore();
+    auto pool = dataStore.processPoolForCookieStorageOperations();
+    auto* cookieManager = pool->supplement<WebKit::WebCookieManagerProxy>();
+
+    cookieManager->getAllCookies(dataStore.sessionID(), [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)](const Vector<WebCore::Cookie>& cookies, CallbackBase::Error error) {
+        completionHandler(cookies);
+    });
+}
+
+void HTTPCookieStore::cookies(const WebCore::URL& url, Function<void (const Vector<WebCore::Cookie>&)>&& completionHandler)
+{
+    auto& dataStore = m_owningDataStore.websiteDataStore();
+    auto pool = dataStore.processPoolForCookieStorageOperations();
+    auto* cookieManager = pool->supplement<WebKit::WebCookieManagerProxy>();
+
+    cookieManager->getCookies(dataStore.sessionID(), url, [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)](const Vector<WebCore::Cookie>& cookies, CallbackBase::Error error) {
+        completionHandler(cookies);
+    });
+}
+
+void HTTPCookieStore::setCookie(const WebCore::Cookie& cookie, Function<void ()>&& completionHandler)
+{
+    auto& dataStore = m_owningDataStore.websiteDataStore();
+    auto pool = dataStore.processPoolForCookieStorageOperations();
+    auto* cookieManager = pool->supplement<WebKit::WebCookieManagerProxy>();
+
+    cookieManager->setCookie(dataStore.sessionID(), cookie, [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)](CallbackBase::Error error) {
+        completionHandler();
+    });
+}
+
+void HTTPCookieStore::setCookies(const Vector<WebCore::Cookie>& cookies, const WebCore::URL& url, const WebCore::URL& mainDocumentURL, Function<void ()>&& completionHandler)
+{
+    auto& dataStore = m_owningDataStore.websiteDataStore();
+    auto pool = dataStore.processPoolForCookieStorageOperations();
+    auto* cookieManager = pool->supplement<WebKit::WebCookieManagerProxy>();
+
+    cookieManager->setCookies(dataStore.sessionID(), cookies, url, mainDocumentURL, [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)](CallbackBase::Error error) {
+        completionHandler();
+    });
+}
+
+void HTTPCookieStore::deleteCookie(const WebCore::Cookie& cookie, Function<void ()>&& completionHandler)
+{
+    auto& dataStore = m_owningDataStore.websiteDataStore();
+    auto pool = dataStore.processPoolForCookieStorageOperations();
+    auto* cookieManager = pool->supplement<WebKit::WebCookieManagerProxy>();
+
+    cookieManager->deleteCookie(dataStore.sessionID(), cookie, [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)](CallbackBase::Error error) {
+        completionHandler();
+    });
+}
+
+void HTTPCookieStore::removeCookiesSinceDate(std::chrono::system_clock::time_point date, Function<void ()>&& completionHandler)
+{
+    auto& dataStore = m_owningDataStore.websiteDataStore();
+    auto pool = dataStore.processPoolForCookieStorageOperations();
+    auto* cookieManager = pool->supplement<WebKit::WebCookieManagerProxy>();
+
+    cookieManager->deleteAllCookiesModifiedSince(dataStore.sessionID(), date, [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)](CallbackBase::Error error) {
+        completionHandler();
+    });
+}
+
+void HTTPCookieStore::setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy policy, Function<void ()>&& completionHandler)
+{
+    auto& dataStore = m_owningDataStore.websiteDataStore();
+    auto pool = dataStore.processPoolForCookieStorageOperations();
+    auto* cookieManager = pool->supplement<WebKit::WebCookieManagerProxy>();
+
+    cookieManager->setHTTPCookieAcceptPolicy(dataStore.sessionID(), policy, [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)](CallbackBase::Error error) {
+        completionHandler();
+    });
+}
+
+void HTTPCookieStore::getHTTPCookieAcceptPolicy(Function<void (HTTPCookieAcceptPolicy)>&& completionHandler)
+{
+    auto& dataStore = m_owningDataStore.websiteDataStore();
+    auto pool = dataStore.processPoolForCookieStorageOperations();
+    auto* cookieManager = pool->supplement<WebKit::WebCookieManagerProxy>();
+
+    cookieManager->getHTTPCookieAcceptPolicy(dataStore.sessionID(), [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)](HTTPCookieAcceptPolicy policy, CallbackBase::Error error) {
+        if (error != CallbackBase::Error::None)
+            policy = HTTPCookieAcceptPolicyNever;
+
+        completionHandler(policy);
+    });
+}
+
+} // namespace API

Copied: trunk/Source/WebKit2/UIProcess/API/APIHTTPCookieStore.h (from rev 213946, trunk/Source/WebKit2/UIProcess/API/APIHTTPCookieStorage.h) (0 => 213947)


--- trunk/Source/WebKit2/UIProcess/API/APIHTTPCookieStore.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/APIHTTPCookieStore.h	2017-03-14 22:36:52 UTC (rev 213947)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "APIObject.h"
+#include "HTTPCookieAcceptPolicy.h"
+#include <wtf/Function.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+class URL;
+struct Cookie;
+}
+
+namespace API {
+
+class WebsiteDataStore;
+
+class HTTPCookieStore final : public ObjectImpl<Object::Type::HTTPCookieStore> {
+public:
+    static Ref<HTTPCookieStore> create(WebsiteDataStore& websiteDataStore)
+    {
+        return adoptRef(*new HTTPCookieStore(websiteDataStore));
+    }
+
+    virtual ~HTTPCookieStore();
+
+    void cookies(Function<void (const Vector<WebCore::Cookie>&)>&& completionHandler);
+    void cookies(const WebCore::URL&, Function<void (const Vector<WebCore::Cookie>&)>&& completionHandler);
+
+    void setCookie(const WebCore::Cookie&, Function<void ()>&& completionHandler);
+    void setCookies(const Vector<WebCore::Cookie>&, const WebCore::URL&, const WebCore::URL& mainDocumentURL, Function<void ()>&& completionHandler);
+    void deleteCookie(const WebCore::Cookie&, Function<void ()>&& completionHandler);
+
+    void removeCookiesSinceDate(std::chrono::system_clock::time_point, Function<void ()>&& completionHandler);
+
+    void setHTTPCookieAcceptPolicy(WebKit::HTTPCookieAcceptPolicy, Function<void ()>&& completionHandler);
+    void getHTTPCookieAcceptPolicy(Function<void (WebKit::HTTPCookieAcceptPolicy)>&& completionHandler);
+    
+private:
+    HTTPCookieStore(WebsiteDataStore&);
+
+    WebsiteDataStore& m_owningDataStore;
+};
+
+}

Modified: trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.cpp (213946 => 213947)


--- trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.cpp	2017-03-14 22:32:10 UTC (rev 213946)
+++ trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.cpp	2017-03-14 22:36:52 UTC (rev 213947)
@@ -64,12 +64,12 @@
 {
 }
 
-HTTPCookieStorage& WebsiteDataStore::httpCookieStorage()
+HTTPCookieStore& WebsiteDataStore::httpCookieStore()
 {
-    if (!m_apiHTTPCookieStorage)
-        m_apiHTTPCookieStorage = HTTPCookieStorage::create(*this);
+    if (!m_apiHTTPCookieStore)
+        m_apiHTTPCookieStore = HTTPCookieStore::create(*this);
 
-    return *m_apiHTTPCookieStorage;
+    return *m_apiHTTPCookieStore;
 }
 
 bool WebsiteDataStore::isPersistent()

Modified: trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.h (213946 => 213947)


--- trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.h	2017-03-14 22:32:10 UTC (rev 213946)
+++ trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.h	2017-03-14 22:36:52 UTC (rev 213947)
@@ -26,7 +26,7 @@
 #ifndef APIWebsiteDataStore_h
 #define APIWebsiteDataStore_h
 
-#include "APIHTTPCookieStorage.h"
+#include "APIHTTPCookieStore.h"
 #include "WebsiteDataStore.h"
 #include <WebCore/SessionID.h>
 #include <wtf/text/WTFString.h>
@@ -49,7 +49,7 @@
     void registerSharedResourceLoadObserver();
 
     WebKit::WebsiteDataStore& websiteDataStore() { return *m_websiteDataStore; }
-    HTTPCookieStorage& httpCookieStorage();
+    HTTPCookieStore& httpCookieStore();
 
     static String defaultApplicationCacheDirectory();
     static String defaultNetworkCacheDirectory();
@@ -75,7 +75,7 @@
     static String websiteDataDirectoryFileSystemRepresentation(const String& directoryName);
 
     RefPtr<WebKit::WebsiteDataStore> m_websiteDataStore;
-    RefPtr<HTTPCookieStorage> m_apiHTTPCookieStorage;
+    RefPtr<HTTPCookieStore> m_apiHTTPCookieStore;
 };
 
 }

Deleted: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorage.h (213946 => 213947)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorage.h	2017-03-14 22:32:10 UTC (rev 213946)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorage.h	2017-03-14 22:36:52 UTC (rev 213947)
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <WebKit/WKFoundation.h>
-
-#if WK_API_ENABLED
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*!
- A WKHTTPCookieStorage object allows managing the HTTP cookies associated with a particular WKWebsiteDataStore.
- */
-WK_CLASS_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA))
-@interface WKHTTPCookieStorage : NSObject
-
-- (instancetype)init NS_UNAVAILABLE;
-
-/*! @abstract Fetches all stored cookies.
- @param completionHandler A block to invoke with the fetched cookies.
- */
-- (void)fetchCookies:(void (^)(NSArray<NSHTTPCookie *> *))completionHandler;
-
-/*! @abstract Fetches all of the stored cookies for the given URL.
- @param completionHandler A block to invoke with the fetched cookies.
- */
-- (void)fetchCookiesForURL:(NSURL *)url completionHandler:(void (^)(NSArray<NSHTTPCookie *> *))completionHandler;
-
-/*! @abstract Set a cookie.
- @param cookie The cookie to set.
- @param completionHandler A block to invoke once the cookie has been stored.
- */
-- (void)setCookie:(NSHTTPCookie *)cookie completionHandler:(nullable void (^)())completionHandler;
-
-/*! @abstract Adds an array cookies to the cookie store, following the cookie accept policy.
- @param cookies The cookies to set.
- @param URL The URL from which the cookies were sent.
- @param mainDocumentURL The main document URL to be used as a base for the "same domain as main document" policy.
- @param completionHandler A block to invoke once the cookies have been stored.
- */
-- (void)setCookies:(NSArray<NSHTTPCookie *> *)cookies forURL:(NSURL *)url mainDocumentURL:(nullable NSURL *)mainDocumentURL completionHandler:(nullable void (^)())completionHandler;
-
-/*! @abstract Delete the specified cookie.
- @param completionHandler A block to invoke once the cookie has been deleted.
- */
-- (void)deleteCookie:(NSHTTPCookie *)cookie completionHandler:(nullable void (^)())completionHandler;
-
-/*! @abstract Delete all cookies from the cookie storage since the provided date.
- @param date The date after which set cookies should be removed.
- @param completionHandler A block to invoke once the cookies have been deleted.
- */
-- (void)removeCookiesSinceDate:(NSDate *)date completionHandler:(nullable void (^)())completionHandler;
-
-/*! @abstract Sets the cookie accept policy preference of the receiver.
- @param policy The cookie accept policy to set.
- @param completionHandler A block to invoke once the policy has been set.
- */
-- (void)setCookieAcceptPolicy:(NSHTTPCookieAcceptPolicy)policy completionHandler:(nullable void (^)())completionHandler;
-
-/*! @abstract Fetches the cookie accept policy preference of the receiver.
- @param completionHandler A block to invoke with the fetched policy.
- */
-- (void)fetchCookieAcceptPolicy:(void (^)(NSHTTPCookieAcceptPolicy))completionHandler;
-
-@end
-
-NS_ASSUME_NONNULL_END
-
-#endif

Deleted: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorage.mm (213946 => 213947)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorage.mm	2017-03-14 22:32:10 UTC (rev 213946)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorage.mm	2017-03-14 22:36:52 UTC (rev 213947)
@@ -1,161 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-#import "WKHTTPCookieStorageInternal.h"
-
-#if WK_API_ENABLED
-
-#include "HTTPCookieAcceptPolicy.h"
-#include <WebCore/CFNetworkSPI.h>
-#include <WebCore/Cookie.h>
-#include <WebCore/URL.h>
-#include <wtf/RetainPtr.h>
-
-static NSArray<NSHTTPCookie *> *coreCookiesToNSCookies(const Vector<WebCore::Cookie>& coreCookies)
-{
-    NSMutableArray<NSHTTPCookie *> *nsCookies = [NSMutableArray arrayWithCapacity:coreCookies.size()];
-
-    for (auto& cookie : coreCookies)
-        [nsCookies addObject:(NSHTTPCookie *)cookie];
-
-    return nsCookies;
-}
-
-@implementation WKHTTPCookieStorage
-
-- (void)dealloc
-{
-    _cookieStorage->API::HTTPCookieStorage::~HTTPCookieStorage();
-
-    [super dealloc];
-}
-
-- (void)fetchCookies:(void (^)(NSArray<NSHTTPCookie *> *))completionHandler
-{
-    _cookieStorage->cookies([handler = adoptNS([completionHandler copy])](const Vector<WebCore::Cookie>& cookies) {
-        auto rawHandler = (void (^)(NSArray<NSHTTPCookie *> *))handler.get();
-        rawHandler(coreCookiesToNSCookies(cookies));
-    });
-}
-
-- (void)fetchCookiesForURL:(NSURL *)url completionHandler:(void (^)(NSArray<NSHTTPCookie *> *))completionHandler
-{
-    _cookieStorage->cookies(url, [handler = adoptNS([completionHandler copy])](const Vector<WebCore::Cookie>& cookies) {
-        auto rawHandler = (void (^)(NSArray<NSHTTPCookie *> *))handler.get();
-        rawHandler(coreCookiesToNSCookies(cookies));
-    });
-}
-
-- (void)setCookie:(NSHTTPCookie *)cookie completionHandler:(void (^)())completionHandler
-{
-    _cookieStorage->setCookie(cookie, [handler = adoptNS([completionHandler copy])]() {
-        auto rawHandler = (void (^)())handler.get();
-        if (rawHandler)
-            rawHandler();
-    });
-
-}
-
-- (void)deleteCookie:(NSHTTPCookie *)cookie completionHandler:(void (^)())completionHandler
-{
-    _cookieStorage->deleteCookie(cookie, [handler = adoptNS([completionHandler copy])]() {
-        auto rawHandler = (void (^)())handler.get();
-        if (rawHandler)
-            rawHandler();
-    });
-}
-
-- (void)setCookies:(NSArray<NSHTTPCookie *> *)cookies forURL:(NSURL *)URL mainDocumentURL:(NSURL *)mainDocumentURL completionHandler:(void (^)())completionHandler
-{
-    Vector<WebCore::Cookie> coreCookies;
-    coreCookies.reserveInitialCapacity(cookies.count);
-    for (NSHTTPCookie *cookie : cookies)
-        coreCookies.uncheckedAppend(cookie);
-
-    _cookieStorage->setCookies(coreCookies, URL, mainDocumentURL, [handler = adoptNS([completionHandler copy])]() {
-        auto rawHandler = (void (^)())handler.get();
-        if (rawHandler)
-            rawHandler();
-    });
-}
-
-- (void)removeCookiesSinceDate:(NSDate *)date completionHandler:(void (^)())completionHandler
-{
-    auto systemClockTime = std::chrono::system_clock::time_point(std::chrono::duration_cast<std::chrono::system_clock::duration>(std::chrono::duration<double>(date.timeIntervalSince1970)));
-
-    _cookieStorage->removeCookiesSinceDate(systemClockTime, [handler = adoptNS([completionHandler copy])]() {
-        auto rawHandler = (void (^)())handler.get();
-        if (rawHandler)
-            rawHandler();
-    });
-}
-
-- (void)setCookieAcceptPolicy:(NSHTTPCookieAcceptPolicy)policy completionHandler:(void (^)())completionHandler
-{
-    _cookieStorage->setHTTPCookieAcceptPolicy(policy, [handler = adoptNS([completionHandler copy])]() {
-        auto rawHandler = (void (^)())handler.get();
-        if (rawHandler)
-            rawHandler();
-    });
-}
-
-static NSHTTPCookieAcceptPolicy kitCookiePolicyToNSCookiePolicy(WebKit::HTTPCookieAcceptPolicy kitPolicy)
-{
-    switch (kitPolicy) {
-    case WebKit::HTTPCookieAcceptPolicyAlways:
-        return NSHTTPCookieAcceptPolicyAlways;
-    case WebKit::HTTPCookieAcceptPolicyNever:
-        return NSHTTPCookieAcceptPolicyNever;
-    case WebKit::HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain:
-        return NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain;
-    case WebKit::HTTPCookieAcceptPolicyExclusivelyFromMainDocumentDomain:
-        // Cast required because of CFNetworkSPI.
-        return static_cast<NSHTTPCookieAcceptPolicy>(NSHTTPCookieAcceptPolicyExclusivelyFromMainDocumentDomain);
-    default:
-        ASSERT_NOT_REACHED();
-    }
-
-    return NSHTTPCookieAcceptPolicyNever;
-}
-
-- (void)fetchCookieAcceptPolicy:(void (^)(NSHTTPCookieAcceptPolicy))completionHandler
-{
-    _cookieStorage->getHTTPCookieAcceptPolicy([handler = adoptNS([completionHandler copy])](WebKit::HTTPCookieAcceptPolicy policy) {
-        auto rawHandler = (void (^)(NSHTTPCookieAcceptPolicy))handler.get();
-        rawHandler(kitCookiePolicyToNSCookiePolicy(policy));
-    });
-}
-
-#pragma mark WKObject protocol implementation
-
-- (API::Object&)_apiObject
-{
-    return *_cookieStorage;
-}
-
-@end
-
-#endif

Deleted: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorageInternal.h (213946 => 213947)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorageInternal.h	2017-03-14 22:32:10 UTC (rev 213946)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorageInternal.h	2017-03-14 22:36:52 UTC (rev 213947)
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "WKHTTPCookieStorage.h"
-
-#if WK_API_ENABLED
-
-#import "APIHTTPCookieStorage.h"
-#import "WKObject.h"
-
-namespace WebKit {
-
-inline WKHTTPCookieStorage *wrapper(API::HTTPCookieStorage& cookieStorage)
-{
-    ASSERT([cookieStorage.wrapper() isKindOfClass:[WKHTTPCookieStorage class]]);
-    return (WKHTTPCookieStorage *)cookieStorage.wrapper();
-}
-
-}
-
-@interface WKHTTPCookieStorage () <WKObject> {
-@package
-    API::ObjectStorage<API::HTTPCookieStorage> _cookieStorage;
-}
-@end
-
-#endif

Copied: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStore.h (from rev 213946, trunk/Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorage.h) (0 => 213947)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStore.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStore.h	2017-03-14 22:36:52 UTC (rev 213947)
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <WebKit/WKFoundation.h>
+
+#if WK_API_ENABLED
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/*!
+ A WKHTTPCookieStore object allows managing the HTTP cookies associated with a particular WKWebsiteDataStore.
+ */
+WK_CLASS_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA))
+@interface WKHTTPCookieStore : NSObject
+
+- (instancetype)init NS_UNAVAILABLE;
+
+/*! @abstract Fetches all stored cookies.
+ @param completionHandler A block to invoke with the fetched cookies.
+ */
+- (void)fetchCookies:(void (^)(NSArray<NSHTTPCookie *> *))completionHandler;
+
+/*! @abstract Fetches all of the stored cookies for the given URL.
+ @param completionHandler A block to invoke with the fetched cookies.
+ */
+- (void)fetchCookiesForURL:(NSURL *)url completionHandler:(void (^)(NSArray<NSHTTPCookie *> *))completionHandler;
+
+/*! @abstract Set a cookie.
+ @param cookie The cookie to set.
+ @param completionHandler A block to invoke once the cookie has been stored.
+ */
+- (void)setCookie:(NSHTTPCookie *)cookie completionHandler:(nullable void (^)())completionHandler;
+
+/*! @abstract Adds an array cookies to the cookie store, following the cookie accept policy.
+ @param cookies The cookies to set.
+ @param URL The URL from which the cookies were sent.
+ @param mainDocumentURL The main document URL to be used as a base for the "same domain as main document" policy.
+ @param completionHandler A block to invoke once the cookies have been stored.
+ */
+- (void)setCookies:(NSArray<NSHTTPCookie *> *)cookies forURL:(NSURL *)url mainDocumentURL:(nullable NSURL *)mainDocumentURL completionHandler:(nullable void (^)())completionHandler;
+
+/*! @abstract Delete the specified cookie.
+ @param completionHandler A block to invoke once the cookie has been deleted.
+ */
+- (void)deleteCookie:(NSHTTPCookie *)cookie completionHandler:(nullable void (^)())completionHandler;
+
+/*! @abstract Delete all cookies from the cookie storage since the provided date.
+ @param date The date after which set cookies should be removed.
+ @param completionHandler A block to invoke once the cookies have been deleted.
+ */
+- (void)removeCookiesSinceDate:(NSDate *)date completionHandler:(nullable void (^)())completionHandler;
+
+/*! @abstract Sets the cookie accept policy preference of the receiver.
+ @param policy The cookie accept policy to set.
+ @param completionHandler A block to invoke once the policy has been set.
+ */
+- (void)setCookieAcceptPolicy:(NSHTTPCookieAcceptPolicy)policy completionHandler:(nullable void (^)())completionHandler;
+
+/*! @abstract Fetches the cookie accept policy preference of the receiver.
+ @param completionHandler A block to invoke with the fetched policy.
+ */
+- (void)fetchCookieAcceptPolicy:(void (^)(NSHTTPCookieAcceptPolicy))completionHandler;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+#endif

Copied: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStore.mm (from rev 213946, trunk/Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorage.mm) (0 => 213947)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStore.mm	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStore.mm	2017-03-14 22:36:52 UTC (rev 213947)
@@ -0,0 +1,161 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "WKHTTPCookieStoreInternal.h"
+
+#if WK_API_ENABLED
+
+#include "HTTPCookieAcceptPolicy.h"
+#include <WebCore/CFNetworkSPI.h>
+#include <WebCore/Cookie.h>
+#include <WebCore/URL.h>
+#include <wtf/RetainPtr.h>
+
+static NSArray<NSHTTPCookie *> *coreCookiesToNSCookies(const Vector<WebCore::Cookie>& coreCookies)
+{
+    NSMutableArray<NSHTTPCookie *> *nsCookies = [NSMutableArray arrayWithCapacity:coreCookies.size()];
+
+    for (auto& cookie : coreCookies)
+        [nsCookies addObject:(NSHTTPCookie *)cookie];
+
+    return nsCookies;
+}
+
+@implementation WKHTTPCookieStore
+
+- (void)dealloc
+{
+    _cookieStore->API::HTTPCookieStore::~HTTPCookieStore();
+
+    [super dealloc];
+}
+
+- (void)fetchCookies:(void (^)(NSArray<NSHTTPCookie *> *))completionHandler
+{
+    _cookieStore->cookies([handler = adoptNS([completionHandler copy])](const Vector<WebCore::Cookie>& cookies) {
+        auto rawHandler = (void (^)(NSArray<NSHTTPCookie *> *))handler.get();
+        rawHandler(coreCookiesToNSCookies(cookies));
+    });
+}
+
+- (void)fetchCookiesForURL:(NSURL *)url completionHandler:(void (^)(NSArray<NSHTTPCookie *> *))completionHandler
+{
+    _cookieStore->cookies(url, [handler = adoptNS([completionHandler copy])](const Vector<WebCore::Cookie>& cookies) {
+        auto rawHandler = (void (^)(NSArray<NSHTTPCookie *> *))handler.get();
+        rawHandler(coreCookiesToNSCookies(cookies));
+    });
+}
+
+- (void)setCookie:(NSHTTPCookie *)cookie completionHandler:(void (^)())completionHandler
+{
+    _cookieStore->setCookie(cookie, [handler = adoptNS([completionHandler copy])]() {
+        auto rawHandler = (void (^)())handler.get();
+        if (rawHandler)
+            rawHandler();
+    });
+
+}
+
+- (void)deleteCookie:(NSHTTPCookie *)cookie completionHandler:(void (^)())completionHandler
+{
+    _cookieStore->deleteCookie(cookie, [handler = adoptNS([completionHandler copy])]() {
+        auto rawHandler = (void (^)())handler.get();
+        if (rawHandler)
+            rawHandler();
+    });
+}
+
+- (void)setCookies:(NSArray<NSHTTPCookie *> *)cookies forURL:(NSURL *)URL mainDocumentURL:(NSURL *)mainDocumentURL completionHandler:(void (^)())completionHandler
+{
+    Vector<WebCore::Cookie> coreCookies;
+    coreCookies.reserveInitialCapacity(cookies.count);
+    for (NSHTTPCookie *cookie : cookies)
+        coreCookies.uncheckedAppend(cookie);
+
+    _cookieStore->setCookies(coreCookies, URL, mainDocumentURL, [handler = adoptNS([completionHandler copy])]() {
+        auto rawHandler = (void (^)())handler.get();
+        if (rawHandler)
+            rawHandler();
+    });
+}
+
+- (void)removeCookiesSinceDate:(NSDate *)date completionHandler:(void (^)())completionHandler
+{
+    auto systemClockTime = std::chrono::system_clock::time_point(std::chrono::duration_cast<std::chrono::system_clock::duration>(std::chrono::duration<double>(date.timeIntervalSince1970)));
+
+    _cookieStore->removeCookiesSinceDate(systemClockTime, [handler = adoptNS([completionHandler copy])]() {
+        auto rawHandler = (void (^)())handler.get();
+        if (rawHandler)
+            rawHandler();
+    });
+}
+
+- (void)setCookieAcceptPolicy:(NSHTTPCookieAcceptPolicy)policy completionHandler:(void (^)())completionHandler
+{
+    _cookieStore->setHTTPCookieAcceptPolicy(policy, [handler = adoptNS([completionHandler copy])]() {
+        auto rawHandler = (void (^)())handler.get();
+        if (rawHandler)
+            rawHandler();
+    });
+}
+
+static NSHTTPCookieAcceptPolicy kitCookiePolicyToNSCookiePolicy(WebKit::HTTPCookieAcceptPolicy kitPolicy)
+{
+    switch (kitPolicy) {
+    case WebKit::HTTPCookieAcceptPolicyAlways:
+        return NSHTTPCookieAcceptPolicyAlways;
+    case WebKit::HTTPCookieAcceptPolicyNever:
+        return NSHTTPCookieAcceptPolicyNever;
+    case WebKit::HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain:
+        return NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain;
+    case WebKit::HTTPCookieAcceptPolicyExclusivelyFromMainDocumentDomain:
+        // Cast required because of CFNetworkSPI.
+        return static_cast<NSHTTPCookieAcceptPolicy>(NSHTTPCookieAcceptPolicyExclusivelyFromMainDocumentDomain);
+    default:
+        ASSERT_NOT_REACHED();
+    }
+
+    return NSHTTPCookieAcceptPolicyNever;
+}
+
+- (void)fetchCookieAcceptPolicy:(void (^)(NSHTTPCookieAcceptPolicy))completionHandler
+{
+    _cookieStore->getHTTPCookieAcceptPolicy([handler = adoptNS([completionHandler copy])](WebKit::HTTPCookieAcceptPolicy policy) {
+        auto rawHandler = (void (^)(NSHTTPCookieAcceptPolicy))handler.get();
+        rawHandler(kitCookiePolicyToNSCookiePolicy(policy));
+    });
+}
+
+#pragma mark WKObject protocol implementation
+
+- (API::Object&)_apiObject
+{
+    return *_cookieStore;
+}
+
+@end
+
+#endif

Copied: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStoreInternal.h (from rev 213946, trunk/Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorageInternal.h) (0 => 213947)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStoreInternal.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStoreInternal.h	2017-03-14 22:36:52 UTC (rev 213947)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "WKHTTPCookieStore.h"
+
+#if WK_API_ENABLED
+
+#import "APIHTTPCookieStore.h"
+#import "WKObject.h"
+
+namespace WebKit {
+
+inline WKHTTPCookieStore *wrapper(API::HTTPCookieStore& cookieStore)
+{
+    ASSERT([cookieStore.wrapper() isKindOfClass:[WKHTTPCookieStore class]]);
+    return (WKHTTPCookieStore *)cookieStore.wrapper();
+}
+
+}
+
+@interface WKHTTPCookieStore () <WKObject> {
+@package
+    API::ObjectStorage<API::HTTPCookieStore> _cookieStore;
+}
+@end
+
+#endif

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStore.mm (213946 => 213947)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStore.mm	2017-03-14 22:32:10 UTC (rev 213946)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStore.mm	2017-03-14 22:36:52 UTC (rev 213947)
@@ -28,7 +28,7 @@
 
 #if WK_API_ENABLED
 
-#import "WKHTTPCookieStorageInternal.h"
+#import "WKHTTPCookieStoreInternal.h"
 #import "WKNSArray.h"
 #import "WKWebsiteDataRecordInternal.h"
 #import "WebsiteDataFetchOption.h"
@@ -195,9 +195,9 @@
     _websiteDataStore->websiteDataStore().setResourceLoadStatisticsEnabled(enabled);
 }
 
-- (WKHTTPCookieStorage *)_httpCookieStorage
+- (WKHTTPCookieStore *)_httpCookieStore
 {
-    return WebKit::wrapper(_websiteDataStore->httpCookieStorage());
+    return WebKit::wrapper(_websiteDataStore->httpCookieStore());
 }
 
 @end

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h (213946 => 213947)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h	2017-03-14 22:32:10 UTC (rev 213946)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h	2017-03-14 22:36:52 UTC (rev 213947)
@@ -29,7 +29,7 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@class WKHTTPCookieStorage;
+@class WKHTTPCookieStore;
 @class _WKWebsiteDataStoreConfiguration;
 
 typedef NS_OPTIONS(NSUInteger, _WKWebsiteDataStoreFetchOptions) {
@@ -44,8 +44,8 @@
 
 @property (nonatomic, setter=_setResourceLoadStatisticsEnabled:) BOOL _resourceLoadStatisticsEnabled WK_API_AVAILABLE(macosx(10.12), ios(10.0));
 
-/*! @abstract Returns the cookie storage representing HTTP cookies in this website data store. */
-@property (nonatomic, readonly) WKHTTPCookieStorage *_httpCookieStorage WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
+/*! @abstract Returns the cookie store representing HTTP cookies in this website data store. */
+@property (nonatomic, readonly) WKHTTPCookieStore *_httpCookieStore WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
 
 @end
 

Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp (213946 => 213947)


--- trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp	2017-03-14 22:32:10 UTC (rev 213946)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp	2017-03-14 22:36:52 UTC (rev 213947)
@@ -30,7 +30,7 @@
 #include "APIAutomationClient.h"
 #include "APICustomProtocolManagerClient.h"
 #include "APIDownloadClient.h"
-#include "APIHTTPCookieStorage.h"
+#include "APIHTTPCookieStore.h"
 #include "APILegacyContextHistoryClient.h"
 #include "APIPageConfiguration.h"
 #include "APIProcessPoolConfiguration.h"

Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.h (213946 => 213947)


--- trunk/Source/WebKit2/UIProcess/WebProcessPool.h	2017-03-14 22:32:10 UTC (rev 213946)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.h	2017-03-14 22:36:52 UTC (rev 213947)
@@ -76,7 +76,7 @@
 class AutomationClient;
 class CustomProtocolManagerClient;
 class DownloadClient;
-class HTTPCookieStorage;
+class HTTPCookieStore;
 class LegacyContextHistoryClient;
 class PageConfiguration;
 }

Modified: trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp (213946 => 213947)


--- trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp	2017-03-14 22:32:10 UTC (rev 213946)
+++ trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp	2017-03-14 22:36:52 UTC (rev 213947)
@@ -116,7 +116,7 @@
     // This means that multiple NetworkProcesses can be using the same session, which means that multiple
     // NetworkProcesses can be referring to the same platform cookie storage.
     //
-    // While this may cause complications with future APIs it is actually fine for implementing the WKHTTPCookieStorage API
+    // While this may cause complications with future APIs it is actually fine for implementing the WKHTTPCookieStore API
     // because we only need one NetworkProcess to successfully make a requested platform cookie storage change.
     //
     // FIXME: We need to start to unravel this mess going forward.

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (213946 => 213947)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2017-03-14 22:32:10 UTC (rev 213946)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2017-03-14 22:36:52 UTC (rev 213947)
@@ -1063,9 +1063,9 @@
 		51D124351E6DF652002B2820 /* WKURLSchemeHandlerTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D1242F1E6DDDD7002B2820 /* WKURLSchemeHandlerTask.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		51D124361E6DFB39002B2820 /* WKURLSchemeHandlerTask.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51D124301E6DDDD7002B2820 /* WKURLSchemeHandlerTask.mm */; };
 		51D1243A1E6E0AAB002B2820 /* APIURLSchemeHandlerTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D124381E6DFDB9002B2820 /* APIURLSchemeHandlerTask.cpp */; };
-		51D124911E74BF3C002B2820 /* APIHTTPCookieStorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D124821E734AC8002B2820 /* APIHTTPCookieStorage.cpp */; };
-		51D124921E74BF48002B2820 /* WKHTTPCookieStorage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51D124851E734AE3002B2820 /* WKHTTPCookieStorage.mm */; };
-		51D124991E763C01002B2820 /* WKHTTPCookieStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D124841E734AE3002B2820 /* WKHTTPCookieStorage.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		51D124911E74BF3C002B2820 /* APIHTTPCookieStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D124821E734AC8002B2820 /* APIHTTPCookieStore.cpp */; };
+		51D124921E74BF48002B2820 /* WKHTTPCookieStore.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51D124851E734AE3002B2820 /* WKHTTPCookieStore.mm */; };
+		51D124991E763C01002B2820 /* WKHTTPCookieStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D124841E734AE3002B2820 /* WKHTTPCookieStore.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		51D130531382EAC000351EDD /* SecItemRequestData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D1304F1382EAC000351EDD /* SecItemRequestData.cpp */; };
 		51D130541382EAC000351EDD /* SecItemRequestData.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D130501382EAC000351EDD /* SecItemRequestData.h */; };
 		51D130551382EAC000351EDD /* SecItemResponseData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D130511382EAC000351EDD /* SecItemResponseData.cpp */; };
@@ -3293,11 +3293,11 @@
 		51D124371E6DFD2A002B2820 /* WKURLSchemeHandlerTaskInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKURLSchemeHandlerTaskInternal.h; sourceTree = "<group>"; };
 		51D124381E6DFDB9002B2820 /* APIURLSchemeHandlerTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIURLSchemeHandlerTask.cpp; sourceTree = "<group>"; };
 		51D124391E6DFDB9002B2820 /* APIURLSchemeHandlerTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIURLSchemeHandlerTask.h; sourceTree = "<group>"; };
-		51D124821E734AC8002B2820 /* APIHTTPCookieStorage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIHTTPCookieStorage.cpp; sourceTree = "<group>"; };
-		51D124831E734AC8002B2820 /* APIHTTPCookieStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIHTTPCookieStorage.h; sourceTree = "<group>"; };
-		51D124841E734AE3002B2820 /* WKHTTPCookieStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKHTTPCookieStorage.h; sourceTree = "<group>"; };
-		51D124851E734AE3002B2820 /* WKHTTPCookieStorage.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKHTTPCookieStorage.mm; sourceTree = "<group>"; };
-		51D124861E734AE3002B2820 /* WKHTTPCookieStorageInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKHTTPCookieStorageInternal.h; sourceTree = "<group>"; };
+		51D124821E734AC8002B2820 /* APIHTTPCookieStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIHTTPCookieStore.cpp; sourceTree = "<group>"; };
+		51D124831E734AC8002B2820 /* APIHTTPCookieStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIHTTPCookieStore.h; sourceTree = "<group>"; };
+		51D124841E734AE3002B2820 /* WKHTTPCookieStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKHTTPCookieStore.h; sourceTree = "<group>"; };
+		51D124851E734AE3002B2820 /* WKHTTPCookieStore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKHTTPCookieStore.mm; sourceTree = "<group>"; };
+		51D124861E734AE3002B2820 /* WKHTTPCookieStoreInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKHTTPCookieStoreInternal.h; sourceTree = "<group>"; };
 		51D1304F1382EAC000351EDD /* SecItemRequestData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SecItemRequestData.cpp; sourceTree = "<group>"; };
 		51D130501382EAC000351EDD /* SecItemRequestData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecItemRequestData.h; sourceTree = "<group>"; };
 		51D130511382EAC000351EDD /* SecItemResponseData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SecItemResponseData.cpp; sourceTree = "<group>"; };
@@ -5562,9 +5562,9 @@
 				1A4D664918A3030E00D82E21 /* WKFrameInfo.mm */,
 				2DF9EEE71A78245500B6CFBE /* WKFrameInfoInternal.h */,
 				1A6FA21D1BD0435B00AAA650 /* WKFrameInfoPrivate.h */,
-				51D124841E734AE3002B2820 /* WKHTTPCookieStorage.h */,
-				51D124851E734AE3002B2820 /* WKHTTPCookieStorage.mm */,
-				51D124861E734AE3002B2820 /* WKHTTPCookieStorageInternal.h */,
+				51D124841E734AE3002B2820 /* WKHTTPCookieStore.h */,
+				51D124851E734AE3002B2820 /* WKHTTPCookieStore.mm */,
+				51D124861E734AE3002B2820 /* WKHTTPCookieStoreInternal.h */,
 				1A422F8A18B29B5400D8CD96 /* WKHistoryDelegatePrivate.h */,
 				1AB40EE31BF677E300BA81BE /* WKMenuItemIdentifiers.mm */,
 				1AB40EE41BF677E300BA81BE /* WKMenuItemIdentifiersPrivate.h */,
@@ -6758,8 +6758,8 @@
 				2DABA7751A82B42100EF0F1A /* APIHistoryClient.h */,
 				93A88B421BC8828C00ABA5C2 /* APIHitTestResult.cpp */,
 				93A88B431BC8828C00ABA5C2 /* APIHitTestResult.h */,
-				51D124821E734AC8002B2820 /* APIHTTPCookieStorage.cpp */,
-				51D124831E734AC8002B2820 /* APIHTTPCookieStorage.h */,
+				51D124821E734AC8002B2820 /* APIHTTPCookieStore.cpp */,
+				51D124831E734AC8002B2820 /* APIHTTPCookieStore.h */,
 				5143B2611DDD0DA00014FAC6 /* APIIconLoadingClient.h */,
 				7CE4D2061A46775700C7F152 /* APILegacyContextHistoryClient.h */,
 				1A2464F21891E45100234C5B /* APILoaderClient.h */,
@@ -8552,7 +8552,7 @@
 				514129941C6428BB0059E714 /* WebIDBConnectionToServer.h in Headers */,
 				510523741C73D38B007993CB /* WebIDBConnectionToServerMessages.h in Headers */,
 				BCCF6ABD12C91EF9008F9C35 /* WebImage.h in Headers */,
-				51D124991E763C01002B2820 /* WKHTTPCookieStorage.h in Headers */,
+				51D124991E763C01002B2820 /* WKHTTPCookieStore.h in Headers */,
 				1C8E28201275D15400BC7BD0 /* WebInspector.h in Headers */,
 				BC032D8210F4378D0058C15A /* WebInspectorClient.h in Headers */,
 				A55BA8351BA3E70A007CD33D /* WebInspectorFrontendAPIDispatcher.h in Headers */,
@@ -9806,7 +9806,7 @@
 				1A6FBA2B11E6862700DB1371 /* NetscapeBrowserFuncs.cpp in Sources */,
 				1A6FBD2911E69BC200DB1371 /* NetscapePlugin.cpp in Sources */,
 				1AE5B7FB11E7AED200BA6767 /* NetscapePluginMac.mm in Sources */,
-				51D124921E74BF48002B2820 /* WKHTTPCookieStorage.mm in Sources */,
+				51D124921E74BF48002B2820 /* WKHTTPCookieStore.mm in Sources */,
 				1A4A9C5512B816CF008FE984 /* NetscapePluginModule.cpp in Sources */,
 				839A2F311E2067450039057E /* HighPerformanceGraphicsUsageSampler.cpp in Sources */,
 				1A4A9C9A12B821CD008FE984 /* NetscapePluginModuleMac.mm in Sources */,
@@ -9825,7 +9825,7 @@
 				831EEBBE1BD85C4300BB64C3 /* NetworkCacheSpeculativeLoad.cpp in Sources */,
 				832AE2531BE2E8CD00FAAE10 /* NetworkCacheSpeculativeLoadManager.cpp in Sources */,
 				83BDCCB91AC5FDB6003F6441 /* NetworkCacheStatistics.cpp in Sources */,
-				51D124911E74BF3C002B2820 /* APIHTTPCookieStorage.cpp in Sources */,
+				51D124911E74BF3C002B2820 /* APIHTTPCookieStore.cpp in Sources */,
 				E4436ED01A0D040B00EAD204 /* NetworkCacheStorage.cpp in Sources */,
 				8310428C1BD6B66F00A715E4 /* NetworkCacheSubresourcesEntry.cpp in Sources */,
 				5302583D1DCBBD2200DA89C2 /* NetworkCaptureEvent.cpp in Sources */,

Modified: trunk/Tools/ChangeLog (213946 => 213947)


--- trunk/Tools/ChangeLog	2017-03-14 22:32:10 UTC (rev 213946)
+++ trunk/Tools/ChangeLog	2017-03-14 22:36:52 UTC (rev 213947)
@@ -1,3 +1,13 @@
+2017-03-14  Brady Eidson  <[email protected]>
+
+        Rename WKHTTPCookieStorage to WKHTTPCookieStore.
+        https://bugs.webkit.org/show_bug.cgi?id=169630
+
+        Reviewed by Tim Horton.
+
+        * TestWebKitAPI/Tests/WebKit2Cocoa/WKHTTPCookieStorage.mm:
+        (TEST):
+
 2017-03-14  Jonathan Bedard  <[email protected]>
 
         webkitpy: Efficient app installation for device testing

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKHTTPCookieStorage.mm (213946 => 213947)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKHTTPCookieStorage.mm	2017-03-14 22:32:10 UTC (rev 213946)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKHTTPCookieStorage.mm	2017-03-14 22:36:52 UTC (rev 213947)
@@ -27,7 +27,7 @@
 
 #import "PlatformUtilities.h"
 #import <WebKit/WKFoundation.h>
-#import <WebKit/WKHTTPCookieStorage.h>
+#import <WebKit/WKHTTPCookieStore.h>
 #import <WebKit/WKWebsiteDataStorePrivate.h>
 #import <wtf/RetainPtr.h>
 
@@ -40,10 +40,10 @@
     auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
     [webView loadHTMLString:@"Oh hello" baseURL:[NSURL URLWithString:@"http://webkit.org"]];
 
-    RetainPtr<WKHTTPCookieStorage> cookieStorage = [WKWebsiteDataStore defaultDataStore]._httpCookieStorage;
+    RetainPtr<WKHTTPCookieStore> cookieStore = [WKWebsiteDataStore defaultDataStore]._httpCookieStore;
 
     NSArray<NSHTTPCookie *> *cookies = nil;
-    [cookieStorage fetchCookies:[cookiesPtr = &cookies](NSArray<NSHTTPCookie *> *nsCookies) {
+    [cookieStore fetchCookies:[cookiesPtr = &cookies](NSArray<NSHTTPCookie *> *nsCookies) {
         *cookiesPtr = [nsCookies retain];
         gotFlag = true;
     }];
@@ -73,7 +73,7 @@
         NSHTTPCookieMaximumAge: @"10000",
     }];
 
-    [cookieStorage setCookie:cookie1.get() completionHandler:[](){
+    [cookieStore setCookie:cookie1.get() completionHandler:[](){
         gotFlag = true;
     }];
 
@@ -80,7 +80,7 @@
     TestWebKitAPI::Util::run(&gotFlag);
     gotFlag = false;
 
-    [cookieStorage setCookie:cookie2.get() completionHandler:[](){
+    [cookieStore setCookie:cookie2.get() completionHandler:[](){
         gotFlag = true;
     }];
 
@@ -87,7 +87,7 @@
     TestWebKitAPI::Util::run(&gotFlag);
     gotFlag = false;
 
-    [cookieStorage fetchCookies:[cookiesPtr = &cookies](NSArray<NSHTTPCookie *> *nsCookies) {
+    [cookieStore fetchCookies:[cookiesPtr = &cookies](NSArray<NSHTTPCookie *> *nsCookies) {
         *cookiesPtr = [nsCookies retain];
         gotFlag = true;
     }];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to