Rename WKHTTPCookieStorage to WKHTTPCookieStore.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Mar 2017 22:36:52 +0000 (22:36 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Mar 2017 22:36:52 +0000 (22:36 +0000)
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):

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

19 files changed:
Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/API/APIObject.h
Source/WebKit2/Shared/Cocoa/APIObject.mm
Source/WebKit2/UIProcess/API/APIHTTPCookieStore.cpp [moved from Source/WebKit2/UIProcess/API/APIHTTPCookieStorage.cpp with 82% similarity]
Source/WebKit2/UIProcess/API/APIHTTPCookieStore.h [moved from Source/WebKit2/UIProcess/API/APIHTTPCookieStorage.h with 89% similarity]
Source/WebKit2/UIProcess/API/APIWebsiteDataStore.cpp
Source/WebKit2/UIProcess/API/APIWebsiteDataStore.h
Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStore.h [moved from Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorage.h with 96% similarity]
Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStore.mm [moved from Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorage.mm with 82% similarity]
Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStoreInternal.h [moved from Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorageInternal.h with 78% similarity]
Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h
Source/WebKit2/UIProcess/WebProcessPool.cpp
Source/WebKit2/UIProcess/WebProcessPool.h
Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKHTTPCookieStorage.mm

index b1cee14..c818720 100644 (file)
@@ -333,7 +333,7 @@ set(WebKit2_SOURCES
     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
index 2229e84..a50d896 100644 (file)
@@ -1,3 +1,63 @@
+2017-03-14  Brady Eidson  <beidson@apple.com>
+
+        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  <andersca@apple.com>
 
         Propagate PassKit errors
index 46f2791..73da8f8 100644 (file)
@@ -116,7 +116,7 @@ public:
         FullScreenManager,
         GeolocationManager,
         GeolocationPermissionRequest,
-        HTTPCookieStorage,
+        HTTPCookieStore,
         HitTestResult,
         GeolocationPosition,
         GrammarDetail,
index dc69ad7..441b34f 100644 (file)
@@ -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 @@ void* Object::newObject(size_t size, Type type)
         wrapper = [WKFrameInfo alloc];
         break;
 
-    case Type::HTTPCookieStorage:
-        wrapper = [WKHTTPCookieStorage alloc];
+    case Type::HTTPCookieStore:
+        wrapper = [WKHTTPCookieStore alloc];
         break;
 
 #if PLATFORM(MAC)
@@ -24,7 +24,7 @@
  */
 
 #include "config.h"
-#include "APIHTTPCookieStorage.h"
+#include "APIHTTPCookieStore.h"
 
 #include "APIWebsiteDataStore.h"
 #include "WebCookieManagerProxy.h"
@@ -35,16 +35,16 @@ using namespace WebKit;
 
 namespace API {
 
-HTTPCookieStorage::HTTPCookieStorage(WebsiteDataStore& websiteDataStore)
+HTTPCookieStore::HTTPCookieStore(WebsiteDataStore& websiteDataStore)
     : m_owningDataStore(websiteDataStore)
 {
 }
 
-HTTPCookieStorage::~HTTPCookieStorage()
+HTTPCookieStore::~HTTPCookieStore()
 {
 }
 
-void HTTPCookieStorage::cookies(Function<void (const Vector<WebCore::Cookie>&)>&& completionHandler)
+void HTTPCookieStore::cookies(Function<void (const Vector<WebCore::Cookie>&)>&& completionHandler)
 {
     auto& dataStore = m_owningDataStore.websiteDataStore();
     auto pool = dataStore.processPoolForCookieStorageOperations();
@@ -55,7 +55,7 @@ void HTTPCookieStorage::cookies(Function<void (const Vector<WebCore::Cookie>&)>&
     });
 }
 
-void HTTPCookieStorage::cookies(const WebCore::URL& url, Function<void (const Vector<WebCore::Cookie>&)>&& completionHandler)
+void HTTPCookieStore::cookies(const WebCore::URL& url, Function<void (const Vector<WebCore::Cookie>&)>&& completionHandler)
 {
     auto& dataStore = m_owningDataStore.websiteDataStore();
     auto pool = dataStore.processPoolForCookieStorageOperations();
@@ -66,7 +66,7 @@ void HTTPCookieStorage::cookies(const WebCore::URL& url, Function<void (const Ve
     });
 }
 
-void HTTPCookieStorage::setCookie(const WebCore::Cookie& cookie, Function<void ()>&& completionHandler)
+void HTTPCookieStore::setCookie(const WebCore::Cookie& cookie, Function<void ()>&& completionHandler)
 {
     auto& dataStore = m_owningDataStore.websiteDataStore();
     auto pool = dataStore.processPoolForCookieStorageOperations();
@@ -77,7 +77,7 @@ void HTTPCookieStorage::setCookie(const WebCore::Cookie& cookie, Function<void (
     });
 }
 
-void HTTPCookieStorage::setCookies(const Vector<WebCore::Cookie>& cookies, const WebCore::URL& url, const WebCore::URL& mainDocumentURL, Function<void ()>&& 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();
@@ -88,7 +88,7 @@ void HTTPCookieStorage::setCookies(const Vector<WebCore::Cookie>& cookies, const
     });
 }
 
