Get rid of USE(CFURLSTORAGESESSIONS)
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 4 Nov 2012 00:35:30 +0000 (00:35 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 4 Nov 2012 00:35:30 +0000 (00:35 +0000)
https://bugs.webkit.org/show_bug.cgi?id=101131

Reviewed by Sam Weinig.

Source/WebCore:

This is always enabled on CFNetwork based platforms.

* WebCore.exp.in:
* page/Settings.cpp:
(WebCore::Settings::setPrivateBrowsingEnabled):
* platform/mac/CookieJar.mm:
(WebCore::cookies):
(WebCore::cookieRequestHeaderFieldValue):
(WebCore::setCookies):
(WebCore::cookiesEnabled):
(WebCore::getRawCookies):
(WebCore::deleteCookie):
* platform/network/ResourceHandle.h:
(ResourceHandle):
* platform/network/cf/CookieStorageCFNet.cpp:
(WebCore):
(WebCore::currentCFHTTPCookieStorage):
* platform/network/cf/CookieStorageCFNet.h:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::willSendRequest):
(WebCore::makeFinalRequest):
(WebCore::ResourceHandle::willSendRequest):
(WebCore):
* platform/network/cf/ResourceRequest.h:
(ResourceRequest):
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore):
* platform/network/mac/CookieStorageMac.mm:
(WebCore::setCookieStoragePrivateBrowsingEnabled):
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::shouldRelaxThirdPartyCookiePolicy):
(WebCore::ResourceHandle::createNSURLConnection):
(WebCore::ResourceHandle::willSendRequest):
(WebCore):
* platform/network/mac/ResourceRequestMac.mm:
(WebCore):
(WebCore::ResourceRequest::setStorageSession):

Source/WebKit/blackberry:

* WebCoreSupport/AboutDataUseFeatures.in: Not sure what this list is about, but
CFURLSTORAGESESSIONS probably doesn't need to stay here.

Source/WebKit/mac:

* WebView/WebPreferences.mm:
(+[WebPreferences _switchNetworkLoaderToNewTestingSession]):
(+[WebPreferences _setCurrentNetworkLoaderSessionCookieAcceptPolicy:]):
* WebView/WebView.mm:
(-[WebView _cachedResponseForURL:]):

Source/WebKit2:

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
(WebProcessCreationParameters):
* UIProcess/win/WebContextWin.cpp:
(WebKit::WebContext::platformInitializeWebProcess):
* WebProcess/Cookies/mac/WebCookieManagerMac.mm:
(WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::switchNetworkLoaderToNewTestingSession):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::platformHasLocalDataForURL):
(WebKit::cachedResponseForURL):
* WebProcess/WebPage/win/WebPageWin.cpp:
(WebKit::cachedResponseForURL):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
* WebProcess/win/WebProcessWin.cpp:
(WebKit::WebProcess::platformSetCacheModel):
(WebKit::WebProcess::platformClearResourceCaches):

Source/WTF:

* wtf/Platform.h:

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

30 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/page/Settings.cpp
Source/WebCore/platform/mac/CookieJar.mm
Source/WebCore/platform/network/ResourceHandle.h
Source/WebCore/platform/network/cf/CookieStorageCFNet.cpp
Source/WebCore/platform/network/cf/CookieStorageCFNet.h
Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
Source/WebCore/platform/network/cf/ResourceRequest.h
Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp
Source/WebCore/platform/network/mac/CookieStorageMac.mm
Source/WebCore/platform/network/mac/ResourceHandleMac.mm
Source/WebCore/platform/network/mac/ResourceRequestMac.mm
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebCoreSupport/AboutDataUseFeatures.in
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebPreferences.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebProcessCreationParameters.cpp
Source/WebKit2/Shared/WebProcessCreationParameters.h
Source/WebKit2/UIProcess/win/WebContextWin.cpp
Source/WebKit2/WebProcess/Cookies/mac/WebCookieManagerMac.mm
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/WebProcess/win/WebProcessWin.cpp

index a43bf89..f93c3b5 100644 (file)
@@ -1,3 +1,12 @@
+2012-11-03  Alexey Proskuryakov  <ap@apple.com>
+
+        Get rid of USE(CFURLSTORAGESESSIONS)
+        https://bugs.webkit.org/show_bug.cgi?id=101131
+
+        Reviewed by Sam Weinig.
+
+        * wtf/Platform.h:
+
 2012-11-02  Ilya Tikhonovsky  <loislo@chromium.org>
 
         Web Inspector: NMI instrument NodeRareData::Map. It uses ~250k on nytimes.com
index 71af728..ef82382 100644 (file)
 
 #if USE(CFNETWORK) || PLATFORM(MAC) || PLATFORM(IOS)
 #define WTF_USE_CFURLCACHE 1
-#define WTF_USE_CFURLSTORAGESESSIONS 1
 #endif
 
 #if PLATFORM(WIN) && !OS(WINCE) && !PLATFORM(CHROMIUM) && !PLATFORM(QT)
