Use the Cookie Storage from the Private Browsing Storage Session directly
authorjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Mar 2011 16:41:43 +0000 (16:41 +0000)
committerjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Mar 2011 16:41:43 +0000 (16:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=55986

Reviewed by Adam Roben.

Source/WebCore:

* WebCore.exp.in:
* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:

* platform/network/mac/CookieStorageMac.mm:
(WebCore::setCookieStoragePrivateBrowsingEnabled):
Just copy the cookie storage from the private browsing storage session.
* platform/network/cf/CookieStorageCFNet.cpp:
(WebCore::setCookieStoragePrivateBrowsingEnabled):
Ditto.

Source/WebKit/mac:

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

Source/WebKit2:

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

WebKitLibraries:

* WebKitSystemInterface.h:
* libWebKitSystemInterfaceLeopard.a:
* libWebKitSystemInterfaceSnowLeopard.a:
* win/include/WebKitSystemInterface/WebKitSystemInterface.h:
* win/lib/WebKitSystemInterface.lib:

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

16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/mac/WebCoreSystemInterface.h
Source/WebCore/platform/mac/WebCoreSystemInterface.mm
Source/WebCore/platform/network/cf/CookieStorageCFNet.cpp
Source/WebCore/platform/network/mac/CookieStorageMac.mm
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/libWebKitSystemInterfaceLeopard.a
WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h
WebKitLibraries/win/lib/WebKitSystemInterface.lib

index 443807e..af33c69 100644 (file)
@@ -1,3 +1,21 @@
+2011-03-09  Jessie Berlin  <jberlin@apple.com>
+
+        Reviewed by Adam Roben.
+
+        Use the Cookie Storage from the Private Browsing Storage Session directly
+        https://bugs.webkit.org/show_bug.cgi?id=55986
+
+        * WebCore.exp.in:
+        * platform/mac/WebCoreSystemInterface.h:
+        * platform/mac/WebCoreSystemInterface.mm:
+
+        * platform/network/mac/CookieStorageMac.mm:
+        (WebCore::setCookieStoragePrivateBrowsingEnabled):
+        Just copy the cookie storage from the private browsing storage session.
+        * platform/network/cf/CookieStorageCFNet.cpp:
+        (WebCore::setCookieStoragePrivateBrowsingEnabled):
+        Ditto.
+
 2011-03-09  Andrey Kosyakov  <caseq@chromium.org>
 
         Unreviewed. Fixed a crash in InspectorInstrumentation::didReceiveResponse() when loader is null (broken in r80639)
index 26dde2d..5fc6a2d 100644 (file)
@@ -1340,7 +1340,7 @@ _wkSignalCFReadStreamError
 _wkSignalCFReadStreamHasBytes
 _wkCreatePrivateStorageSession
 _wkCopyRequestWithStorageSession
-_wkCreatePrivateInMemoryHTTPCookieStorage
+_wkCopyHTTPCookieStorage
 _wkGetHTTPCookieAcceptPolicy
 _wkHTTPCookiesForURL
 _wkSetHTTPCookiesForURL
index df65ff2..ae3ca65 100644 (file)
@@ -244,7 +244,7 @@ extern CFURLStorageSessionRef (*wkCreatePrivateStorageSession)(CFStringRef);
 extern NSURLRequest* (*wkCopyRequestWithStorageSession)(CFURLStorageSessionRef, NSURLRequest*);
 
 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
-extern CFHTTPCookieStorageRef (*wkCreatePrivateInMemoryHTTPCookieStorage)(CFURLStorageSessionRef);
+extern CFHTTPCookieStorageRef (*wkCopyHTTPCookieStorage)(CFURLStorageSessionRef);
 extern unsigned (*wkGetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef);
 extern NSArray *(*wkHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSURL *);
 extern void (*wkSetHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
index 50ac236..375ee5a 100644 (file)
@@ -174,7 +174,7 @@ AXUIElementRef (*wkCreateAXUIElementRef)(id element);
 
 CFURLStorageSessionRef (*wkCreatePrivateStorageSession)(CFStringRef);
 NSURLRequest* (*wkCopyRequestWithStorageSession)(CFURLStorageSessionRef, NSURLRequest*);
-CFHTTPCookieStorageRef (*wkCreatePrivateInMemoryHTTPCookieStorage)(CFURLStorageSessionRef);
+CFHTTPCookieStorageRef (*wkCopyHTTPCookieStorage)(CFURLStorageSessionRef);
 unsigned (*wkGetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef);
 NSArray *(*wkHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSURL *);
 void (*wkSetHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
index c2a5691..e955081 100644 (file)
@@ -74,10 +74,11 @@ void setCookieStoragePrivateBrowsingEnabled(bool enabled)
     }
 
 #if USE(CFURLSTORAGESESSIONS)
-    privateBrowsingCookieStorage().adoptCF(wkCreatePrivateInMemoryHTTPCookieStorage(ResourceHandle::privateBrowsingStorageSession()));
-#else
-    privateBrowsingCookieStorage().adoptCF(wkCreatePrivateInMemoryHTTPCookieStorage(0));
+    if (CFURLStorageSessionRef privateStorageSession = ResourceHandle::privateBrowsingStorageSession())
+        privateBrowsingCookieStorage().adoptCF(wkCopyHTTPCookieStorage(privateStorageSession));
+    else
 #endif
+        privateBrowsingCookieStorage().adoptCF(wkCreateInMemoryHTTPCookieStorage());
 }
 
 static void notifyCookiesChangedOnMainThread(void* context)
index db64aae..bc17a98 100644 (file)
@@ -92,7 +92,7 @@ void setCookieStoragePrivateBrowsingEnabled(bool enabled)
         return;
 
     if (enabled && ResourceHandle::privateBrowsingStorageSession()) {
-        privateBrowsingCookieStorage().adoptCF(wkCreatePrivateInMemoryHTTPCookieStorage(ResourceHandle::privateBrowsingStorageSession()));
+        privateBrowsingCookieStorage().adoptCF(wkCopyHTTPCookieStorage(ResourceHandle::privateBrowsingStorageSession()));
 
         // FIXME: When Private Browsing is enabled, the Private Browsing Cookie Storage should be
         // observed for changes, not the default Cookie Storage.
index aa7b503..7c0d858 100644 (file)
@@ -1,3 +1,13 @@
+2011-03-09  Jessie Berlin  <jberlin@apple.com>
+
+        Reviewed by Adam Roben.
+
+        Use the Cookie Storage from the Private Browsing Storage Session directly
+        https://bugs.webkit.org/show_bug.cgi?id=55986
+
+        * WebCoreSupport/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface):
+
 2011-03-08  Darin Adler  <darin@apple.com>
 
         Reviewed by Timothy Hatcher.
index 6504f17..bbfc416 100644 (file)
@@ -168,7 +168,7 @@ void InitWebCoreSystemInterface(void)
     INIT(UnregisterUniqueIdForElement);
     INIT(CreatePrivateStorageSession);
     INIT(CopyRequestWithStorageSession);
-    INIT(CreatePrivateInMemoryHTTPCookieStorage);
+    INIT(CopyHTTPCookieStorage);
     INIT(GetHTTPCookieAcceptPolicy);
     INIT(HTTPCookiesForURL);
     INIT(SetHTTPCookiesForURL);
index 102acb1..97b4276 100644 (file)
@@ -1,3 +1,13 @@
+2011-03-09  Jessie Berlin  <jberlin@apple.com>
+
+        Reviewed by Adam Roben.
+
+        Use the Cookie Storage from the Private Browsing Storage Session directly
+        https://bugs.webkit.org/show_bug.cgi?id=55986
+
+        * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface):
+
 2011-03-09  Alejandro G. Castro  <alex@igalia.com>
 
         Fix compilation after r80596, add soup Download stubs.
