diff options
author | Steve Block <steveblock@google.com> | 2011-05-25 19:08:45 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-06-08 13:51:31 +0100 |
commit | 2bde8e466a4451c7319e3a072d118917957d6554 (patch) | |
tree | 28f4a1b869a513e565c7760d0e6a06e7cf1fe95a /Source/WebCore/platform/network/cf/CookieStorageCFNet.cpp | |
parent | 6939c99b71d9372d14a0c74a772108052e8c48c8 (diff) | |
download | external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.zip external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.gz external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.bz2 |
Merge WebKit at r82507: Initial merge by git
Change-Id: I60ce9d780725b58b45e54165733a8ffee23b683e
Diffstat (limited to 'Source/WebCore/platform/network/cf/CookieStorageCFNet.cpp')
-rw-r--r-- | Source/WebCore/platform/network/cf/CookieStorageCFNet.cpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/Source/WebCore/platform/network/cf/CookieStorageCFNet.cpp b/Source/WebCore/platform/network/cf/CookieStorageCFNet.cpp index c2a5691..2eac3f6 100644 --- a/Source/WebCore/platform/network/cf/CookieStorageCFNet.cpp +++ b/Source/WebCore/platform/network/cf/CookieStorageCFNet.cpp @@ -42,7 +42,7 @@ namespace WebCore { -static RetainPtr<CFHTTPCookieStorageRef>& privateBrowsingCookieStorage() +static RetainPtr<CFHTTPCookieStorageRef>& privateCookieStorage() { DEFINE_STATIC_LOCAL(RetainPtr<CFHTTPCookieStorageRef>, cookieStorage, ()); return cookieStorage; @@ -52,16 +52,21 @@ CFHTTPCookieStorageRef currentCookieStorage() { ASSERT(isMainThread()); - if (CFHTTPCookieStorageRef privateCookieStorage = privateBrowsingCookieStorage().get()) - return privateCookieStorage; + if (CFHTTPCookieStorageRef cookieStorage = privateCookieStorage().get()) + return cookieStorage; return wkGetDefaultHTTPCookieStorage(); } +CFHTTPCookieStorageRef privateBrowsingCookieStorage() +{ + return privateCookieStorage().get(); +} + void setCurrentCookieStorage(CFHTTPCookieStorageRef cookieStorage) { ASSERT(isMainThread()); - privateBrowsingCookieStorage().adoptCF(cookieStorage); + privateCookieStorage().adoptCF(cookieStorage); } void setCookieStoragePrivateBrowsingEnabled(bool enabled) @@ -69,15 +74,21 @@ void setCookieStoragePrivateBrowsingEnabled(bool enabled) ASSERT(isMainThread()); if (!enabled) { - privateBrowsingCookieStorage() = nullptr; + privateCookieStorage() = nullptr; return; } #if USE(CFURLSTORAGESESSIONS) - privateBrowsingCookieStorage().adoptCF(wkCreatePrivateInMemoryHTTPCookieStorage(ResourceHandle::privateBrowsingStorageSession())); -#else - privateBrowsingCookieStorage().adoptCF(wkCreatePrivateInMemoryHTTPCookieStorage(0)); + if (CFURLStorageSessionRef privateStorageSession = ResourceHandle::privateBrowsingStorageSession()) + privateCookieStorage().adoptCF(wkCopyHTTPCookieStorage(privateStorageSession)); + else #endif + privateCookieStorage().adoptCF(wkCreateInMemoryHTTPCookieStorage()); +} + +CFHTTPCookieStorageRef defaultCookieStorage() +{ + return wkGetDefaultHTTPCookieStorage(); } static void notifyCookiesChangedOnMainThread(void* context) |