index fc0c7cc..057b620 100644 (file)
@@ -1,3 +1,49 @@
+2012-11-03  Alexey Proskuryakov  <ap@apple.com>
+
+        Get rid of USE(CFURLSTORAGESESSIONS)
+        https://bugs.webkit.org/show_bug.cgi?id=101131
+
+        Reviewed by Sam Weinig.
+
+        This is always enabled on CFNetwork based platforms.
+
+        * WebCore.exp.in:
+        * page/Settings.cpp:
+        (WebCore::Settings::setPrivateBrowsingEnabled):
+        * platform/mac/CookieJar.mm:
+        (WebCore::cookies):
+        (WebCore::cookieRequestHeaderFieldValue):
+        (WebCore::setCookies):
+        (WebCore::cookiesEnabled):
+        (WebCore::getRawCookies):
+        (WebCore::deleteCookie):
+        * platform/network/ResourceHandle.h:
+        (ResourceHandle):
+        * platform/network/cf/CookieStorageCFNet.cpp:
+        (WebCore):
+        (WebCore::currentCFHTTPCookieStorage):
+        * platform/network/cf/CookieStorageCFNet.h:
+        * platform/network/cf/ResourceHandleCFNet.cpp:
+        (WebCore::willSendRequest):
+        (WebCore::makeFinalRequest):
+        (WebCore::ResourceHandle::willSendRequest):
+        (WebCore):
+        * platform/network/cf/ResourceRequest.h:
+        (ResourceRequest):
+        * platform/network/cf/ResourceRequestCFNet.cpp:
+        (WebCore::ResourceRequest::doUpdatePlatformRequest):
+        (WebCore):
+        * platform/network/mac/CookieStorageMac.mm:
+        (WebCore::setCookieStoragePrivateBrowsingEnabled):
+        * platform/network/mac/ResourceHandleMac.mm:
+        (WebCore::shouldRelaxThirdPartyCookiePolicy):
+        (WebCore::ResourceHandle::createNSURLConnection):
+        (WebCore::ResourceHandle::willSendRequest):
+        (WebCore):
+        * platform/network/mac/ResourceRequestMac.mm:
+        (WebCore):
+        (WebCore::ResourceRequest::setStorageSession):
+
 2012-11-03  Balazs Kelemen  <kbalazs@webkit.org>
 
         [Qt][WK2] setPlatformStrategies always asserts after r132744
index 8d59b1b..f6d186d 100644 (file)
@@ -2193,17 +2193,11 @@ __ZN7WebCore12SchedulePairC1EP9NSRunLoopPK10__CFString
 __ZN7WebCore14ResourceHandle12releaseProxyEv
 #endif
 
-#if USE(CFURLSTORAGESESSIONS)
 __ZN7WebCore14ResourceHandle46setPrivateBrowsingStorageSessionIdentifierBaseERKN3WTF6StringE
 __ZN7WebCore14ResourceHandle21currentStorageSessionEv
 __ZN7WebCore14ResourceHandle29privateBrowsingStorageSessionEv
 __ZN7WebCore26currentCFHTTPCookieStorageEv
-#if !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED == 1060
-__ZN7WebCore14ResourceHandle24setDefaultStorageSessionEP21__CFURLStorageSession
-#else
 __ZN7WebCore14ResourceHandle24setDefaultStorageSessionEPK21__CFURLStorageSession
-#endif
-#endif
 
 #if ENABLE(CONTEXT_MENUS)
 __ZN7WebCore11ContextMenu22setPlatformDescriptionEP14NSMutableArray
index 613c56a..871584c 100644 (file)
@@ -590,7 +590,7 @@ void Settings::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
     // 4. The WebPage settings get applied to the new Page and setPrivateBrowsingEnabled(false)
     //    is called, but an if (m_privateBrowsingEnabled == privateBrowsingEnabled) early return
     //    prevents the global values from getting changed from true to false.
-#if USE(CFURLSTORAGESESSIONS)
+#if PLATFORM(MAC) || USE(CFNETWORK)
     ResourceHandle::setPrivateBrowsingEnabled(privateBrowsingEnabled);
 #endif
     setCookieStoragePrivateBrowsingEnabled(privateBrowsingEnabled);
index e774944..9c543e5 100644 (file)
@@ -82,11 +82,9 @@ String cookies(const Document*, const KURL& url)
 
     NSURL *cookieURL = url;
     NSArray *cookies;
-#if USE(CFURLSTORAGESESSIONS)
     if (RetainPtr<CFHTTPCookieStorageRef> cfCookieStorage = currentCFHTTPCookieStorage())
         cookies = wkHTTPCookiesForURL(cfCookieStorage.get(), cookieURL);
     else
-#endif
         cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:cookieURL];
 
     return [[NSHTTPCookie requestHeaderFieldsWithCookies:filterCookies(cookies).get()] objectForKey:@"Cookie"];
@@ -101,11 +99,9 @@ String cookieRequestHeaderFieldValue(const Document*, const KURL& url)
 
     NSURL *cookieURL = url;
     NSArray *cookies;
-#if USE(CFURLSTORAGESESSIONS)
     if (RetainPtr<CFHTTPCookieStorageRef> cfCookieStorage = currentCFHTTPCookieStorage())
         cookies = wkHTTPCookiesForURL(cfCookieStorage.get(), cookieURL);
     else
-#endif
         cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:cookieURL];
 
     return [[NSHTTPCookie requestHeaderFieldsWithCookies:cookies] objectForKey:@"Cookie"];
@@ -130,11 +126,9 @@ void setCookies(Document* document, const KURL& url, const String& cookieStr)
     NSURL *cookieURL = url;    
     RetainPtr<NSArray> filteredCookies = filterCookies([NSHTTPCookie cookiesWithResponseHeaderFields:[NSDictionary dictionaryWithObject:cookieString forKey:@"Set-Cookie"] forURL:cookieURL]);
 
-#if USE(CFURLSTORAGESESSIONS)
     if (RetainPtr<CFHTTPCookieStorageRef> cfCookieStorage = currentCFHTTPCookieStorage())
         wkSetHTTPCookiesForURL(cfCookieStorage.get(), filteredCookies.get(), cookieURL, document->firstPartyForCookies());
     else
-#endif
         [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookies:filteredCookies.get() forURL:cookieURL mainDocumentURL:document->firstPartyForCookies()];
 
     END_BLOCK_OBJC_EXCEPTIONS;
