Source/JavaScriptCore: WebKit2: Use CFNetwork Sessions API.
authorjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Mar 2011 00:07:15 +0000 (00:07 +0000)
committerjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Mar 2011 00:07:15 +0000 (00:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=55435

Reviewed by Adam Roben.

Add the ability to create a Private Browsing storage session.

* wtf/Platform.h:
Add a new #define for using CF Storage Sessions.

Source/WebCore: WebKit2: Use CFNetwork Sessions API.
https://bugs.webkit.org/show_bug.cgi?id=55435

Reviewed by Adam Roben.

Add the ability to create a Private Browsing Storage Session.

* WebCore.exp.in:
Export the symbol for ResourceHandle::setPrivateBrowsingStorageSessionIdentifierBase.

* page/Settings.cpp:
(WebCore::Settings::setPrivateBrowsingEnabled):
Propagate the private browsing state to the ResourceHandle.

* platform/mac/WebCoreSystemInterface.h:
Add the function declaration for wkCreatePrivateStorageSession.
* platform/mac/WebCoreSystemInterface.mm:

* platform/network/ResourceHandle.cpp:
(WebCore::privateStorageSession):
Since the same Private Browsing Storage Session will need to be accessed throughout the loading
code and will need to be used by all web pages and page groups, make it a global static.
(WebCore::privateBrowsingStorageSessionIdentifierBase):
Ditto, since the identifier is needed to create the Private Browsing Storage Session.
(WebCore::ResourceHandle::setPrivateBrowsingEnabled):
If enabled, create and store the Private Browsing Storage Session.
(WebCore::ResourceHandle::privateBrowsingStorageSession):
(WebCore::ResourceHandle::setPrivateBrowsingStorageSessionIdentifierBase):
* platform/network/ResourceHandle.h:

* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::createPrivateBrowsingStorageSession):
The call to wkCreatePrivateStorageSession needs to be in a file including the correct
version of WKSI.
(WebCore::ResourceHandle::privateBrowsingStorageSessionIdentifierDefaultBase):
Return the bundle identifier.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::createPrivateBrowsingStorageSession):
The call to wkCreatePrivateStorageSession needs to be in a file importing the correct
version of WKSI.
(WebCore::ResourceHandle::privateBrowsingStorageSessionIdentifierDefaultBase):
Return the bundle identifier.

Source/WebKit/mac: WebKit2: Use CFNetwork Sessions API.
https://bugs.webkit.org/show_bug.cgi?id=55435.

Reviewed by Adam Roben.

Add the ability to create a Private Browsing Storage Session.

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface):
Support calling wkCreatePrivateStorageSession from WebCore.

Source/WebKit2: WebKit2: Use CFNetwork Sessions API.
https://bugs.webkit.org/show_bug.cgi?id=55435

Reviewed by Adam Roben.

Add the ability to create a Private Browsing Storage Session.

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
Encode the UI Process bundle identifier.
(WebKit::WebProcessCreationParameters::decode):
Decode the UI Process bundle identifier.
* Shared/WebProcessCreationParameters.h:

* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::platformInitializeWebProcess):
Grab the bundle identifier and use it to set the WebProcessCreationParameter.
* UIProcess/win/WebContextWin.cpp:
(WebKit::WebContext::platformInitializeWebProcess):
Ditto.

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface):
Support using the wkCreatePrivateStorageSession WKSI in WebCore.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
Set the base for the Private Browsing Storage Session identifier to be the bundle identifier
from the UI Process so that WebKit1 would create a Private Browsing Storage Session with the
same identifier as WebKit2.

WebKitLibraries: WebKit2: Use CFNetwork Sessions API.
https://bugs.webkit.org/show_bug.cgi?id=55435

Rubber-stamped by Adam Roben.

Add the ability to create a Private Browsing Storage Session.

Update WebKitSystemInterface headers and libraries with the new functions.

* 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@80180 268f45cc-cd09-0410-ab3c-d52691b4dbfc