index 2c8649e..3c817e7 100644 (file)
@@ -95,7 +95,7 @@ void InitWebCoreSystemInterface(void)
         INIT(SignalCFReadStreamHasBytes);
         INIT(CreatePrivateStorageSession);
         INIT(CopyRequestWithStorageSession);
-        INIT(CreatePrivateInMemoryHTTPCookieStorage);
+        INIT(CopyHTTPCookieStorage);
         INIT(GetHTTPCookieAcceptPolicy);
         INIT(HTTPCookiesForURL);
         INIT(SetHTTPCookiesForURL);
index 9a9517b..40865cb 100644 (file)
@@ -1,3 +1,16 @@
+2011-03-09  Jessie Berlin  <jberlin@apple.com>
+
+        Reviewed by Adam Roben.
+
+        Use the Cookie Storage from the Private Browsing Storage Session directly
+        https://bugs.webkit.org/show_bug.cgi?id=55986
+
+        * WebKitSystemInterface.h:
+        * libWebKitSystemInterfaceLeopard.a:
+        * libWebKitSystemInterfaceSnowLeopard.a:
+        * win/include/WebKitSystemInterface/WebKitSystemInterface.h:
+        * win/lib/WebKitSystemInterface.lib:
+
 2011-03-07  Steve Falkenburg  <sfalken@apple.com>
 
         Bump version.