@@ -145,11 +139,9 @@ bool cookiesEnabled(const Document*)
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
 
     NSHTTPCookieAcceptPolicy cookieAcceptPolicy;
-#if USE(CFURLSTORAGESESSIONS)
     if (RetainPtr<CFHTTPCookieStorageRef> cfCookieStorage = currentCFHTTPCookieStorage())
         cookieAcceptPolicy = static_cast<NSHTTPCookieAcceptPolicy>(wkGetHTTPCookieAcceptPolicy(cfCookieStorage.get()));
     else
-#endif
         cookieAcceptPolicy = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookieAcceptPolicy];
 
     return cookieAcceptPolicy == NSHTTPCookieAcceptPolicyAlways || cookieAcceptPolicy == NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain;
@@ -165,11 +157,9 @@ bool getRawCookies(const Document*, const KURL& url, Vector<Cookie>& rawCookies)
 
     NSURL *cookieURL = url;
     NSArray *cookies;
-#if USE(CFURLSTORAGESESSIONS)
     if (RetainPtr<CFHTTPCookieStorageRef> cfCookieStorage = currentCFHTTPCookieStorage())
         cookies = wkHTTPCookiesForURL(cfCookieStorage.get(), cookieURL);
     else
-#endif
         cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:cookieURL];
 
     NSUInteger count = [cookies count];
@@ -198,12 +188,10 @@ void deleteCookie(const Document*, const KURL& url, const String& cookieName)
     NSURL *cookieURL = url;
     NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
     NSArray *cookies;
-#if USE(CFURLSTORAGESESSIONS)
     RetainPtr<CFHTTPCookieStorageRef> cfCookieStorage = currentCFHTTPCookieStorage();
     if (cfCookieStorage)
         cookies = wkHTTPCookiesForURL(cfCookieStorage.get(), cookieURL);
     else
-#endif
         cookies = [cookieStorage cookiesForURL:cookieURL];
 
     NSString *cookieNameString = (NSString *) cookieName;
@@ -212,11 +200,9 @@ void deleteCookie(const Document*, const KURL& url, const String& cookieName)
     for (NSUInteger i = 0; i < count; ++i) {
         NSHTTPCookie *cookie = (NSHTTPCookie *)[cookies objectAtIndex:i];
         if ([[cookie name] isEqualToString:cookieNameString]) {
-#if USE(CFURLSTORAGESESSIONS)
             if (cfCookieStorage)
                 wkDeleteHTTPCookie(cfCookieStorage.get(), cookie);
             else
-#endif
                 [cookieStorage deleteCookie:cookie];
             break;
         }
index 8ed4c42..e4532d2 100644 (file)
@@ -48,7 +48,7 @@ typedef void* LPVOID;
 typedef LPVOID HINTERNET;
 #endif
 
-#if PLATFORM(MAC) || USE(CFURLSTORAGESESSIONS)
+#if PLATFORM(MAC) || USE(CFNETWORK)
 #include <wtf/RetainPtr.h>
 #endif
 
@@ -68,9 +68,7 @@ typedef int CFHTTPCookieStorageAcceptPolicy;
 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
 #endif
 
-#if USE(CFURLSTORAGESESSIONS) && PLATFORM(MAC) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED <= 1060
-typedef struct __CFURLStorageSession* CFURLStorageSessionRef;
-#elif USE(CFURLSTORAGESESSIONS)
+#if PLATFORM(MAC) || USE(CFNETWORK)
 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
 #endif
 
@@ -198,7 +196,7 @@ public:
 
     void fireFailure(Timer<ResourceHandle>*);
 
-#if USE(CFURLSTORAGESESSIONS)
+#if PLATFORM(MAC) || USE(CFNETWORK)
     static CFURLStorageSessionRef currentStorageSession();
     static void setDefaultStorageSession(CFURLStorageSessionRef);
     static CFURLStorageSessionRef defaultStorageSession();
@@ -206,7 +204,7 @@ public:
 
     static void setPrivateBrowsingStorageSessionIdentifierBase(const String&);
     static RetainPtr<CFURLStorageSessionRef> createPrivateBrowsingStorageSession(CFStringRef identifier);
-#endif // USE(CFURLSTORAGESESSIONS)
+#endif
 
     using RefCounted<ResourceHandle>::ref;
     using RefCounted<ResourceHandle>::deref;
@@ -247,7 +245,7 @@ private:
     void createCFURLConnection(bool shouldUseCredentialStorage, bool shouldContentSniff);
 #endif
 
-#if USE(CFURLSTORAGESESSIONS)
+#if PLATFORM(MAC) || USE(CFNETWORK)
     static String privateBrowsingStorageSessionIdentifierDefaultBase();
     static CFURLStorageSessionRef privateBrowsingStorageSession();
 #endif
index 0e9e373..50e4ae6 100644 (file)
@@ -28,8 +28,6 @@
 
 #include "CookieStorageCFNet.h"
 
-#if USE(CFNETWORK) || USE(CFURLSTORAGESESSIONS)
-
 #include "ResourceHandle.h"
 #include <wtf/MainThread.h>
 
@@ -46,8 +44,6 @@
 #include "PlatformStrategies.h"
 #endif
 
-#endif
-
 namespace WebCore {
 
 #if PLATFORM(WIN)
@@ -60,8 +56,6 @@ static RetainPtr<CFHTTPCookieStorageRef>& cookieStorageOverride()
 
 #endif
 
-#if USE(CFNETWORK) || USE(CFURLSTORAGESESSIONS)
-
 RetainPtr<CFHTTPCookieStorageRef> currentCFHTTPCookieStorage()
 {
 #if PLATFORM(WIN)
@@ -69,10 +63,8 @@ RetainPtr<CFHTTPCookieStorageRef> currentCFHTTPCookieStorage()
         return override;
 #endif
 
-#if USE(CFNETWORK) || USE(CFURLSTORAGESESSIONS)
     if (CFURLStorageSessionRef session = ResourceHandle::currentStorageSession())
         return RetainPtr<CFHTTPCookieStorageRef>(AdoptCF, wkCopyHTTPCookieStorage(session));
-#endif
 
 #if USE(CFNETWORK)
     return wkGetDefaultHTTPCookieStorage();
@@ -82,9 +74,7 @@ RetainPtr<CFHTTPCookieStorageRef> currentCFHTTPCookieStorage()
 #endif
 }
 
-#endif // USE(CFNETWORK) || USE(CFURLSTORAGESESSIONS)
-
-#if USE(CFNETWORK) && PLATFORM(WIN)
+#if PLATFORM(WIN)
 
 void overrideCookieStorage(CFHTTPCookieStorageRef cookieStorage)
 {
@@ -156,6 +146,6 @@ void stopObservingCookieChanges()
     CFHTTPCookieStorageUnscheduleFromRunLoop(cookieStorage.get(), runLoop, kCFRunLoopCommonModes);
 }
 
-#endif // USE(CFNETWORK) && PLATFORM(WIN)
+#endif // PLATFORM(WIN)
 
 } // namespace WebCore
index 5e7dfd3..68dbc67 100644 (file)
@@ -26,8 +26,6 @@
 #ifndef CookieStorageCFNet_h
 #define CookieStorageCFNet_h
 
-#if USE(CFNETWORK) || USE(CFURLSTORAGESESSIONS)
-
 #include <wtf/RetainPtr.h>
 
 typedef struct OpaqueCFHTTPCookieStorage*  CFHTTPCookieStorageRef;
@@ -43,6 +41,4 @@ void overrideCookieStorage(CFHTTPCookieStorageRef);
 
 }
 