26 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/wtf/Platform.h
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/page/Settings.cpp
Source/WebCore/platform/mac/WebCoreSystemInterface.h
Source/WebCore/platform/mac/WebCoreSystemInterface.mm
Source/WebCore/platform/network/ResourceHandle.cpp
Source/WebCore/platform/network/ResourceHandle.h
Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
Source/WebCore/platform/network/mac/ResourceHandleMac.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebProcessCreationParameters.cpp
Source/WebKit2/Shared/WebProcessCreationParameters.h
Source/WebKit2/UIProcess/mac/WebContextMac.mm
Source/WebKit2/UIProcess/win/WebContextWin.cpp
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
Source/WebKit2/WebProcess/WebProcess.cpp
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitSystemInterface.h
WebKitLibraries/libWebKitSystemInterfaceLeopard.a
WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h
WebKitLibraries/win/lib/WebKitSystemInterface.lib

index 5a2d2b758694b17cf19723cb368c04e418df086d..0e4018a539a673bc83357bfa623a83f6079df515 100644 (file)
@@ -1,3 +1,15 @@
+2011-03-02  Jessie Berlin  <jberlin@apple.com>
+
+        Reviewed by Adam Roben.
+
+        WebKit2: Use CFNetwork Sessions API.
+        https://bugs.webkit.org/show_bug.cgi?id=55435
+
+        Add the ability to create a Private Browsing storage session.
+
+        * wtf/Platform.h:
+        Add a new #define for using CF Storage Sessions.
+
 2011-03-02  Oliver Hunt  <oliver@apple.com>
 
         Reviewed by Gavin Barraclough.
index 95689ab042494bc8acde0ddf84ac38d9b5ea100b..95f6cf53dc229d92c65a1b6ce1ea5db7de786fcc 100644 (file)
 
 #if USE(CFNETWORK) || PLATFORM(MAC)
 #define WTF_USE_CFURLCACHE 1
+#define WTF_USE_CFURLSTORAGESESSIONS 1
 #endif
 
 #if PLATFORM(WIN) && !OS(WINCE) && !PLATFORM(CHROMIUM) && !PLATFORM(QT)
index e60a1d9dc8b20d7d182f26abccdfa28757317959..d11868e3399a92dcc86752cd0ac0506fc67e1333 100644 (file)
@@ -1,3 +1,48 @@
+2011-03-02  Jessie Berlin  <jberlin@apple.com>
+
+        Reviewed by Adam Roben.
+
+        WebKit2: Use CFNetwork Sessions API.
+        https://bugs.webkit.org/show_bug.cgi?id=55435
+
+        Add the ability to create a Private Browsing Storage Session.
+
+        * WebCore.exp.in:
+        Export the symbol for ResourceHandle::setPrivateBrowsingStorageSessionIdentifierBase.
+
+        * page/Settings.cpp:
+        (WebCore::Settings::setPrivateBrowsingEnabled):
+        Propagate the private browsing state to the ResourceHandle.
+
+        * platform/mac/WebCoreSystemInterface.h:
+        Add the function declaration for wkCreatePrivateStorageSession.
+        * platform/mac/WebCoreSystemInterface.mm:
+
+        * platform/network/ResourceHandle.cpp:
+        (WebCore::privateStorageSession):
+        Since the same Private Browsing Storage Session will need to be accessed throughout the loading
+        code and will need to be used by all web pages and page groups, make it a global static.
+        (WebCore::privateBrowsingStorageSessionIdentifierBase):
+        Ditto, since the identifier is needed to create the Private Browsing Storage Session.
+        (WebCore::ResourceHandle::setPrivateBrowsingEnabled):
+        If enabled, create and store the Private Browsing Storage Session.
+        (WebCore::ResourceHandle::privateBrowsingStorageSession):
+        (WebCore::ResourceHandle::setPrivateBrowsingStorageSessionIdentifierBase):
+        * platform/network/ResourceHandle.h:
+
+        * platform/network/cf/ResourceHandleCFNet.cpp:
+        (WebCore::ResourceHandle::createPrivateBrowsingStorageSession):
+        The call to wkCreatePrivateStorageSession needs to be in a file including the correct
+        version of WKSI.
+        (WebCore::ResourceHandle::privateBrowsingStorageSessionIdentifierDefaultBase):
+        Return the bundle identifier.
+        * platform/network/mac/ResourceHandleMac.mm:
+        (WebCore::ResourceHandle::createPrivateBrowsingStorageSession):
+        The call to wkCreatePrivateStorageSession needs to be in a file importing the correct
+        version of WKSI.
+        (WebCore::ResourceHandle::privateBrowsingStorageSessionIdentifierDefaultBase):
+        Return the bundle identifier.
+
 2011-03-02  Daniel Cheng  <dcheng@chromium.org>
 
         Revert frame-specific WebClipboard changes
