Clean up which storage cookie jar functions use
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2012 00:41:30 +0000 (00:41 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2012 00:41:30 +0000 (00:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=101395

Reviewed by Brady Eidson.

Source/WebCore:

* WebCore.exp.in:
* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:
Updated for two new WKSI functions.

* platform/CookieJar.h: Added explanatory comments.

* platform/mac/CookieJar.mm:
(WebCore::cookies): Removed fallback on NSHTTPCookieStorage, the WKSI function
already implements it.
(WebCore::cookieRequestHeaderFieldValue): Ditto.
(WebCore::setCookies): Ditto.
(WebCore::cookiesEnabled): Ditto.
(WebCore::getRawCookies): Ditto.
(WebCore::deleteCookie): Ditto.
(WebCore::getHostnamesWithCookies): This function used to look at NSHTTPCookieStorage
exclusively. While it makes sense to bypass private storage session, default storage
session (currently only used for testing on Mac) is never OK to bypass. Changed to
use a WKSI function that supports both.
(WebCore::deleteCookiesForHostname): Ditto.
(WebCore::deleteAllCookies): Ditto.

* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::getHostnamesWithCookies):
(WebCore::deleteCookiesForHostname):
(WebCore::deleteAllCookies):
Updated to match Foundation, so now these functions bypass private session.

* platform/network/cf/CookieStorageCFNet.cpp:
(WebCore::currentCFHTTPCookieStorage): Updated a comment.
(WebCore::defaultCFHTTPCookieStorage):  Added a function that returns cookie storage
for non-private session (or null if that would be an NSHTTPCookieStorage).
(WebCore::startObservingCookieChanges): We do not want to observe private cookies
here, and we certainly don't want a mismatch between start/stop due to private
browsing mode changes.
(WebCore::stopObservingCookieChanges): Ditto.

* platform/network/cf/CookieStorageCFNet.h: Added defaultCFHTTPCookieStorage().

Source/WebKit/mac:

* WebCoreSupport/WebSystemInterface.mm: (InitWebCoreSystemInterface): Updated for
two new functions.

Source/WebKit2:

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface):
Updated for two new functions.

WebKitLibraries:

* WebKitSystemInterface.h:
* libWebKitSystemInterfaceLion.a:
* libWebKitSystemInterfaceMountainLion.a:
Added WKHTTPCookies() and WKDeleteAllHTTPCookies(). Updated ifdefs for currently
supported OS versions.

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

17 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/CookieJar.h
Source/WebCore/platform/mac/CookieJar.mm
Source/WebCore/platform/mac/WebCoreSystemInterface.h
Source/WebCore/platform/mac/WebCoreSystemInterface.mm
Source/WebCore/platform/network/cf/CookieJarCFNet.cpp
Source/WebCore/platform/network/cf/CookieStorageCFNet.cpp
Source/WebCore/platform/network/cf/CookieStorageCFNet.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitSystemInterface.h
WebKitLibraries/libWebKitSystemInterfaceLion.a
WebKitLibraries/libWebKitSystemInterfaceMountainLion.a