-#endif // USE(CFNETWORK) || USE(CFURLSTORAGESESSIONS)
-
 #endif // CookieStorageCFNet_h
index 23be0be..92c7d73 100644 (file)
@@ -165,9 +165,7 @@ static CFURLRequestRef willSendRequest(CFURLConnectionRef conn, CFURLRequestRef
             RetainPtr<CFStringRef> newMethod = adoptCF(CFURLRequestCopyHTTPRequestMethod(cfRequest));
             if (CFStringCompareWithOptions(lastHTTPMethod.get(), newMethod.get(), CFRangeMake(0, CFStringGetLength(lastHTTPMethod.get())), kCFCompareCaseInsensitive)) {
                 RetainPtr<CFMutableURLRequestRef> mutableRequest(AdoptCF, CFURLRequestCreateMutableCopy(0, cfRequest));
-#if USE(CFURLSTORAGESESSIONS)
                 wkSetRequestStorageSession(ResourceHandle::currentStorageSession(), mutableRequest.get());
-#endif
                 CFURLRequestSetHTTPRequestMethod(mutableRequest.get(), lastHTTPMethod.get());
 
                 FormData* body = handle->firstRequest().httpBody();
@@ -397,9 +395,7 @@ ResourceHandle::~ResourceHandle()
 static CFURLRequestRef makeFinalRequest(const ResourceRequest& request, bool shouldContentSniff)
 {
     CFMutableURLRequestRef newRequest = CFURLRequestCreateMutableCopy(kCFAllocatorDefault, request.cfURLRequest());
-#if USE(CFURLSTORAGESESSIONS)
     wkSetRequestStorageSession(ResourceHandle::currentStorageSession(), newRequest);
-#endif
     
     if (!shouldContentSniff)
         wkSetCFURLRequestShouldContentSniff(newRequest, false);
@@ -570,9 +566,7 @@ void ResourceHandle::willSendRequest(ResourceRequest& request, const ResourceRes
         }
     }
 
-#if USE(CFURLSTORAGESESSIONS)
      request.setStorageSession(ResourceHandle::currentStorageSession());
-#endif
 
     client()->willSendRequest(this, request, redirectResponse);
 }
@@ -944,8 +938,6 @@ void ResourceHandle::handleDataArray(CFArrayRef dataArray)
 }
 #endif
 
-#if USE(CFURLSTORAGESESSIONS)
-
 RetainPtr<CFURLStorageSessionRef> ResourceHandle::createPrivateBrowsingStorageSession(CFStringRef identifier)
 {
 #if PLATFORM(WIN)
@@ -1025,7 +1017,5 @@ String ResourceHandle::privateBrowsingStorageSessionIdentifierDefaultBase()
 
 #endif // PLATFORM(WIN)
 
-#endif // USE(CFURLSTORAGESESSIONS)
-
 } // namespace WebCore
 
index 64be955..5e3724c 100644 (file)
@@ -36,9 +36,7 @@ typedef const struct _CFURLRequest* CFURLRequestRef;
 
 OBJC_CLASS NSURLRequest;
 
-#if USE(CFURLSTORAGESESSIONS) && PLATFORM(MAC) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED <= 1060
-typedef struct __CFURLStorageSession* CFURLStorageSessionRef;
-#elif USE(CFURLSTORAGESESSIONS)
+#if PLATFORM(MAC) || USE(CFNETWORK)
 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
 #endif
 