index 4f7c0fe085ccf138d9d5a7c47e6ea5737b7cd67a..40f16ce98ced224fa684a7508640be4e85b5d800 100644 (file)
@@ -1333,6 +1333,7 @@ _wkSetUpFontCache
 _wkSignalCFReadStreamEnd
 _wkSignalCFReadStreamError
 _wkSignalCFReadStreamHasBytes
+_wkCreatePrivateStorageSession
 
 #if !defined(NDEBUG)
 __ZN7WebCore20LogNotYetImplementedE
@@ -1781,3 +1782,7 @@ __ZN7WebCore6Editor14capitalizeWordEv
 #if ENABLE(GESTURE_EVENTS)
 __ZN7WebCore12EventHandler18handleGestureEventERKNS_20PlatformGestureEventE
 #endif
+
+#if USE(CFURLSTORAGESESSIONS)
+__ZN7WebCore14ResourceHandle46setPrivateBrowsingStorageSessionIdentifierBaseERKN3WTF6StringE
+#endif
index c6ca2490f1eb2a5c9bd0996427e7eb57057bafd9..fe8f8aeb4ac584fa6e07b2b4c290b597b823a410 100644 (file)
@@ -37,6 +37,7 @@
 #include "HistoryItem.h"
 #include "Page.h"
 #include "PageCache.h"
+#include "ResourceHandle.h"
 #include "StorageMap.h"
 #include <limits>
 
@@ -337,6 +338,10 @@ void Settings::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
     if (m_privateBrowsingEnabled == privateBrowsingEnabled)
         return;
 
+#if USE(CFURLSTORAGESESSIONS)
+    ResourceHandle::setPrivateBrowsingEnabled(privateBrowsingEnabled);
+#endif
+
     // FIXME: We can only enable cookie private browsing mode globally, so it's misleading to have it as a per-page setting.
     setCookieStoragePrivateBrowsingEnabled(privateBrowsingEnabled);
 
index e6d6cf655018c9cbb3810ce52f706d3d0f15ef66..e51e15d3c295b1e27f200ca90cc0bae52e69ae2c 100644 (file)
@@ -235,6 +235,9 @@ extern CFTypeRef (*wkCreateAXTextMarker)(const void *bytes, size_t len);
 extern BOOL (*wkGetBytesFromAXTextMarker)(CFTypeRef textMarker, void *bytes, size_t length);
 extern AXUIElementRef (*wkCreateAXUIElementRef)(id element);
 
+typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
+extern CFURLStorageSessionRef (*wkCreatePrivateStorageSession)(CFStringRef);
+
 }
 
 #endif
index 24bdcb1754c69e0e776a4e37c91b2cac5b560ae8..ce8fa5ed02ea5e4a1af8abf792b1dffb23f39dcf 100644 (file)
@@ -172,3 +172,5 @@ CFTypeRef (*wkCreateAXTextMarker)(const void *bytes, size_t len);
 BOOL (*wkGetBytesFromAXTextMarker)(CFTypeRef textMarker, void *bytes, size_t length);
 AXUIElementRef (*wkCreateAXUIElementRef)(id element);
 
+CFURLStorageSessionRef (*wkCreatePrivateStorageSession)(CFStringRef);
+
index 9910ac1c53974b38c9e057351133268e9fa5499f..d9019848460cf75488255d01f451c7878e9a8146 100644 (file)
@@ -33,6 +33,7 @@
 #include "ResourceHandleClient.h"
 #include "Timer.h"
 #include <algorithm>
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
@@ -185,4 +186,46 @@ void ResourceHandle::cacheMetadata(const ResourceResponse&, const Vector<char>&)
     // Optionally implemented by platform.
 }
 