index 6a9bd6f..516ae93 100644 (file)
@@ -1,3 +1,49 @@
+2012-11-06  Alexey Proskuryakov  <ap@apple.com>
+
+        Clean up which storage cookie jar functions use
+        https://bugs.webkit.org/show_bug.cgi?id=101395
+
+        Reviewed by Brady Eidson.
+
+        * WebCore.exp.in:
+        * platform/mac/WebCoreSystemInterface.h:
+        * platform/mac/WebCoreSystemInterface.mm:
+        Updated for two new WKSI functions.
+
+        * platform/CookieJar.h: Added explanatory comments.
+
+        * platform/mac/CookieJar.mm:
+        (WebCore::cookies): Removed fallback on NSHTTPCookieStorage, the WKSI function
+        already implements it.
+        (WebCore::cookieRequestHeaderFieldValue): Ditto.
+        (WebCore::setCookies): Ditto.
+        (WebCore::cookiesEnabled): Ditto.
+        (WebCore::getRawCookies): Ditto.
+        (WebCore::deleteCookie): Ditto.
+        (WebCore::getHostnamesWithCookies): This function used to look at NSHTTPCookieStorage
+        exclusively. While it makes sense to bypass private storage session, default storage
+        session (currently only used for testing on Mac) is never OK to bypass. Changed to
+        use a WKSI function that supports both.
+        (WebCore::deleteCookiesForHostname): Ditto.
+        (WebCore::deleteAllCookies): Ditto.
+
+        * platform/network/cf/CookieJarCFNet.cpp:
+        (WebCore::getHostnamesWithCookies):
+        (WebCore::deleteCookiesForHostname):
+        (WebCore::deleteAllCookies):
+        Updated to match Foundation, so now these functions bypass private session.
+
+        * platform/network/cf/CookieStorageCFNet.cpp:
+        (WebCore::currentCFHTTPCookieStorage): Updated a comment.
+        (WebCore::defaultCFHTTPCookieStorage):  Added a function that returns cookie storage
+        for non-private session (or null if that would be an NSHTTPCookieStorage).        
+        (WebCore::startObservingCookieChanges): We do not want to observe private cookies
+        here, and we certainly don't want a mismatch between start/stop due to private
+        browsing mode changes.
+        (WebCore::stopObservingCookieChanges): Ditto.
+
+        * platform/network/cf/CookieStorageCFNet.h: Added defaultCFHTTPCookieStorage().
+
 2012-11-06  Huang Dongsung  <luxtella@company100.net>
 
         Build fix. r133601 broke the Windows build.
index 9f00620..0564ffb 100644 (file)
@@ -1520,6 +1520,7 @@ _wkCreateCTLineWithUniCharProvider
 _wkCreateCustomCFReadStream
 _wkCreateNSURLConnectionDelegateProxy
 _wkCreatePrivateStorageSession
+_wkDeleteAllHTTPCookies
 _wkDeleteHTTPCookie
 _wkGetCFURLResponseHTTPResponse
 _wkGetCFURLResponseMIMEType
@@ -1529,6 +1530,7 @@ _wkGetHTTPPipeliningPriority
 _wkGetMIMETypeForExtension
 _wkGetNSURLResponseLastModifiedDate
 _wkGetUserToBaseCTM
+_wkHTTPCookies
 _wkHTTPCookiesForURL
 _wkInitializeMaximumHTTPConnectionCountPerHost
 _wkSetBaseCTM
index 3895ab6..f4cfd86 100644 (file)
@@ -41,11 +41,13 @@ struct Cookie;
 String cookies(const Document*, const KURL&);
 void setCookies(Document*, const KURL&, const String&);
 
+// These methods use current cookie storage, thus taking private browsing mode into account.
 bool cookiesEnabled(const Document*);
 String cookieRequestHeaderFieldValue(const Document*, const KURL&);
 bool getRawCookies(const Document*, const KURL&, Vector<Cookie>&);
 void deleteCookie(const Document*, const KURL&, const String&);
 
+// These functions always access default cookie storage, not taking private browsing mode into account.
 void getHostnamesWithCookies(HashSet<String>& hostnames);
 void deleteCookiesForHostname(const String& hostname);
 void deleteAllCookies();
index 5a8b6b7..b6d82ae 100644 (file)
@@ -65,12 +65,7 @@ String cookies(const Document*, const KURL& url)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
 
-    NSArray *cookies;
-    if (RetainPtr<CFHTTPCookieStorageRef> cfCookieStorage = currentCFHTTPCookieStorage())
-        cookies = wkHTTPCookiesForURL(cfCookieStorage.get(), url);
-    else
-        cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:url];
-
+    NSArray *cookies = wkHTTPCookiesForURL(currentCFHTTPCookieStorage().get(), url);
     return [[NSHTTPCookie requestHeaderFieldsWithCookies:filterCookies(cookies).get()] objectForKey:@"Cookie"];
 
     END_BLOCK_OBJC_EXCEPTIONS;
@@ -81,12 +76,7 @@ String cookieRequestHeaderFieldValue(const Document*, const KURL& url)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
 
-    NSArray *cookies;
-    if (RetainPtr<CFHTTPCookieStorageRef> cfCookieStorage = currentCFHTTPCookieStorage())
-        cookies = wkHTTPCookiesForURL(cfCookieStorage.get(), url);
-    else
-        cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:url];
-
+    NSArray *cookies = wkHTTPCookiesForURL(currentCFHTTPCookieStorage().get(), url);
     return [[NSHTTPCookie requestHeaderFieldsWithCookies:cookies] objectForKey:@"Cookie"];
 
     END_BLOCK_OBJC_EXCEPTIONS;
