Source/WebCore: [WebKit2] Changing the cookie accept policy in Private Browsing doesn...
authorjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Jul 2011 23:22:21 +0000 (23:22 +0000)
committerjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Jul 2011 23:22:21 +0000 (23:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=64997

Reviewed by Ada Chan.

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

Source/WebKit2: [WebKit2] Changing the cookie accept policy in Private Browsing doesn’t work.
https://bugs.webkit.org/show_bug.cgi?id=64997

Reviewed by Ada Chan.

* WebProcess/Cookies/mac/WebCookieManagerMac.mm:
(WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
Set the policy on the Cookie Storage used by the Private Browsing Storage Session as well.
* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

WebKitLibraries: [WebKit2] Changing the cookie accept policy in Private Browsing doesn’t work.
https://bugs.webkit.org/show_bug.cgi?id=64997

Reviewed by Ada Chan.

Add a wrapper around the setter for the CF HTTP cookie accept policy (since it is not
declared in the public headers on Snow Leopard). This wrapper is not necessary for Windows.

* WebKitSystemInterface.h:
* libWebKitSystemInterfaceLeopard.a:
* libWebKitSystemInterfaceLion.a:
* libWebKitSystemInterfaceSnowLeopard.a:

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

12 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/mac/WebCoreSystemInterface.h
Source/WebCore/platform/mac/WebCoreSystemInterface.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Cookies/mac/WebCookieManagerMac.mm
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitSystemInterface.h
WebKitLibraries/libWebKitSystemInterfaceLeopard.a
WebKitLibraries/libWebKitSystemInterfaceLion.a
WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a

index 1f9b71c..d89d19c 100644 (file)
@@ -1,3 +1,14 @@
+2011-07-22  Jessie Berlin  <jberlin@apple.com>
+
+        [WebKit2] Changing the cookie accept policy in Private Browsing doesn’t work
+        https://bugs.webkit.org/show_bug.cgi?id=64997
+
+        Reviewed by Ada Chan.
+
+        * WebCore.exp.in:
+        * platform/mac/WebCoreSystemInterface.h:
+        * platform/mac/WebCoreSystemInterface.mm:
+
 2011-07-22  Sergey Glazunov  <serg.glazunov@gmail.com>
 
         Perform the JavaScript navigation check on a complete URL
index 63e333d..a496881 100644 (file)
@@ -1411,6 +1411,7 @@ _wkSetCONNECTProxyAuthorizationForStream
 _wkSetCONNECTProxyForStream
 _wkSetCookieStoragePrivateBrowsingEnabled
 _wkSetDragImage
+_wkSetHTTPCookieAcceptPolicy
 _wkSetHTTPCookiesForURL
 _wkSetHTTPPipeliningMaximumPriority
 _wkSetHTTPPipeliningMinimumFastLanePriority
index dc9da9b..755286c 100644 (file)
@@ -329,6 +329,7 @@ extern NSURLRequest* (*wkCopyRequestWithStorageSession)(CFURLStorageSessionRef,
 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
 extern CFHTTPCookieStorageRef (*wkCopyHTTPCookieStorage)(CFURLStorageSessionRef);
 extern unsigned (*wkGetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef);
+extern void (*wkSetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef, unsigned);
 extern NSArray *(*wkHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSURL *);
 extern void (*wkSetHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
 extern void (*wkDeleteHTTPCookie)(CFHTTPCookieStorageRef, NSHTTPCookie *);
index 1c828fb..94e97bc 100644 (file)
@@ -196,6 +196,7 @@ CFURLStorageSessionRef (*wkCreatePrivateStorageSession)(CFStringRef);
 NSURLRequest* (*wkCopyRequestWithStorageSession)(CFURLStorageSessionRef, NSURLRequest*);
 CFHTTPCookieStorageRef (*wkCopyHTTPCookieStorage)(CFURLStorageSessionRef);
 unsigned (*wkGetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef);
+void (*wkSetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef, unsigned);
 NSArray *(*wkHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSURL *);
 void (*wkSetHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
 void (*wkDeleteHTTPCookie)(CFHTTPCookieStorageRef, NSHTTPCookie *);
index 7e557bf..a47c3ac 100644 (file)
@@ -1,3 +1,16 @@
+2011-07-22  Jessie Berlin  <jberlin@apple.com>
+
+        [WebKit2] Changing the cookie accept policy in Private Browsing doesn’t work.
+        https://bugs.webkit.org/show_bug.cgi?id=64997
+
+        Reviewed by Ada Chan.
+
+        * WebProcess/Cookies/mac/WebCookieManagerMac.mm:
+        (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
+        Set the policy on the Cookie Storage used by the Private Browsing Storage Session as well.
+        * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface):
+
 2011-07-21  Yael Aharon  <yael.aharon@nokia.com>
 
         [Qt][WK2] Code cleanup for drag-and-drop
index cf73622..b18c98a 100644 (file)
@@ -25,6 +25,8 @@
 
 #import "config.h"
 #import "WebCookieManager.h"
+#import <WebCore/ResourceHandle.h>
+#import <WebKitSystemInterface.h>
 
 namespace WebKit {
 
@@ -33,7 +35,10 @@ void WebCookieManager::platformSetHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy
     [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:policy];
 
 #if USE(CFURLSTORAGESESSIONS)
-    // FIXME: Also update the Private Browsing Storage Session's cookie storage.
+    if (CFURLStorageSessionRef privateBrowsingStorageSession = WebCore::ResourceHandle::privateBrowsingStorageSession()) {
+        RetainPtr<CFHTTPCookieStorageRef> cookieStorage(AdoptCF, WKCopyHTTPCookieStorage(privateBrowsingStorageSession));
+        WKSetHTTPCookieAcceptPolicy(cookieStorage.get(), policy);
+    }
 #endif
 }
 
index 5cf81e9..5a8f54d 100644 (file)
@@ -103,6 +103,7 @@ void InitWebCoreSystemInterface(void)
         INIT(CopyRequestWithStorageSession);
         INIT(CopyHTTPCookieStorage);
         INIT(GetHTTPCookieAcceptPolicy);
+        INIT(SetHTTPCookieAcceptPolicy);
         INIT(HTTPCookiesForURL);
         INIT(SetHTTPCookiesForURL);
         INIT(DeleteHTTPCookie);
index 7f5ef33..8cbf067 100644 (file)
@@ -1,3 +1,18 @@
+2011-07-22  Jessie Berlin  <jberlin@apple.com>
+
+        [WebKit2] Changing the cookie accept policy in Private Browsing doesn’t work.
+        https://bugs.webkit.org/show_bug.cgi?id=64997
+
+        Reviewed by Ada Chan.
+
+        Add a wrapper around the setter for the CF HTTP cookie accept policy (since it is not
+        declared in the public headers on Snow Leopard). This wrapper is not necessary for Windows.
+
+        * WebKitSystemInterface.h:
+        * libWebKitSystemInterfaceLeopard.a:
+        * libWebKitSystemInterfaceLion.a:
+        * libWebKitSystemInterfaceSnowLeopard.a:
+
 2011-07-15  Pratik Solanki  <psolanki@apple.com>
 
         Part of https://bugs.webkit.org/show_bug.cgi?id=63674
index 16de2d3..8317b37 100644 (file)
@@ -229,6 +229,7 @@ void WKSetRequestStorageSession(CFURLStorageSessionRef, CFMutableURLRequestRef);
 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
 CFHTTPCookieStorageRef WKCopyHTTPCookieStorage(CFURLStorageSessionRef);
 unsigned WKGetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef);
+void WKSetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef, unsigned policy);
 NSArray *WKHTTPCookiesForURL(CFHTTPCookieStorageRef, NSURL *);
 void WKSetHTTPCookiesForURL(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
 void WKDeleteHTTPCookie(CFHTTPCookieStorageRef, NSHTTPCookie *);
index f15626e..93aff72 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a differ
index 4796b38..9802e44 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLion.a and b/WebKitLibraries/libWebKitSystemInterfaceLion.a differ
index f7426d1..3b674bf 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a differ