+#if USE(CFURLSTORAGESESSIONS)
+
+static RetainPtr<CFURLStorageSessionRef>& privateStorageSession()
+{
+    DEFINE_STATIC_LOCAL(RetainPtr<CFURLStorageSessionRef>, storageSession, ());
+    return storageSession;
+}
+
+static String& privateBrowsingStorageSessionIdentifierBase()
+{
+    DEFINE_STATIC_LOCAL(String, base, ());
+    return base;
+}
+
+void ResourceHandle::setPrivateBrowsingEnabled(bool enabled)
+{
+    if (!enabled) {
+        privateStorageSession() = nullptr;
+        return;
+    }
+
+    if (privateStorageSession())
+        return;
+
+    String base = privateBrowsingStorageSessionIdentifierBase().isNull() ? privateBrowsingStorageSessionIdentifierDefaultBase() : privateBrowsingStorageSessionIdentifierBase();
+    RetainPtr<CFStringRef> cfIdentifier(AdoptCF, String::format("%s.PrivateBrowsing", base.utf8().data()).createCFString());
+
+    privateStorageSession() = createPrivateBrowsingStorageSession(cfIdentifier.get());
+}
+
+CFURLStorageSessionRef ResourceHandle::privateBrowsingStorageSession()
+{
+    return privateStorageSession().get();
+}
+
+void ResourceHandle::setPrivateBrowsingStorageSessionIdentifierBase(const String& identifier)
+{
+    privateBrowsingStorageSessionIdentifierBase() = identifier;
+}
+
+#endif // USE(CFURLSTORAGESESSIONS)
+
 } // namespace WebCore
index 9ad76525c73ec42bb3068a542f4ae84afee622ed..d82a9e4d759c2ea6382808d6bf0d8b183fdc17fc 100644 (file)
@@ -71,6 +71,10 @@ typedef int CFHTTPCookieStorageAcceptPolicy;
 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
 #endif
 
+#if USE(CFURLSTORAGESESSIONS)
+typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
+#endif
+
 namespace WebCore {
 
 class AuthenticationChallenge;
@@ -186,6 +190,12 @@ public:
 
     void fireFailure(Timer<ResourceHandle>*);
 
+#if USE(CFURLSTORAGESESSIONS)
+    static void setPrivateBrowsingEnabled(bool);
+    static CFURLStorageSessionRef privateBrowsingStorageSession();
+    static void setPrivateBrowsingStorageSessionIdentifierBase(const String&);
+#endif
+
     using RefCounted<ResourceHandle>::ref;
     using RefCounted<ResourceHandle>::deref;
 
@@ -214,6 +224,11 @@ private:
     void createCFURLConnection(bool shouldUseCredentialStorage, bool shouldContentSniff);
 #endif
 
+#if USE(CFURLSTORAGESESSIONS)
+    static RetainPtr<CFURLStorageSessionRef> createPrivateBrowsingStorageSession(CFStringRef identifier);
+    static String privateBrowsingStorageSessionIdentifierDefaultBase();
+#endif
+
     friend class ResourceHandleInternal;
     OwnPtr<ResourceHandleInternal> d;
 };
index 52b100f65a9c46c800119e8705fa98d7d2bc1bff..76190133229d0fc7bd4060b6756949fe8446d8ef 100644 (file)
@@ -716,6 +716,16 @@ bool ResourceHandle::willLoadFromCache(ResourceRequest& request, Frame* frame)
     return cached;
 }
 