-void HTTPCookieStorage::deleteCookie(const WebCore::Cookie& cookie, Function<void ()>&& completionHandler)
+void HTTPCookieStore::deleteCookie(const WebCore::Cookie& cookie, Function<void ()>&& completionHandler)
 {
     auto& dataStore = m_owningDataStore.websiteDataStore();
     auto pool = dataStore.processPoolForCookieStorageOperations();
@@ -99,7 +99,7 @@ void HTTPCookieStorage::deleteCookie(const WebCore::Cookie& cookie, Function<voi
     });
 }
 
-void HTTPCookieStorage::removeCookiesSinceDate(std::chrono::system_clock::time_point date, Function<void ()>&& completionHandler)
+void HTTPCookieStore::removeCookiesSinceDate(std::chrono::system_clock::time_point date, Function<void ()>&& completionHandler)
 {
     auto& dataStore = m_owningDataStore.websiteDataStore();
     auto pool = dataStore.processPoolForCookieStorageOperations();
@@ -110,7 +110,7 @@ void HTTPCookieStorage::removeCookiesSinceDate(std::chrono::system_clock::time_p
     });
 }
 
-void HTTPCookieStorage::setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy policy, Function<void ()>&& completionHandler)
+void HTTPCookieStore::setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy policy, Function<void ()>&& completionHandler)
 {
     auto& dataStore = m_owningDataStore.websiteDataStore();
     auto pool = dataStore.processPoolForCookieStorageOperations();
@@ -121,7 +121,7 @@ void HTTPCookieStorage::setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy policy,
     });
 }
 
