Make WKHTTPCookieStore public.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Apr 2017 23:22:21 +0000 (23:22 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Apr 2017 23:22:21 +0000 (23:22 +0000)
<rdar://problem/31024691> and https://bugs.webkit.org/show_bug.cgi?id=170920

Reviewed by Geoffrey Garen.

Source/WebKit2:

* UIProcess/API/Cocoa/WKHTTPCookieStore.h:
* UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
(-[WKHTTPCookieStore getAllCookies:]):
(-[WKHTTPCookieStore allCookies:]): Deleted.

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

* WebKit2.xcodeproj/project.pbxproj:

Tools:

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

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStore.h
Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStore.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStore.h
Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKHTTPCookieStore.mm

index feefc4d..8b69603 100644 (file)
@@ -1,3 +1,23 @@
+2017-04-17  Brady Eidson  <beidson@apple.com>
+
+        Make WKHTTPCookieStore public.
+        <rdar://problem/31024691> and https://bugs.webkit.org/show_bug.cgi?id=170920
+
+        Reviewed by Geoffrey Garen.
+
+        * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
+        * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
+        (-[WKHTTPCookieStore getAllCookies:]):
+        (-[WKHTTPCookieStore allCookies:]): Deleted.
+
+        * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
+        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
+        (-[WKWebsiteDataStore httpCookieStore]):
+        (-[WKWebsiteDataStore _httpCookieStore]): Deleted.
+        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
+
+        * WebKit2.xcodeproj/project.pbxproj:
+
 2017-04-17  Eric Carlson  <eric.carlson@apple.com>
 
         [MediaStream] Fix typo in UIDelegate::mediaCaptureStateDidChange
index ac52191..603bc85 100644 (file)
@@ -49,7 +49,7 @@ WK_CLASS_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA))
 /*! @abstract Fetches all stored cookies.
  @param completionHandler A block to invoke with the fetched cookies.
  */
-- (void)allCookies:(void (^)(NSArray<NSHTTPCookie *> *))completionHandler;
+- (void)getAllCookies:(void (^)(NSArray<NSHTTPCookie *> *))completionHandler;
 
 /*! @abstract Set a cookie.
  @param cookie The cookie to set.
index 014cf57..321634c 100644 (file)
@@ -76,7 +76,7 @@ private:
     [super dealloc];
 }
 
-- (void)allCookies:(void (^)(NSArray<NSHTTPCookie *> *))completionHandler
+- (void)getAllCookies:(void (^)(NSArray<NSHTTPCookie *> *))completionHandler
 {
     _cookieStore->cookies([handler = adoptNS([completionHandler copy])](const Vector<WebCore::Cookie>& cookies) {
         auto rawHandler = (void (^)(NSArray<NSHTTPCookie *> *))handler.get();
index fd166b8..28428ed 100644 (file)
@@ -31,6 +31,8 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
+@class WKHTTPCookieStore;
+
 /*! A WKWebsiteDataStore represents various types of data that a website might
  make use of. This includes cookies, disk and memory caches, and persistent data such as WebSQL,
  IndexedDB databases, and local storage.
@@ -75,6 +77,9 @@ WK_CLASS_AVAILABLE(macosx(10.11), ios(9.0))
 */
 - (void)removeDataOfTypes:(NSSet<NSString *> *)websiteDataTypes modifiedSince:(NSDate *)date completionHandler:(void (^)(void))completionHandler;
 