+RetainPtr<CFURLStorageSessionRef> ResourceHandle::createPrivateBrowsingStorageSession(CFStringRef identifier)
+{
+    return RetainPtr<CFURLStorageSessionRef>(AdoptCF, wkCreatePrivateStorageSession(identifier));
+}
+
+String ResourceHandle::privateBrowsingStorageSessionIdentifierDefaultBase()
+{
+    return String(reinterpret_cast<CFStringRef>(CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle(), kCFBundleIdentifierKey)));
+}
+
 void WebCoreSynchronousLoaderClient::willSendRequest(ResourceHandle* handle, ResourceRequest& request, const ResourceResponse& /*redirectResponse*/)
 {
     // FIXME: This needs to be fixed to follow the redirect correctly even for cross-domain requests.
index 2d687c035280cdfab33e7d80b23d31f8eefb4a29..42d36af9d3335fd34113ce0cb38eed535118c244 100644 (file)
@@ -693,6 +693,16 @@ void ResourceHandle::receivedCancellation(const AuthenticationChallenge& challen
         client()->receivedCancellation(this, challenge);
 }
 
+RetainPtr<CFURLStorageSessionRef> ResourceHandle::createPrivateBrowsingStorageSession(CFStringRef identifier)
+{
+    return RetainPtr<CFURLStorageSessionRef>(AdoptCF, wkCreatePrivateStorageSession(identifier));
+}
+
+String ResourceHandle::privateBrowsingStorageSessionIdentifierDefaultBase()
+{
+    return String([[NSBundle mainBundle] bundleIdentifier]);
+}
+
 } // namespace WebCore
 
 @implementation WebCoreResourceHandleAsDelegate
index 885f723c892933f68adfd18db23479269fd05fe7..ea7267e295786e42e15673845331c209c724ec53 100644 (file)
@@ -1,3 +1,16 @@
+2011-03-02  Jessie Berlin  <jberlin@apple.com>
+
+        Reviewed by Adam Roben.
+
+        WebKit2: Use CFNetwork Sessions API.
+        https://bugs.webkit.org/show_bug.cgi?id=55435.
+
+        Add the ability to create a Private Browsing Storage Session.
+
+        * WebCoreSupport/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface):
+        Support calling wkCreatePrivateStorageSession from WebCore.
+
 2011-03-02  Daniel Cheng  <dcheng@chromium.org>
 
         Reviewed by David Levin.
index c39576b6fb34cb1db8beb1aedf63fdba86844114..c8de7cf67ccea520939ece306a66ef3a8294f4da 100644 (file)
@@ -154,6 +154,7 @@ void InitWebCoreSystemInterface(void)
     INIT(ContentAreaDidShow);
     INIT(ContentAreaDidHide);
     INIT(ScrollbarPainterUsesOverlayScrollers);
+    INIT(CreatePrivateStorageSession);
 #endif
 
     INIT(GetAXTextMarkerTypeID);
index 2eb8de26d0ad7ff3096c9696d148dd8f586726de..a875c4a741237a8dc84af31e4a969e54ddd780c9 100644 (file)
@@ -1,3 +1,36 @@
+2011-03-02  Jessie Berlin  <jberlin@apple.com>
+
+        Reviewed by Adam Roben.
+
+        WebKit2: Use CFNetwork Sessions API.
+        https://bugs.webkit.org/show_bug.cgi?id=55435
+
+        Add the ability to create a Private Browsing Storage Session.
+
+        * Shared/WebProcessCreationParameters.cpp:
+        (WebKit::WebProcessCreationParameters::encode):
+        Encode the UI Process bundle identifier.
+        (WebKit::WebProcessCreationParameters::decode):
+        Decode the UI Process bundle identifier.
+        * Shared/WebProcessCreationParameters.h:
+
+        * UIProcess/mac/WebContextMac.mm:
+        (WebKit::WebContext::platformInitializeWebProcess):
+        Grab the bundle identifier and use it to set the WebProcessCreationParameter.
+        * UIProcess/win/WebContextWin.cpp:
+        (WebKit::WebContext::platformInitializeWebProcess):
+        Ditto.
+
+        * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface):
+        Support using the wkCreatePrivateStorageSession WKSI in WebCore.
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeWebProcess):
+        Set the base for the Private Browsing Storage Session identifier to be the bundle identifier
+        from the UI Process so that WebKit1 would create a Private Browsing Storage Session with the
+        same identifier as WebKit2.
+
 2011-03-01  Brian Weinstein  <bweinstein@apple.com>
 
         Reviewed by Adam Roben.