@@ -96,7 +94,7 @@ namespace WebCore {
         NSURLRequest *nsURLRequest() const;
 #endif
 
-#if USE(CFURLSTORAGESESSIONS)
+#if PLATFORM(MAC) || USE(CFNETWORK)
         void setStorageSession(CFURLStorageSessionRef);
 #endif
 
index 586831a..9fc8f3d 100644 (file)
@@ -136,9 +136,7 @@ void ResourceRequest::doUpdatePlatformRequest()
         CFURLRequestSetTimeoutInterval(cfRequest, timeoutInterval());
     } else
         cfRequest = CFURLRequestCreateMutable(0, url.get(), (CFURLRequestCachePolicy)cachePolicy(), timeoutInterval(), firstPartyForCookies.get());
-#if USE(CFURLSTORAGESESSIONS)
     wkSetRequestStorageSession(ResourceHandle::currentStorageSession(), cfRequest);
-#endif
 
     CFURLRequestSetHTTPRequestMethod(cfRequest, httpMethod().createCFString().get());
 
@@ -224,8 +222,6 @@ void ResourceRequest::doUpdateResourceRequest()
     m_httpBody = httpBodyFromRequest(m_cfRequest.get());
 }
 
-#if USE(CFURLSTORAGESESSIONS)
-
 void ResourceRequest::setStorageSession(CFURLStorageSessionRef storageSession)
 {
     CFMutableURLRequestRef cfRequest = CFURLRequestCreateMutableCopy(0, m_cfRequest.get());
@@ -236,8 +232,6 @@ void ResourceRequest::setStorageSession(CFURLStorageSessionRef storageSession)
 #endif
 }
 
-#endif
-
 #if PLATFORM(MAC)
 void ResourceRequest::applyWebArchiveHackForMail()
 {
@@ -265,7 +259,6 @@ unsigned initializeMaximumHTTPConnectionCountPerHost()
     // Always set the connection count per host, even when pipelining.
     unsigned maximumHTTPConnectionCountPerHost = wkInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount);
 
-#if USE(CFNETWORK) || PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
     static const unsigned unlimitedConnectionCount = 10000;
 
     Boolean keyExistsAndHasValidFormat = false;
@@ -282,7 +275,6 @@ unsigned initializeMaximumHTTPConnectionCountPerHost()
         // When pipelining do not rate-limit requests sent from WebCore since CFNetwork handles that.
         return unlimitedConnectionCount;
     }
-#endif
 
     return maximumHTTPConnectionCountPerHost;
 }
index 1de6888..2116d35 100644 (file)
@@ -79,15 +79,6 @@ namespace WebCore {
 
 void setCookieStoragePrivateBrowsingEnabled(bool enabled)
 {
-#if !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED == 1060 && USE(CFURLSTORAGESESSIONS)
-    // Don't call wkSetCookieStoragePrivateBrowsingEnabled() when cookie storage is set up via sessions.
-    // That would make NSURLConnect use global private browsing cookie storage regardless of request session.
-    // The global private cookie storage has different semantics - it makes new cookies non-persistent,
-    // but doesn't start with a clean state.
-    if (enabled && currentCFHTTPCookieStorage())
-        return;
-#endif
-
     // FIXME: When Private Browsing is enabled, the Private Browsing Cookie Storage should be
     // observed for changes, not the default Cookie Storage.
 
index 61d41ff..68b14c1 100644 (file)
@@ -150,23 +150,19 @@ static bool shouldRelaxThirdPartyCookiePolicy(const KURL& url)
     NSHTTPCookieStorage *sharedStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
 
     NSHTTPCookieAcceptPolicy cookieAcceptPolicy;
-#if USE(CFURLSTORAGESESSIONS)
     RetainPtr<CFHTTPCookieStorageRef> cfCookieStorage = currentCFHTTPCookieStorage();
     if (cfCookieStorage)
         cookieAcceptPolicy = static_cast<NSHTTPCookieAcceptPolicy>(wkGetHTTPCookieAcceptPolicy(cfCookieStorage.get()));
     else
-#endif
         cookieAcceptPolicy = [sharedStorage cookieAcceptPolicy];
 
     if (cookieAcceptPolicy != NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain)
         return false;
 
     NSArray *cookies;
-#if USE(CFURLSTORAGESESSIONS)
     if (cfCookieStorage)
         cookies = wkHTTPCookiesForURL(cfCookieStorage.get(), url);
     else
-#endif
         cookies = [sharedStorage cookiesForURL:url];
 
     return [cookies count];
@@ -217,10 +213,8 @@ void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredential
     static bool supportsSettingConnectionProperties = [NSURLConnection instancesRespondToSelector:@selector(_initWithRequest:delegate:usesCache:maxContentLength:startImmediately:connectionProperties:)];
 #endif
 
-#if USE(CFURLSTORAGESESSIONS)
     if (CFURLStorageSessionRef storageSession = currentStorageSession())
         nsRequest = [wkCopyRequestWithStorageSession(storageSession, nsRequest) autorelease];
-#endif
 
     if (supportsSettingConnectionProperties) {
         NSDictionary *sessionID = shouldUseCredentialStorage ? [NSDictionary dictionary] : [NSDictionary dictionaryWithObject:@"WebKitPrivateSession" forKey:@"_kCFURLConnectionSessionID"];
@@ -482,10 +476,8 @@ void ResourceHandle::willSendRequest(ResourceRequest& request, const ResourceRes
         }
     }
 
-#if USE(CFURLSTORAGESESSIONS)
     if (CFURLStorageSessionRef storageSession = currentStorageSession())
         request.setStorageSession(storageSession);
-#endif
 
     client()->willSendRequest(this, request, redirectResponse);
 }
@@ -631,15 +623,11 @@ void ResourceHandle::receivedCancellation(const AuthenticationChallenge& challen
         client()->receivedCancellation(this, challenge);
 }
 
-#if USE(CFURLSTORAGESESSIONS)
-
 String ResourceHandle::privateBrowsingStorageSessionIdentifierDefaultBase()
 {
     return String([[NSBundle mainBundle] bundleIdentifier]);
 }
 
-#endif
-
 } // namespace WebCore
 
 @implementation WebCoreResourceHandleAsDelegate