+/*! @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
 
 NS_ASSUME_NONNULL_END
index e37eeb7..a1ba232 100644 (file)
@@ -195,7 +195,7 @@ static Vector<WebKit::WebsiteDataRecord> toWebsiteDataRecords(NSArray *dataRecor
     _websiteDataStore->websiteDataStore().setResourceLoadStatisticsEnabled(enabled);
 }
 
-- (WKHTTPCookieStore *)_httpCookieStore
+- (WKHTTPCookieStore *)httpCookieStore
 {
     return WebKit::wrapper(_websiteDataStore->httpCookieStore());
 }
index f07174e..49d9be6 100644 (file)
@@ -29,7 +29,6 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@class WKHTTPCookieStore;
 @class _WKWebsiteDataStoreConfiguration;
 
 typedef NS_OPTIONS(NSUInteger, _WKWebsiteDataStoreFetchOptions) {
@@ -44,9 +43,6 @@ typedef NS_OPTIONS(NSUInteger, _WKWebsiteDataStoreFetchOptions) {
 
 @property (nonatomic, setter=_setResourceLoadStatisticsEnabled:) BOOL _resourceLoadStatisticsEnabled WK_API_AVAILABLE(macosx(10.12), ios(10.0));
 
-/*! @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
 
 NS_ASSUME_NONNULL_END
index d107e04..54365de 100644 (file)
                51D1243A1E6E0AAB002B2820 /* APIURLSchemeHandlerTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D124381E6DFDB9002B2820 /* APIURLSchemeHandlerTask.cpp */; };
                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, ); }; };
+               51D124991E763C01002B2820 /* WKHTTPCookieStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D124841E734AE3002B2820 /* WKHTTPCookieStore.h */; settings = {ATTRIBUTES = (Public, ); }; };
                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 */; };
index f7043d4..a69af60 100644 (file)
@@ -1,3 +1,13 @@
+2017-04-17  Brady Eidson  <beidson@apple.com>
+
+        Make WKHTTPCookieStore public.
+        <rdar://problem/31024691> and https://bugs.webkit.org/show_bug.cgi?id=170920
+
+        Reviewed by Geoffrey Garen.
+
+        * TestWebKitAPI/Tests/WebKit2Cocoa/WKHTTPCookieStore.mm:
+        (TEST):
+
 2017-04-17  Youenn Fablet  <youenn@apple.com>
 
         Disable outdated WritableStream API
index 0d8a65b..dd50ee0 100644 (file)
@@ -56,14 +56,14 @@ TEST(WebKit2, WKHTTPCookieStore)
     auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
     [webView loadHTMLString:@"Oh hello" baseURL:[NSURL URLWithString:@"http://webkit.org"]];
 
-    globalCookieStore = [WKWebsiteDataStore defaultDataStore]._httpCookieStore;
+    globalCookieStore = [WKWebsiteDataStore defaultDataStore].httpCookieStore;
     RetainPtr<CookieObserver> observer1 = adoptNS([[CookieObserver alloc] init]);
     RetainPtr<CookieObserver> observer2 = adoptNS([[CookieObserver alloc] init]);
     [globalCookieStore addObserver:observer1.get()];
     [globalCookieStore addObserver:observer2.get()];
 
     NSArray<NSHTTPCookie *> *cookies = nil;
-    [globalCookieStore allCookies:[cookiesPtr = &cookies](NSArray<NSHTTPCookie *> *nsCookies) {
+    [globalCookieStore getAllCookies:[cookiesPtr = &cookies](NSArray<NSHTTPCookie *> *nsCookies) {
         *cookiesPtr = [nsCookies retain];
         gotFlag = true;
     }];
@@ -107,7 +107,7 @@ TEST(WebKit2, WKHTTPCookieStore)
     TestWebKitAPI::Util::run(&gotFlag);
     gotFlag = false;
 
-    [globalCookieStore allCookies:[cookiesPtr = &cookies](NSArray<NSHTTPCookie *> *nsCookies) {
+    [globalCookieStore getAllCookies:[cookiesPtr = &cookies](NSArray<NSHTTPCookie *> *nsCookies) {
         *cookiesPtr = [nsCookies retain];
         gotFlag = true;
     }];
@@ -143,7 +143,7 @@ TEST(WebKit2, WKHTTPCookieStore)
     TestWebKitAPI::Util::run(&gotFlag);
     gotFlag = false;
 
-    [globalCookieStore allCookies:[cookiesPtr = &cookies](NSArray<NSHTTPCookie *> *nsCookies) {
+    [globalCookieStore getAllCookies:[cookiesPtr = &cookies](NSArray<NSHTTPCookie *> *nsCookies) {
         *cookiesPtr = [nsCookies retain];
         gotFlag = true;
     }];