@@ -110,10 +100,7 @@ void setCookies(Document* document, const KURL& url, const String& cookieStr)
     RetainPtr<NSArray> filteredCookies = filterCookies([NSHTTPCookie cookiesWithResponseHeaderFields:[NSDictionary dictionaryWithObject:cookieString forKey:@"Set-Cookie"] forURL:cookieURL]);
     ASSERT([filteredCookies.get() count] <= 1);
 
-    if (RetainPtr<CFHTTPCookieStorageRef> cfCookieStorage = currentCFHTTPCookieStorage())
-        wkSetHTTPCookiesForURL(cfCookieStorage.get(), filteredCookies.get(), cookieURL, document->firstPartyForCookies());
-    else
-        [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookies:filteredCookies.get() forURL:cookieURL mainDocumentURL:document->firstPartyForCookies()];
+    wkSetHTTPCookiesForURL(currentCFHTTPCookieStorage().get(), filteredCookies.get(), cookieURL, document->firstPartyForCookies());
 
     END_BLOCK_OBJC_EXCEPTIONS;
 }
@@ -122,12 +109,7 @@ bool cookiesEnabled(const Document*)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
 
-    NSHTTPCookieAcceptPolicy cookieAcceptPolicy;
-    if (RetainPtr<CFHTTPCookieStorageRef> cfCookieStorage = currentCFHTTPCookieStorage())
-        cookieAcceptPolicy = static_cast<NSHTTPCookieAcceptPolicy>(wkGetHTTPCookieAcceptPolicy(cfCookieStorage.get()));
-    else
-        cookieAcceptPolicy = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookieAcceptPolicy];
-
+    NSHTTPCookieAcceptPolicy cookieAcceptPolicy = static_cast<NSHTTPCookieAcceptPolicy>(wkGetHTTPCookieAcceptPolicy(currentCFHTTPCookieStorage().get()));
     return cookieAcceptPolicy == NSHTTPCookieAcceptPolicyAlways || cookieAcceptPolicy == NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain;
 
     END_BLOCK_OBJC_EXCEPTIONS;
@@ -139,12 +121,7 @@ bool getRawCookies(const Document*, const KURL& url, Vector<Cookie>& rawCookies)
     rawCookies.clear();
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
 