index e693484..1807b39 100644 (file)
@@ -185,14 +185,10 @@ void ResourceRequest::applyWebArchiveHackForMail()
     [NSURLProtocol setProperty:@"" forKey:@"WebDataRequest" inRequest:(NSMutableURLRequest *)nsURLRequest()];
 }
 
-#if USE(CFURLSTORAGESESSIONS)
-
 void ResourceRequest::setStorageSession(CFURLStorageSessionRef storageSession)
 {
     m_nsRequest.adoptNS(wkCopyRequestWithStorageSession(storageSession, m_nsRequest.get()));
 }
-
-#endif
     
 #endif // USE(CFNETWORK)
 
index f8ad3f8..4d352e1 100644 (file)
@@ -1,3 +1,13 @@
+2012-11-03  Alexey Proskuryakov  <ap@apple.com>
+
+        Get rid of USE(CFURLSTORAGESESSIONS)
+        https://bugs.webkit.org/show_bug.cgi?id=101131
+
+        Reviewed by Sam Weinig.
+
+        * WebCoreSupport/AboutDataUseFeatures.in: Not sure what this list is about, but
+        CFURLSTORAGESESSIONS probably doesn't need to stay here.
+
 2012-11-02  Nima Ghanavatian  <nghanavatian@rim.com>
 
         [BlackBerry] Fix compile-time warning of a possible empty-body if statement
index fbf70e5..0b071ec 100644 (file)
@@ -1,3 +1,16 @@
+2012-11-03  Alexey Proskuryakov  <ap@apple.com>
+
+        Get rid of USE(CFURLSTORAGESESSIONS)
+        https://bugs.webkit.org/show_bug.cgi?id=101131
+
+        Reviewed by Sam Weinig.
+
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences _switchNetworkLoaderToNewTestingSession]):
+        (+[WebPreferences _setCurrentNetworkLoaderSessionCookieAcceptPolicy:]):
+        * WebView/WebView.mm:
+        (-[WebView _cachedResponseForURL:]):
+
 2012-11-02  Anders Carlsson  <andersca@apple.com>
 
         Don't instantiate the Java plug-in if it's inactive
index 599dc58..9fb305b 100644 (file)
@@ -1285,21 +1285,17 @@ static NSString *classIBCreatorID = nil;
 
 + (void)_switchNetworkLoaderToNewTestingSession
 {
-#if USE(CFURLSTORAGESESSIONS)
     // Set a private session for testing to avoid interfering with global cookies. This should be different from private browsing session.
     RetainPtr<CFURLStorageSessionRef> session = ResourceHandle::createPrivateBrowsingStorageSession(CFSTR("WebKit Testing Session"));
     ResourceHandle::setDefaultStorageSession(session.get());
-#endif
 }
 
 + (void)_setCurrentNetworkLoaderSessionCookieAcceptPolicy:(NSHTTPCookieAcceptPolicy)policy
 {
     [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:policy];
 
-#if USE(CFURLSTORAGESESSIONS)
     if (RetainPtr<CFHTTPCookieStorageRef> cookieStorage = currentCFHTTPCookieStorage())
         WKSetHTTPCookieAcceptPolicy(cookieStorage.get(), policy);
-#endif
 }
 
 - (BOOL)isDOMPasteAllowed
index 17befaf..3ff7275 100644 (file)
@@ -2000,11 +2000,9 @@ static inline IMP getMethod(id o, SEL s)
     NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:URL];
     [request _web_setHTTPUserAgent:[self userAgentForURL:URL]];
     NSCachedURLResponse *cachedResponse;
-#if USE(CFURLSTORAGESESSIONS)
     if (CFURLStorageSessionRef storageSession = ResourceHandle::currentStorageSession())
         cachedResponse = WKCachedResponseForRequest(storageSession, request);
     else
-#endif
         cachedResponse = [[NSURLCache sharedURLCache] cachedResponseForRequest:request];
     [request release];
     return cachedResponse;
index 727b2a5..8c95fea 100644 (file)
@@ -1,3 +1,32 @@
+2012-11-03  Alexey Proskuryakov  <ap@apple.com>
+
+        Get rid of USE(CFURLSTORAGESESSIONS)
+        https://bugs.webkit.org/show_bug.cgi?id=101131
+
+        Reviewed by Sam Weinig.
+
+        * Shared/WebProcessCreationParameters.cpp:
+        (WebKit::WebProcessCreationParameters::encode):
+        (WebKit::WebProcessCreationParameters::decode):
+        * Shared/WebProcessCreationParameters.h:
+        (WebProcessCreationParameters):
+        * UIProcess/win/WebContextWin.cpp:
+        (WebKit::WebContext::platformInitializeWebProcess):
+        * WebProcess/Cookies/mac/WebCookieManagerMac.mm:
+        (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::switchNetworkLoaderToNewTestingSession):
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::platformHasLocalDataForURL):
+        (WebKit::cachedResponseForURL):
+        * WebProcess/WebPage/win/WebPageWin.cpp:
+        (WebKit::cachedResponseForURL):
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeWebProcess):
+        * WebProcess/win/WebProcessWin.cpp:
+        (WebKit::WebProcess::platformSetCacheModel):
+        (WebKit::WebProcess::platformClearResourceCaches):
+
 2012-11-03  Pavel Feldman  <pfeldman@chromium.org>
 
         REGRESSION (r132014-r132047): Webkit Inspector Window docking broken