index d4121f796dba81ece113213e80e221c4504ef30b..09b005c182c55374dee3a3a43fac14e98e94cbbe 100644 (file)
@@ -59,6 +59,9 @@ void WebProcessCreationParameters::encode(CoreIPC::ArgumentEncoder* encoder) con
     encoder->encode(languageCode);
     encoder->encode(textCheckerState);
     encoder->encode(defaultRequestTimeoutInterval);
+#if USE(CFURLSTORAGESESSIONS)
+    encoder->encode(uiProcessBundleIdentifier);
+#endif
 #if PLATFORM(MAC)
     encoder->encode(parentProcessName);
     encoder->encode(presenterApplicationPid);
@@ -105,6 +108,10 @@ bool WebProcessCreationParameters::decode(CoreIPC::ArgumentDecoder* decoder, Web
         return false;
     if (!decoder->decode(parameters.defaultRequestTimeoutInterval))
         return false;
+#if USE(CFURLSTORAGESESSIONS)
+    if (!decoder->decode(parameters.uiProcessBundleIdentifier))
+        return false;
+#endif
 
 #if PLATFORM(MAC)
     if (!decoder->decode(parameters.parentProcessName))
index 41b3e2c9822267a006a3952130a19bf6b7cb58f9..a57be99be382e1a35473fdad621370311088bd34 100644 (file)
@@ -75,6 +75,10 @@ struct WebProcessCreationParameters {
 
     double defaultRequestTimeoutInterval;
 
+#if USE(CFURLSTORAGESESSIONS)
+    String uiProcessBundleIdentifier;
+#endif
+
 #if PLATFORM(MAC)
     String parentProcessName;
 
index f91eb1c1c955bf87b38b5ddb18095eba02b69653..292d0fa72706bf2b61cea60efc6c67454d24cddc 100644 (file)
@@ -93,6 +93,8 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& para
 
     // FIXME: This should really be configurable; we shouldn't just blindly allow read access to the UI process bundle.
     parameters.uiProcessBundleResourcePath = fileSystemRepresentation([[NSBundle mainBundle] resourcePath]);
+
+    parameters.uiProcessBundleIdentifier = String([[NSBundle mainBundle] bundleIdentifier]);
 }
 
 String WebContext::platformDefaultDatabaseDirectory() const
index 04b294e2414089466f6141c91e6a6a2be02c731c..a0fdc065e0c5ec69faadfe550fbac8a60c5c67ca 100644 (file)
@@ -68,6 +68,8 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& para
     ASSERT(parameters.cfURLCachePath.length());
     if (parameters.cfURLCachePath[parameters.cfURLCachePath.length() - 1] == '/')
         parameters.cfURLCachePath.remove(parameters.cfURLCachePath.length() - 1);
+
+    parameters.uiProcessBundleIdentifier = String(reinterpret_cast<CFStringRef>(CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle(), kCFBundleIdentifierKey)));
 #endif
 }
 
index 2d74bbce117affe51f0ea91162132bc41f7a8e8a..3483b68750e95b960a520d4e15805cfa6a14b116 100644 (file)
@@ -93,6 +93,7 @@ void InitWebCoreSystemInterface(void)
         INIT(SignalCFReadStreamEnd);
         INIT(SignalCFReadStreamError);
         INIT(SignalCFReadStreamHasBytes);
+        INIT(CreatePrivateStorageSession);
 
 #if !defined(BUILDING_ON_SNOW_LEOPARD)
         INIT(IOSurfaceContextCreate);
index cfd22bf14e6a2e1c5b4c660537b4f5bfd569cac0..4cfa8b45e621759d55eab2a0e449e03516a26196 100644 (file)
@@ -58,6 +58,7 @@
 #include <WebCore/MemoryCache.h>
 #include <WebCore/Page.h>
 #include <WebCore/PageGroup.h>
+#include <WebCore/ResourceHandle.h>
 #include <WebCore/SchemeRegistry.h>
 #include <WebCore/SecurityOrigin.h>
 #include <WebCore/Settings.h>