-    NSArray *cookies;
-    if (RetainPtr<CFHTTPCookieStorageRef> cfCookieStorage = currentCFHTTPCookieStorage())
-        cookies = wkHTTPCookiesForURL(cfCookieStorage.get(), url);
-    else
-        cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:url];
-
+    NSArray *cookies = wkHTTPCookiesForURL(currentCFHTTPCookieStorage().get(), url);
     NSUInteger count = [cookies count];
     rawCookies.reserveCapacity(count);
     for (NSUInteger i = 0; i < count; ++i) {
@@ -163,26 +140,16 @@ void deleteCookie(const Document*, const KURL& url, const String& cookieName)
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
 
     NSURL *cookieURL = url;
-    NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
-    NSArray *cookies;
-    RetainPtr<CFHTTPCookieStorageRef> cfCookieStorage = currentCFHTTPCookieStorage();
-    if (cfCookieStorage)
-        cookies = wkHTTPCookiesForURL(cfCookieStorage.get(), cookieURL);
-    else
-        cookies = [cookieStorage cookiesForURL:cookieURL];
+    RetainPtr<CFHTTPCookieStorageRef> cookieStorage = currentCFHTTPCookieStorage();
+    NSArray *cookies = wkHTTPCookiesForURL(cookieStorage.get(), cookieURL);
 
-    NSString *cookieNameString = (NSString *) cookieName;
+    NSString *cookieNameString = cookieName;
 
     NSUInteger count = [cookies count];
     for (NSUInteger i = 0; i < count; ++i) {
         NSHTTPCookie *cookie = (NSHTTPCookie *)[cookies objectAtIndex:i];
-        if ([[cookie name] isEqualToString:cookieNameString]) {
-            if (cfCookieStorage)
-                wkDeleteHTTPCookie(cfCookieStorage.get(), cookie);
-            else
-                [cookieStorage deleteCookie:cookie];
-            break;
-        }
+        if ([[cookie name] isEqualToString:cookieNameString])
+            wkDeleteHTTPCookie(cookieStorage.get(), cookie);
     }
 
     END_BLOCK_OBJC_EXCEPTIONS;
@@ -191,9 +158,8 @@ void deleteCookie(const Document*, const KURL& url, const String& cookieName)
 void getHostnamesWithCookies(HashSet<String>& hostnames)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    
-    NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
-    NSArray *cookies = [cookieStorage cookies];
+
+    NSArray *cookies = wkHTTPCookies(defaultCFHTTPCookieStorage().get());
     
     for (NSHTTPCookie* cookie in cookies)
         hostnames.add([cookie domain]);
@@ -204,15 +170,15 @@ void getHostnamesWithCookies(HashSet<String>& hostnames)
 void deleteCookiesForHostname(const String& hostname)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    
-    NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
-    NSArray *cookies = [cookieStorage cookies];
+
+    RetainPtr<CFHTTPCookieStorageRef> cookieStorage = defaultCFHTTPCookieStorage();
+    NSArray *cookies = wkHTTPCookies(cookieStorage.get());
     if (!cookies)
         return;
     
     for (NSHTTPCookie* cookie in cookies) {
         if (hostname == String([cookie domain]))
-            [cookieStorage deleteCookie:cookie];
+            wkDeleteHTTPCookie(cookieStorage.get(), cookie);
     }
     
     END_BLOCK_OBJC_EXCEPTIONS;
@@ -220,17 +186,7 @@ void deleteCookiesForHostname(const String& hostname)
 
 void deleteAllCookies()
 {
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    
-    NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
-    NSArray *cookies = [cookieStorage cookies];
-    if (!cookies)
-        return;
-    
-    for (NSHTTPCookie* cookie in cookies)
-        [cookieStorage deleteCookie:cookie];
-
-    END_BLOCK_OBJC_EXCEPTIONS;
+    wkDeleteAllHTTPCookies(defaultCFHTTPCookieStorage().get());
 }
 
 }
index 8fa28c7..78e2ef0 100644 (file)
@@ -290,9 +290,11 @@ typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
 extern CFHTTPCookieStorageRef (*wkCopyHTTPCookieStorage)(CFURLStorageSessionRef);
 extern unsigned (*wkGetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef);
 extern void (*wkSetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef, unsigned);