index c550362..56383f7 100644 (file)
@@ -27,7 +27,7 @@
 #include "WebProcessCreationParameters.h"
 
 #include "ArgumentCoders.h"
-#if USE(CFURLSTORAGESESSIONS) && PLATFORM(WIN)
+#if PLATFORM(WIN) && USE(CFNETWORK)
 #include "ArgumentCodersCF.h"
 #endif
 
@@ -83,7 +83,7 @@ void WebProcessCreationParameters::encode(CoreIPC::ArgumentEncoder& encoder) con
     encoder << textCheckerState;
     encoder << fullKeyboardAccessEnabled;
     encoder << defaultRequestTimeoutInterval;
-#if PLATFORM(MAC) || USE(CFURLSTORAGESESSIONS)
+#if PLATFORM(MAC) || USE(CFNETWORK)
     encoder << uiProcessBundleIdentifier;
 #endif
 #if PLATFORM(MAC)
@@ -101,12 +101,12 @@ void WebProcessCreationParameters::encode(CoreIPC::ArgumentEncoder& encoder) con
     encoder << cfURLCacheDiskCapacity;
     encoder << cfURLCacheMemoryCapacity;
     encoder << initialHTTPCookieAcceptPolicy;
-#if USE(CFURLSTORAGESESSIONS)
+#if PLATFORM(MAC) || USE(CFNETWORK)
     CFDataRef storageSession = serializedDefaultStorageSession.get();
     encoder << static_cast<bool>(storageSession);
     if (storageSession)
         CoreIPC::encode(encoder, storageSession);
-#endif // USE(CFURLSTORAGESESSIONS)
+#endif
 #endif
 
 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