index 4d6703c..3813cbb 100644 (file)
@@ -239,7 +239,7 @@ NSURLRequest *WKCopyRequestWithStorageSession(CFURLStorageSessionRef, NSURLReque
 NSCachedURLResponse *WKCachedResponseForRequest(CFURLStorageSessionRef, NSURLRequest*);
 
 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
-CFHTTPCookieStorageRef WKCreatePrivateInMemoryHTTPCookieStorage(CFURLStorageSessionRef);
+CFHTTPCookieStorageRef WKCopyHTTPCookieStorage(CFURLStorageSessionRef);
 unsigned WKGetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef);
 NSArray *WKHTTPCookiesForURL(CFHTTPCookieStorageRef, NSURL *);
 void WKSetHTTPCookiesForURL(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
index d52ce7f..dbb4658 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a differ
index e54b844..dee1994 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a differ
index 5d17561..80f97c3 100644 (file)
@@ -89,7 +89,7 @@ CFDictionaryRef wkGetSSLCertificateInfo(CFURLResponseRef);
 void* wkGetSSLPeerCertificateData(CFDictionaryRef);
 void* wkGetSSLCertificateChainContext(CFDictionaryRef);
 CFHTTPCookieStorageRef wkGetDefaultHTTPCookieStorage();
-CFHTTPCookieStorageRef wkCreatePrivateInMemoryHTTPCookieStorage(CFURLStorageSessionRef);
+CFHTTPCookieStorageRef wkCreateInMemoryHTTPCookieStorage();
 void wkSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool);
 CFStringRef wkCopyFoundationCacheDirectory();
 void wkSetClientCertificateInSSLProperties(CFMutableDictionaryRef, CFDataRef);
@@ -100,6 +100,7 @@ void wkCFURLRequestSetHTTPRequestBodyParts(CFMutableURLRequestRef, CFArrayRef bo
 CFURLStorageSessionRef wkCreatePrivateStorageSession(CFStringRef identifier);
 void wkSetRequestStorageSession(CFURLStorageSessionRef, CFMutableURLRequestRef);
 CFURLCacheRef wkCopyURLCache(CFURLStorageSessionRef);
+CFHTTPCookieStorageRef wkCopyHTTPCookieStorage(CFURLStorageSessionRef);
 
 CFArrayRef wkCFURLCacheCopyAllHostNamesInPersistentStore();
 void wkCFURLCacheDeleteHostNamesInPersistentStore(CFArrayRef hostNames);
index c6fe998..532555d 100644 (file)
Binary files a/WebKitLibraries/win/lib/WebKitSystemInterface.lib and b/WebKitLibraries/win/lib/WebKitSystemInterface.lib differ