+extern NSArray *(*wkHTTPCookies)(CFHTTPCookieStorageRef);
 extern NSArray *(*wkHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSURL *);
 extern void (*wkSetHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
 extern void (*wkDeleteHTTPCookie)(CFHTTPCookieStorageRef, NSHTTPCookie *);
+extern void (*wkDeleteAllHTTPCookies)(CFHTTPCookieStorageRef);
 
 extern CFStringRef (*wkGetCFURLResponseMIMEType)(CFURLResponseRef);
 extern CFURLRef (*wkGetCFURLResponseURL)(CFURLResponseRef);
index 2761778..7bc6c3b 100644 (file)
@@ -174,8 +174,10 @@ NSURLRequest* (*wkCopyRequestWithStorageSession)(CFURLStorageSessionRef, NSURLRe
 CFHTTPCookieStorageRef (*wkCopyHTTPCookieStorage)(CFURLStorageSessionRef);
 unsigned (*wkGetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef);
 void (*wkSetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef, unsigned);
+NSArray *(*wkHTTPCookies)(CFHTTPCookieStorageRef);
 NSArray *(*wkHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSURL *);
 void (*wkSetHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
+void (*wkDeleteAllHTTPCookies)(CFHTTPCookieStorageRef);
 void (*wkDeleteHTTPCookie)(CFHTTPCookieStorageRef, NSHTTPCookie *);
 
 CFStringRef (*wkGetCFURLResponseMIMEType)(CFURLResponseRef);
index 5017971..10dfbc6 100644 (file)
@@ -216,7 +216,7 @@ void deleteCookie(const Document*, const KURL& url, const String& name)
 
 void getHostnamesWithCookies(HashSet<String>& hostnames)
 {
-    RetainPtr<CFHTTPCookieStorageRef> cookieStorage = currentCFHTTPCookieStorage();
+    RetainPtr<CFHTTPCookieStorageRef> cookieStorage = defaultCFHTTPCookieStorage();
     if (!cookieStorage)
         return;
 
@@ -234,7 +234,7 @@ void getHostnamesWithCookies(HashSet<String>& hostnames)
 
 void deleteCookiesForHostname(const String& hostname)
 {
-    RetainPtr<CFHTTPCookieStorageRef> cookieStorage = currentCFHTTPCookieStorage();
+    RetainPtr<CFHTTPCookieStorageRef> cookieStorage = defaultCFHTTPCookieStorage();
     if (!cookieStorage)
         return;
 
@@ -253,7 +253,7 @@ void deleteCookiesForHostname(const String& hostname)
 
 void deleteAllCookies()
 {
-    RetainPtr<CFHTTPCookieStorageRef> cookieStorage = currentCFHTTPCookieStorage();
+    RetainPtr<CFHTTPCookieStorageRef> cookieStorage = defaultCFHTTPCookieStorage();
     if (!cookieStorage)
         return;
 
index efa825d..b4fbecd 100644 (file)
@@ -69,7 +69,25 @@ RetainPtr<CFHTTPCookieStorageRef> currentCFHTTPCookieStorage()
 #if USE(CFNETWORK)
     return wkGetDefaultHTTPCookieStorage();
 #else
-    // When using NSURLConnection, we also use its default cookie storage.
+    // When using NSURLConnection, we also use its shared cookie storage.
+    return 0;
+#endif
+}
+
+RetainPtr<CFHTTPCookieStorageRef> defaultCFHTTPCookieStorage()
+{
+#if PLATFORM(WIN)
+    if (RetainPtr<CFHTTPCookieStorageRef>& override = cookieStorageOverride())
+        return override;
+#endif
+
+    if (CFURLStorageSessionRef session = ResourceHandle::defaultStorageSession())
+        return RetainPtr<CFHTTPCookieStorageRef>(AdoptCF, wkCopyHTTPCookieStorage(session));
+
+#if USE(CFNETWORK)
+    return wkGetDefaultHTTPCookieStorage();
+#else
+    // When using NSURLConnection, we also use its shared cookie storage.
     return 0;
 #endif
 }
@@ -115,7 +133,7 @@ void startObservingCookieChanges()
     CFRunLoopRef runLoop = cookieStorageObserverRunLoop();
     ASSERT(runLoop);
 
-    RetainPtr<CFHTTPCookieStorageRef> cookieStorage = currentCFHTTPCookieStorage();
+    RetainPtr<CFHTTPCookieStorageRef> cookieStorage = defaultCFHTTPCookieStorage();
     ASSERT(cookieStorage);
 
     CFHTTPCookieStorageScheduleWithRunLoop(cookieStorage.get(), runLoop, kCFRunLoopCommonModes);
@@ -129,7 +147,7 @@ void stopObservingCookieChanges()
     CFRunLoopRef runLoop = cookieStorageObserverRunLoop();
     ASSERT(runLoop);
 
-    RetainPtr<CFHTTPCookieStorageRef> cookieStorage = currentCFHTTPCookieStorage();
+    RetainPtr<CFHTTPCookieStorageRef> cookieStorage = defaultCFHTTPCookieStorage();
     ASSERT(cookieStorage);
 
     CFHTTPCookieStorageRemoveObserver(cookieStorage.get(), runLoop, kCFRunLoopDefaultMode, notifyCookiesChanged, 0);
index 68dbc67..fcf8dea 100644 (file)
@@ -33,6 +33,7 @@ typedef struct OpaqueCFHTTPCookieStorage*  CFHTTPCookieStorageRef;
 namespace WebCore {
 
 RetainPtr<CFHTTPCookieStorageRef> currentCFHTTPCookieStorage(); // Will be null when using shared NSHTTPCookieStorage.
+RetainPtr<CFHTTPCookieStorageRef> defaultCFHTTPCookieStorage(); // Doesn't take current session into account.
 
 #if PLATFORM(WIN)
 // Needed for WebKit1 API only.
index 26cf452..101d634 100644 (file)
@@ -1,3 +1,13 @@
+2012-11-06  Alexey Proskuryakov  <ap@apple.com>
+
+        Clean up which storage cookie jar functions use
+        https://bugs.webkit.org/show_bug.cgi?id=101395
+
+        Reviewed by Brady Eidson.
+
+        * WebCoreSupport/WebSystemInterface.mm: (InitWebCoreSystemInterface): Updated for
+        two new functions.
+
 2012-11-06  Andrey Lushnikov  <lushnikov@google.com>
 
         Added console.clear() method
index e377db2..45cf9a1 100644 (file)
@@ -165,8 +165,10 @@ void InitWebCoreSystemInterface(void)
     INIT(CopyRequestWithStorageSession);
     INIT(CopyHTTPCookieStorage);
     INIT(GetHTTPCookieAcceptPolicy);
+    INIT(HTTPCookies);
     INIT(HTTPCookiesForURL);
     INIT(SetHTTPCookiesForURL);
+    INIT(DeleteAllHTTPCookies);
     INIT(DeleteHTTPCookie);
 
     INIT(GetCFURLResponseMIMEType);
index 2032dc0..835a99e 100644 (file)
@@ -1,3 +1,13 @@
+2012-11-06  Alexey Proskuryakov  <ap@apple.com>
+
+        Clean up which storage cookie jar functions use
+        https://bugs.webkit.org/show_bug.cgi?id=101395
+
+        Reviewed by Brady Eidson.
+
+        * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface):
+        Updated for two new functions.
+
 2012-11-06  Jihye Kang  <jye.kang@samsung.com>
 
         [EFL][WK2] Add ewk_database_manager APIs
index 73f8cbc..08db0ad 100644 (file)
@@ -116,8 +116,10 @@ void InitWebCoreSystemInterface(void)
         INIT(CopyHTTPCookieStorage);
         INIT(GetHTTPCookieAcceptPolicy);
         INIT(SetHTTPCookieAcceptPolicy);
+        INIT(HTTPCookies);
         INIT(HTTPCookiesForURL);
         INIT(SetHTTPCookiesForURL);
+        INIT(DeleteAllHTTPCookies);
         INIT(DeleteHTTPCookie);
 
         INIT(SetMetadataURL);
index 7f2811b..c171a2a 100644 (file)
@@ -1,5 +1,18 @@
 2012-11-06  Alexey Proskuryakov  <ap@apple.com>
 
+        Clean up which storage cookie jar functions use
+        https://bugs.webkit.org/show_bug.cgi?id=101395
+
+        Reviewed by Brady Eidson.
+
+        * WebKitSystemInterface.h:
+        * libWebKitSystemInterfaceLion.a:
+        * libWebKitSystemInterfaceMountainLion.a:
+        Added WKHTTPCookies() and WKDeleteAllHTTPCookies(). Updated ifdefs for currently
+        supported OS versions.
+
+2012-11-06  Alexey Proskuryakov  <ap@apple.com>
+
         Delete Leopard and Snow Leopard versions of WKSI. These have not been updated in ages.
 
         Rubber-stampted by Mark Rowe.
index 2cc6fe9..2a688cd 100644 (file)
@@ -7,6 +7,7 @@
 
 #import <Cocoa/Cocoa.h>
 #import <Carbon/Carbon.h>
+#import <dispatch/dispatch.h>
 
 @class AVAsset;
 @class QTMovie;
@@ -163,12 +164,10 @@ typedef int WKCTFontTransformOptions;
 bool WKCTFontTransformGlyphs(CTFontRef font, CGGlyph glyphs[], CGSize advances[], CFIndex count, WKCTFontTransformOptions options);
 #endif
 
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
 CTTypesetterRef WKCreateCTTypesetterWithUniCharProviderAndOptions(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
 
 CGContextRef WKIOSurfaceContextCreate(IOSurfaceRef, unsigned width, unsigned height, CGColorSpaceRef);
 CGImageRef WKIOSurfaceContextCreateImage(CGContextRef context);
-#endif
 
 typedef enum {
     WKPatternTilingNoDistortion,
@@ -237,11 +236,7 @@ NSURL *WKQTMovieResolvedURL(QTMovie* movie);
 
 CFStringRef WKCopyFoundationCacheDirectory(void);
 
-#if MAC_OS_X_VERSION_MIN_REQUIRED == 1060
-typedef struct __CFURLStorageSession* CFURLStorageSessionRef;
-#else
 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
-#endif
 CFURLStorageSessionRef WKCreatePrivateStorageSession(CFStringRef);
 NSURLRequest *WKCopyRequestWithStorageSession(CFURLStorageSessionRef, NSURLRequest*);
 NSCachedURLResponse *WKCachedResponseForRequest(CFURLStorageSessionRef, NSURLRequest*);
@@ -251,8 +246,10 @@ typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
 CFHTTPCookieStorageRef WKCopyHTTPCookieStorage(CFURLStorageSessionRef);
 unsigned WKGetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef);
 void WKSetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef, unsigned policy);
+NSArray *WKHTTPCookies(CFHTTPCookieStorageRef);
 NSArray *WKHTTPCookiesForURL(CFHTTPCookieStorageRef, NSURL *);
 void WKSetHTTPCookiesForURL(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
+void WKDeleteAllHTTPCookies(CFHTTPCookieStorageRef);
 void WKDeleteHTTPCookie(CFHTTPCookieStorageRef, NSHTTPCookie *);
 
 CFHTTPCookieStorageRef WKGetDefaultHTTPCookieStorage(void);
@@ -362,9 +359,7 @@ CALayer *WKCAContextGetLayer(WKCAContextRef);
 void WKCAContextSetColorSpace(WKCAContextRef, CGColorSpaceRef);
 CGColorSpaceRef WKCAContextGetColorSpace(WKCAContextRef);
 
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
 void WKCALayerEnumerateRectsBeingDrawnWithBlock(CALayer *layer, CGContextRef context, void (^block)(CGRect rect));
-#endif
 
 @class CARenderer;
 
@@ -400,17 +395,6 @@ void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumber
 void WKSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
 CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL);
 
-#if MAC_OS_X_VERSION_MIN_REQUIRED == 1060
-typedef enum {
-    WKEventPhaseNone = 0,
-    WKEventPhaseBegan = 1,
-    WKEventPhaseChanged = 2,
-    WKEventPhaseEnded = 3,
-} WKEventPhase;
-
-int WKGetNSEventMomentumPhase(NSEvent *);
-#endif
-
 void WKWindowSetAlpha(NSWindow *window, float alphaValue);
 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
 
@@ -428,10 +412,6 @@ NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef rep
 ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void);
 #endif
 
-#if MAC_OS_X_VERSION_MIN_REQUIRED == 1060
-CFIndex WKGetHyphenationLocationBeforeIndex(CFStringRef string, CFIndex index);
-#endif
-
 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStore(void);
 void WKCFURLCacheDeleteHostNamesInPersistentStore(CFArrayRef hostArray);    
 
@@ -443,8 +423,6 @@ void WKSetCFURLResponseMIMEType(CFURLResponseRef, CFStringRef mimeType);
 
 CIFormat WKCIGetRGBA8Format(void);
 
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
-
 typedef enum {
     WKSandboxExtensionTypeReadOnly,
     WKSandboxExtensionTypeWriteOnly,    
@@ -481,28 +459,16 @@ NSURL* WKAVAssetResolvedURL(AVAsset*);
 
 NSCursor *WKCursor(const char *name);
 
-#endif
-
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
-
-#import <dispatch/dispatch.h>
-
 dispatch_source_t WKCreateVMPressureDispatchOnMainQueue(void);
 
-#endif
-
 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
 NSString *WKGetMacOSXVersionString(void);
 bool WKExecutableWasLinkedOnOrBeforeLion(void);
 #endif
 
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
 void WKCGPathAddRoundedRect(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight);
-#endif
 
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
 void WKCFURLRequestAllowAllPostCaching(CFURLRequestRef);
-#endif
 
 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
 @class WebFilterEvaluator;
@@ -519,10 +485,8 @@ CGFloat WKNSElasticDeltaForReboundDelta(CGFloat delta);
 CGFloat WKNSReboundDeltaForElasticDelta(CGFloat delta);
 #endif
 
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
 Boolean WKJLIsRuntimeAndWebComponentsInstalled(void);
 void WKJLReportWebComponentsUsed(void);
-#endif
 
 typedef enum {
     WKCaptionFontStyleDefault = 0,
index 923d624..b34f117 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLion.a and b/WebKitLibraries/libWebKitSystemInterfaceLion.a differ
index 5f7e9ba..01aac27 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceMountainLion.a and b/WebKitLibraries/libWebKitSystemInterfaceMountainLion.a differ