@@ -178,7 +178,7 @@ bool WebProcessCreationParameters::decode(CoreIPC::ArgumentDecoder* decoder, Web
         return false;
     if (!decoder->decode(parameters.defaultRequestTimeoutInterval))
         return false;
-#if PLATFORM(MAC) || USE(CFURLSTORAGESESSIONS)
+#if PLATFORM(MAC) || USE(CFNETWORK)
     if (!decoder->decode(parameters.uiProcessBundleIdentifier))
         return false;
 #endif
@@ -211,13 +211,13 @@ bool WebProcessCreationParameters::decode(CoreIPC::ArgumentDecoder* decoder, Web
         return false;
     if (!decoder->decode(parameters.initialHTTPCookieAcceptPolicy))
         return false;
-#if USE(CFURLSTORAGESESSIONS)
+#if PLATFORM(MAC) || USE(CFNETWORK)
     bool hasStorageSession = false;
     if (!decoder->decode(hasStorageSession))
         return false;
     if (hasStorageSession && !CoreIPC::decode(decoder, parameters.serializedDefaultStorageSession))
         return false;
-#endif // USE(CFURLSTORAGESESSIONS)
+#endif
 #endif
 
 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
index 5a651aa..de5f9f3 100644 (file)
@@ -91,7 +91,7 @@ struct WebProcessCreationParameters {
 
     double defaultRequestTimeoutInterval;
 
-#if PLATFORM(MAC) || USE(CFURLSTORAGESESSIONS)
+#if PLATFORM(MAC) || USE(CFNETWORK)
     String uiProcessBundleIdentifier;
 #endif
 
@@ -119,9 +119,9 @@ struct WebProcessCreationParameters {
 
     bool shouldPaintNativeControls;
 
-#if USE(CFURLSTORAGESESSIONS)
+#if USE(CFNETWORK)
     RetainPtr<CFDataRef> serializedDefaultStorageSession;
-#endif // USE(CFURLSTORAGESESSIONS)
+#endif
 #endif // PLATFORM(WIN)
 
 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
index 9dd0568..0d2e954 100644 (file)
@@ -68,10 +68,8 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& para
     if (parameters.diskCacheDirectory.endsWith(UChar('\\')))
         parameters.diskCacheDirectory.remove(parameters.diskCacheDirectory.length() - 1);
 
-#if USE(CFURLSTORAGESESSIONS)
     parameters.uiProcessBundleIdentifier = String(reinterpret_cast<CFStringRef>(CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle(), kCFBundleIdentifierKey)));
     parameters.serializedDefaultStorageSession.adoptCF(wkCopySerializedDefaultStorageSession());
-#endif // USE(CFURLSTORAGESESSIONS)
 
     parameters.initialHTTPCookieAcceptPolicy = m_initialHTTPCookieAcceptPolicy;
 
index 172b6bf..0584307 100644 (file)
@@ -36,10 +36,8 @@ void WebCookieManager::platformSetHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy
 {
     [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:static_cast<NSHTTPCookieAcceptPolicy>(policy)];
 
-#if USE(CFURLSTORAGESESSIONS)
     if (RetainPtr<CFHTTPCookieStorageRef> cookieStorage = currentCFHTTPCookieStorage())
         WKSetHTTPCookieAcceptPolicy(cookieStorage.get(), policy);
-#endif
 }
 
 HTTPCookieAcceptPolicy WebCookieManager::platformGetHTTPCookieAcceptPolicy()
index 5ade03a..bc971fb 100644 (file)
@@ -283,7 +283,7 @@ void InjectedBundle::setPopupBlockingEnabled(WebPageGroupProxy* pageGroup, bool
 
 void InjectedBundle::switchNetworkLoaderToNewTestingSession()
 {
-#if USE(CFURLSTORAGESESSIONS)
+#if PLATFORM(MAC) || USE(CFNETWORK)
     // Set a private session for testing to avoid interfering with global cookies. This should be different from private browsing session.
     RetainPtr<CFURLStorageSessionRef> session = ResourceHandle::createPrivateBrowsingStorageSession(CFSTR("Private WebKit Session"));
     ResourceHandle::setDefaultStorageSession(session.get());
index 2acf85b..b524daf 100644 (file)
@@ -679,11 +679,9 @@ bool WebPage::platformHasLocalDataForURL(const WebCore::KURL& url)
     NSMutableURLRequest* request = [[NSMutableURLRequest alloc] initWithURL:url];
     [request setValue:(NSString*)userAgent() forHTTPHeaderField:@"User-Agent"];
     NSCachedURLResponse *cachedResponse;
-#if USE(CFURLSTORAGESESSIONS)
     if (CFURLStorageSessionRef storageSession = ResourceHandle::currentStorageSession())
         cachedResponse = WKCachedResponseForRequest(storageSession, request);
     else
-#endif
         cachedResponse = [[NSURLCache sharedURLCache] cachedResponseForRequest:request];
     [request release];
     
@@ -695,10 +693,8 @@ static NSCachedURLResponse *cachedResponseForURL(WebPage* webPage, const KURL& u
     RetainPtr<NSMutableURLRequest> request(AdoptNS, [[NSMutableURLRequest alloc] initWithURL:url]);
     [request.get() setValue:(NSString *)webPage->userAgent() forHTTPHeaderField:@"User-Agent"];
 
-#if USE(CFURLSTORAGESESSIONS)
     if (CFURLStorageSessionRef storageSession = ResourceHandle::currentStorageSession())
         return WKCachedResponseForRequest(storageSession, request.get());
-#endif
 
     return [[NSURLCache sharedURLCache] cachedResponseForRequest:request.get()];
 }
index c6f5b67..212fe6d 100644 (file)
@@ -266,18 +266,14 @@ static RetainPtr<CFCachedURLResponseRef> cachedResponseForURL(WebPage* webPage,
 {
     RetainPtr<CFURLRef> cfURL(AdoptCF, url.createCFURL());
     RetainPtr<CFMutableURLRequestRef> request(AdoptCF, CFURLRequestCreateMutable(0, cfURL.get(), kCFURLRequestCachePolicyReloadIgnoringCache, 60, 0));
-#if USE(CFURLSTORAGESESSIONS)
     wkSetRequestStorageSession(ResourceHandle::currentStorageSession(), request.get());
-#endif
 
     CFURLRequestSetHTTPHeaderFieldValue(request.get(), CFSTR("User-Agent"), webPage->userAgent().createCFString().get());
 
     RetainPtr<CFURLCacheRef> cache;
-#if USE(CFURLSTORAGESESSIONS)
     if (CFURLStorageSessionRef currentStorageSession = ResourceHandle::currentStorageSession())
         cache.adoptCF(wkCopyURLCache(currentStorageSession));
     else
-#endif
         cache.adoptCF(CFURLCacheCopySharedURLCache());
 
     RetainPtr<CFCachedURLResponseRef> response(AdoptCF, CFURLCacheCopyResponseForRequest(cache.get(), request.get()));
index 91a7e51..60fe731 100644 (file)
@@ -274,7 +274,8 @@ void WebProcess::initializeWebProcess(const WebProcessCreationParameters& parame
     if (parameters.shouldUseFontSmoothing)
         setShouldUseFontSmoothing(true);
 
-#if USE(CFURLSTORAGESESSIONS)
+#if PLATFORM(MAC) || USE(CFNETWORK)
+    // FIXME (NetworkProcess): Send this identifier to network process.
     WebCore::ResourceHandle::setPrivateBrowsingStorageSessionIdentifierBase(parameters.uiProcessBundleIdentifier);
 #endif
 
index da4b56d..40066a2 100644 (file)
@@ -71,11 +71,9 @@ void WebProcess::platformSetCacheModel(CacheModel cacheModel)
 {
 #if USE(CFNETWORK)
     RetainPtr<CFStringRef> cfurlCacheDirectory;
-#if USE(CFURLSTORAGESESSIONS)
     if (CFURLStorageSessionRef defaultStorageSession = ResourceHandle::defaultStorageSession())
         cfurlCacheDirectory.adoptCF(wkCopyFoundationCacheDirectory(defaultStorageSession));
     else
-#endif
         cfurlCacheDirectory.adoptCF(wkCopyFoundationCacheDirectory(0));
 
     if (!cfurlCacheDirectory)
@@ -103,11 +101,9 @@ void WebProcess::platformSetCacheModel(CacheModel cacheModel)
     pageCache()->setCapacity(pageCacheCapacity);
 
     RetainPtr<CFURLCacheRef> cfurlCache;
-#if USE(CFURLSTORAGESESSIONS)
     if (CFURLStorageSessionRef defaultStorageSession = ResourceHandle::defaultStorageSession())
         cfurlCache.adoptCF(wkCopyURLCache(defaultStorageSession));
     else
-#endif // USE(CFURLSTORAGESESSIONS)
         cfurlCache.adoptCF(CFURLCacheCopySharedURLCache());
 
     CFURLCacheSetMemoryCapacity(cfurlCache.get(), urlCacheMemoryCapacity);
@@ -122,11 +118,9 @@ void WebProcess::platformClearResourceCaches(ResourceCachesToClear cachesToClear
         return;
 
     RetainPtr<CFURLCacheRef> cache;
-#if USE(CFURLSTORAGESESSIONS)
     if (CFURLStorageSessionRef defaultStorageSession = ResourceHandle::defaultStorageSession())
         cache.adoptCF(wkCopyURLCache(defaultStorageSession));
     else
-#endif // USE(CFURLSTORAGESESSIONS)
         cache.adoptCF(CFURLCacheCopySharedURLCache());
 
     CFURLCacheRemoveAllCachedResponses(cache.get());