@@ -212,6 +213,10 @@ void WebProcess::initializeWebProcess(const WebProcessCreationParameters& parame
 
     if (parameters.shouldAlwaysUseComplexTextCodePath)
         setAlwaysUsesComplexTextCodePath(true);
+
+#if USE(CFURLSTORAGESESSIONS)
+    WebCore::ResourceHandle::setPrivateBrowsingStorageSessionIdentifierBase(parameters.uiProcessBundleIdentifier);
+#endif
 }
 
 void WebProcess::setShouldTrackVisitedLinks(bool shouldTrackVisitedLinks)
index b7b11059901da690c51bb80203d776403edca8e3..01dfd08ef334a6e8afde41294e7015d3a4b24f09 100644 (file)
@@ -1,3 +1,20 @@
+2011-03-02  Jessie Berlin  <jberlin@apple.com>
+
+        Rubber-stamped by Adam Roben.
+
+        WebKit2: Use CFNetwork Sessions API.
+        https://bugs.webkit.org/show_bug.cgi?id=55435
+
+        Add the ability to create a Private Browsing Storage Session.
+
+        Update WebKitSystemInterface headers and libraries with the new functions.
+
+        * WebKitSystemInterface.h:
+        * libWebKitSystemInterfaceLeopard.a:
+        * libWebKitSystemInterfaceSnowLeopard.a:
+        * win/include/WebKitSystemInterface/WebKitSystemInterface.h:
+        * win/lib/WebKitSystemInterface.lib:
+
 2011-03-02  Daniel Cheng  <dcheng@chromium.org>
 
         Reviewed by David Levin.
index 2e631913fa69fe9809325c3545614698605527dc..bdb0dd64a878b3cd7225cac5b843936c4749dde9 100644 (file)
@@ -233,6 +233,9 @@ void WKQTMovieDisableComponent(uint32_t[5]);
 
 CFStringRef WKCopyFoundationCacheDirectory(void);
 
+typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
+CFURLStorageSessionRef WKCreatePrivateStorageSession(CFStringRef);
+
 void WKSetVisibleApplicationName(CFStringRef);
 
 typedef enum {
index cf687a921e10acb347530e52121b8f71f0bf3218..3f4edd79f2bb281ca5d245d9e29e50ee8ab06edd 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a differ
index 73fd47923649fc2b3c22c1ec3c3f03bb3c22c026..c2d38054cae01927d42f274b0a35084903bbd181 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a differ
index 635b57bde703a7797ad534fb2c7bab9fe4a7270c..77a061dc61e0bf474e4122e7bee816e38dce5840 100644 (file)
@@ -64,6 +64,7 @@ typedef CVImageBufferRef CVPixelBufferRef;
 typedef struct _CAImageQueue *CAImageQueueRef;
 typedef unsigned long CFTypeID;
 typedef struct _CFURLCredential* WKCFURLCredentialRef;
+typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
 
 void wkSetFontSmoothingLevel(int type);
 int wkGetFontSmoothingLevel();
@@ -95,6 +96,8 @@ void wkSetClientCertificateInSSLProperties(CFMutableDictionaryRef, CFDataRef);
 CFArrayRef wkCFURLRequestCopyHTTPRequestBodyParts(CFURLRequestRef);
 void wkCFURLRequestSetHTTPRequestBodyParts(CFMutableURLRequestRef, CFArrayRef bodyParts);
 
+CFURLStorageSessionRef wkCreatePrivateStorageSession(CFStringRef identifier);
+
 CFArrayRef wkCFURLCacheCopyAllHostNamesInPersistentStore();
 void wkCFURLCacheDeleteHostNamesInPersistentStore(CFArrayRef hostNames);
 
index 1adfd48dcfe4fa5824a3b6618473121a74a2008a..ce2c2962ef6e3ed79be249b4edd63eba581a7b96 100644 (file)
Binary files a/WebKitLibraries/win/lib/WebKitSystemInterface.lib and b/WebKitLibraries/win/lib/WebKitSystemInterface.lib differ