-void HTTPCookieStorage::getHTTPCookieAcceptPolicy(Function<void (HTTPCookieAcceptPolicy)>&& completionHandler)
+void HTTPCookieStore::getHTTPCookieAcceptPolicy(Function<void (HTTPCookieAcceptPolicy)>&& completionHandler)
 {
     auto& dataStore = m_owningDataStore.websiteDataStore();
     auto pool = dataStore.processPoolForCookieStorageOperations();
@@ -39,14 +39,14 @@ namespace API {
 
 class WebsiteDataStore;
 
-class HTTPCookieStorage final : public ObjectImpl<Object::Type::HTTPCookieStorage> {
+class HTTPCookieStore final : public ObjectImpl<Object::Type::HTTPCookieStore> {
 public:
-    static Ref<HTTPCookieStorage> create(WebsiteDataStore& websiteDataStore)
+    static Ref<HTTPCookieStore> create(WebsiteDataStore& websiteDataStore)
     {
-        return adoptRef(*new HTTPCookieStorage(websiteDataStore));
+        return adoptRef(*new HTTPCookieStore(websiteDataStore));
     }
 
-    virtual ~HTTPCookieStorage();
+    virtual ~HTTPCookieStore();
 
     void cookies(Function<void (const Vector<WebCore::Cookie>&)>&& completionHandler);
     void cookies(const WebCore::URL&, Function<void (const Vector<WebCore::Cookie>&)>&& completionHandler);
@@ -61,7 +61,7 @@ public:
     void getHTTPCookieAcceptPolicy(Function<void (WebKit::HTTPCookieAcceptPolicy)>&& completionHandler);
     
 private:
-    HTTPCookieStorage(WebsiteDataStore&);
+    HTTPCookieStore(WebsiteDataStore&);
 
     WebsiteDataStore& m_owningDataStore;
 };
index e73ceac..51bf9f9 100644 (file)
@@ -64,12 +64,12 @@ WebsiteDataStore::~WebsiteDataStore()
 {
 }
 
-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()
index 68ce58a..fb19635 100644 (file)
@@ -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 @@ public:
     void registerSharedResourceLoadObserver();
 
     WebKit::WebsiteDataStore& websiteDataStore() { return *m_websiteDataStore; }
-    HTTPCookieStorage& httpCookieStorage();
+    HTTPCookieStore& httpCookieStore();
 
     static String defaultApplicationCacheDirectory();
     static String defaultNetworkCacheDirectory();
@@ -75,7 +75,7 @@ private:
     static String websiteDataDirectoryFileSystemRepresentation(const String& directoryName);
 
     RefPtr<WebKit::WebsiteDataStore> m_websiteDataStore;
-    RefPtr<HTTPCookieStorage> m_apiHTTPCookieStorage;
+    RefPtr<HTTPCookieStore> m_apiHTTPCookieStore;
 };
 
 }
 NS_ASSUME_NONNULL_BEGIN
 
 /*!
- A WKHTTPCookieStorage object allows managing the HTTP cookies associated with a particular WKWebsiteDataStore.
+ 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 WKHTTPCookieStorage : NSObject
+@interface WKHTTPCookieStore : NSObject
 
 - (instancetype)init NS_UNAVAILABLE;
 
@@ -24,7 +24,7 @@
  */
 
 #import "config.h"
-#import "WKHTTPCookieStorageInternal.h"
+#import "WKHTTPCookieStoreInternal.h"
 
 #if WK_API_ENABLED
 
@@ -44,18 +44,18 @@ static NSArray<NSHTTPCookie *> *coreCookiesToNSCookies(const Vector<WebCore::Coo
     return nsCookies;
 }
 
-@implementation WKHTTPCookieStorage
+@implementation WKHTTPCookieStore
 
 - (void)dealloc
 {
-    _cookieStorage->API::HTTPCookieStorage::~HTTPCookieStorage();
+    _cookieStore->API::HTTPCookieStore::~HTTPCookieStore();
 
     [super dealloc];
 }
 
 - (void)fetchCookies:(void (^)(NSArray<NSHTTPCookie *> *))completionHandler
 {
-    _cookieStorage->cookies([handler = adoptNS([completionHandler copy])](const Vector<WebCore::Cookie>& cookies) {
+    _cookieStore->cookies([handler = adoptNS([completionHandler copy])](const Vector<WebCore::Cookie>& cookies) {
         auto rawHandler = (void (^)(NSArray<NSHTTPCookie *> *))handler.get();
         rawHandler(coreCookiesToNSCookies(cookies));
     });
@@ -63,7 +63,7 @@ static NSArray<NSHTTPCookie *> *coreCookiesToNSCookies(const Vector<WebCore::Coo
 
 - (void)fetchCookiesForURL:(NSURL *)url completionHandler:(void (^)(NSArray<NSHTTPCookie *> *))completionHandler
 {
-    _cookieStorage->cookies(url, [handler = adoptNS([completionHandler copy])](const Vector<WebCore::Cookie>& cookies) {
+    _cookieStore->cookies(url, [handler = adoptNS([completionHandler copy])](const Vector<WebCore::Cookie>& cookies) {
         auto rawHandler = (void (^)(NSArray<NSHTTPCookie *> *))handler.get();
         rawHandler(coreCookiesToNSCookies(cookies));
     });
@@ -71,7 +71,7 @@ static NSArray<NSHTTPCookie *> *coreCookiesToNSCookies(const Vector<WebCore::Coo
 
 - (void)setCookie:(NSHTTPCookie *)cookie completionHandler:(void (^)())completionHandler
 {
-    _cookieStorage->setCookie(cookie, [handler = adoptNS([completionHandler copy])]() {
+    _cookieStore->setCookie(cookie, [handler = adoptNS([completionHandler copy])]() {
         auto rawHandler = (void (^)())handler.get();
         if (rawHandler)
             rawHandler();
@@ -81,7 +81,7 @@ static NSArray<NSHTTPCookie *> *coreCookiesToNSCookies(const Vector<WebCore::Coo
 
 - (void)deleteCookie:(NSHTTPCookie *)cookie completionHandler:(void (^)())completionHandler
 {
-    _cookieStorage->deleteCookie(cookie, [handler = adoptNS([completionHandler copy])]() {
+    _cookieStore->deleteCookie(cookie, [handler = adoptNS([completionHandler copy])]() {
         auto rawHandler = (void (^)())handler.get();
         if (rawHandler)
             rawHandler();
@@ -95,7 +95,7 @@ static NSArray<NSHTTPCookie *> *coreCookiesToNSCookies(const Vector<WebCore::Coo
     for (NSHTTPCookie *cookie : cookies)
         coreCookies.uncheckedAppend(cookie);
 
-    _cookieStorage->setCookies(coreCookies, URL, mainDocumentURL, [handler = adoptNS([completionHandler copy])]() {
+    _cookieStore->setCookies(coreCookies, URL, mainDocumentURL, [handler = adoptNS([completionHandler copy])]() {
         auto rawHandler = (void (^)())handler.get();
         if (rawHandler)
             rawHandler();
@@ -106,7 +106,7 @@ static NSArray<NSHTTPCookie *> *coreCookiesToNSCookies(const Vector<WebCore::Coo
 {
     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])]() {
+    _cookieStore->removeCookiesSinceDate(systemClockTime, [handler = adoptNS([completionHandler copy])]() {
         auto rawHandler = (void (^)())handler.get();
         if (rawHandler)
             rawHandler();
@@ -115,7 +115,7 @@ static NSArray<NSHTTPCookie *> *coreCookiesToNSCookies(const Vector<WebCore::Coo
 
 - (void)setCookieAcceptPolicy:(NSHTTPCookieAcceptPolicy)policy completionHandler:(void (^)())completionHandler
 {
-    _cookieStorage->setHTTPCookieAcceptPolicy(policy, [handler = adoptNS([completionHandler copy])]() {
+    _cookieStore->setHTTPCookieAcceptPolicy(policy, [handler = adoptNS([completionHandler copy])]() {
         auto rawHandler = (void (^)())handler.get();
         if (rawHandler)
             rawHandler();
@@ -143,7 +143,7 @@ static NSHTTPCookieAcceptPolicy kitCookiePolicyToNSCookiePolicy(WebKit::HTTPCook
 
 - (void)fetchCookieAcceptPolicy:(void (^)(NSHTTPCookieAcceptPolicy))completionHandler
 {
-    _cookieStorage->getHTTPCookieAcceptPolicy([handler = adoptNS([completionHandler copy])](WebKit::HTTPCookieAcceptPolicy policy) {
+    _cookieStore->getHTTPCookieAcceptPolicy([handler = adoptNS([completionHandler copy])](WebKit::HTTPCookieAcceptPolicy policy) {
         auto rawHandler = (void (^)(NSHTTPCookieAcceptPolicy))handler.get();
         rawHandler(kitCookiePolicyToNSCookiePolicy(policy));
     });
@@ -153,7 +153,7 @@ static NSHTTPCookieAcceptPolicy kitCookiePolicyToNSCookiePolicy(WebKit::HTTPCook
 
 - (API::Object&)_apiObject
 {
-    return *_cookieStorage;
+    return *_cookieStore;
 }
 
 @end
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import "WKHTTPCookieStorage.h"
+#import "WKHTTPCookieStore.h"
 
 #if WK_API_ENABLED
 
-#import "APIHTTPCookieStorage.h"
+#import "APIHTTPCookieStore.h"
 #import "WKObject.h"
 
 namespace WebKit {
 
-inline WKHTTPCookieStorage *wrapper(API::HTTPCookieStorage& cookieStorage)
+inline WKHTTPCookieStore *wrapper(API::HTTPCookieStore& cookieStore)
 {
-    ASSERT([cookieStorage.wrapper() isKindOfClass:[WKHTTPCookieStorage class]]);
-    return (WKHTTPCookieStorage *)cookieStorage.wrapper();
+    ASSERT([cookieStore.wrapper() isKindOfClass:[WKHTTPCookieStore class]]);
+    return (WKHTTPCookieStore *)cookieStore.wrapper();
 }
 
 }
 
-@interface WKHTTPCookieStorage () <WKObject> {
+@interface WKHTTPCookieStore () <WKObject> {
 @package
-    API::ObjectStorage<API::HTTPCookieStorage> _cookieStorage;
+    API::ObjectStorage<API::HTTPCookieStore> _cookieStore;
 }
 @end
 
index 234f80e..e37eeb7 100644 (file)
@@ -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 @@ static Vector<WebKit::WebsiteDataRecord> toWebsiteDataRecords(NSArray *dataRecor
     _websiteDataStore->websiteDataStore().setResourceLoadStatisticsEnabled(enabled);
 }
 
-- (WKHTTPCookieStorage *)_httpCookieStorage
+- (WKHTTPCookieStore *)_httpCookieStore
 {
-    return WebKit::wrapper(_websiteDataStore->httpCookieStorage());
+    return WebKit::wrapper(_websiteDataStore->httpCookieStore());
 }
 
 @end
index 099b045..f07174e 100644 (file)
@@ -29,7 +29,7 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@class WKHTTPCookieStorage;
+@class WKHTTPCookieStore;
 @class _WKWebsiteDataStoreConfiguration;
 
 typedef NS_OPTIONS(NSUInteger, _WKWebsiteDataStoreFetchOptions) {
@@ -44,8 +44,8 @@ typedef NS_OPTIONS(NSUInteger, _WKWebsiteDataStoreFetchOptions) {
 
 @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
 
index 62d4493..bb9762a 100644 (file)
@@ -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"
index 9818a93..2b07a4e 100644 (file)
@@ -76,7 +76,7 @@ namespace API {
 class AutomationClient;
 class CustomProtocolManagerClient;
 class DownloadClient;
-class HTTPCookieStorage;
+class HTTPCookieStore;
 class LegacyContextHistoryClient;
 class PageConfiguration;
 }
index 3044fce..12c9611 100644 (file)
@@ -116,7 +116,7 @@ Ref<WebProcessPool> WebsiteDataStore::processPoolForCookieStorageOperations()
     // 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.
index 13e41c6..026866f 100644 (file)
                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 */; };
                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>"; };
                                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 */,
                                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 */,
                                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 */,
                                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 */,
                                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 */,
index d1c7724..4db02ce 100644 (file)
@@ -1,3 +1,13 @@
+2017-03-14  Brady Eidson  <beidson@apple.com>
+
+        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  <jbedard@apple.com>
 
         webkitpy: Efficient app installation for device testing
index 25ae47f..1298d70 100644 (file)
@@ -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 @@ TEST(WebKit2, WKHTTPCookieStorage)
     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,21 +73,21 @@ TEST(WebKit2, WKHTTPCookieStorage)
         NSHTTPCookieMaximumAge: @"10000",
     }];
 
-    [cookieStorage setCookie:cookie1.get() completionHandler:[](){
+    [cookieStore setCookie:cookie1.get() completionHandler:[](){
         gotFlag = true;
     }];
 
     TestWebKitAPI::Util::run(&gotFlag);
     gotFlag = false;
 
-    [cookieStorage setCookie:cookie2.get() completionHandler:[](){
+    [cookieStore setCookie:cookie2.get() completionHandler:[](){
         gotFlag = true;
     }];
 
     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;
     }];