summaryrefslogtreecommitdiffstats
path: root/WebKit/android
diff options
context:
space:
mode:
authorElliott Slaughter <eds@google.com>2010-08-18 12:30:53 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-08-18 12:30:53 -0700
commitc2734c93736c8d81f71459461411114e7cb6b44f (patch)
tree8b14cd634497eb32686ca0759ca9a7d4937a8286 /WebKit/android
parent5fae6ab5a106cb38cb02978e2ab768de81a2cf41 (diff)
parent918f81255bd5490e0536420428111e71d31ae209 (diff)
downloadexternal_webkit-c2734c93736c8d81f71459461411114e7cb6b44f.zip
external_webkit-c2734c93736c8d81f71459461411114e7cb6b44f.tar.gz
external_webkit-c2734c93736c8d81f71459461411114e7cb6b44f.tar.bz2
Merge "Fix for incognito mode cookies from WebCore."
Diffstat (limited to 'WebKit/android')
-rw-r--r--WebKit/android/WebCoreSupport/PlatformBridge.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/WebKit/android/WebCoreSupport/PlatformBridge.cpp b/WebKit/android/WebCoreSupport/PlatformBridge.cpp
index 31e3101..754e4d9 100644
--- a/WebKit/android/WebCoreSupport/PlatformBridge.cpp
+++ b/WebKit/android/WebCoreSupport/PlatformBridge.cpp
@@ -27,11 +27,13 @@
#include <PlatformBridge.h>
#include "CookieClient.h"
+#include "Document.h"
#include "FileSystemClient.h"
#include "FrameView.h"
#include "JavaSharedClient.h"
#include "KeyGeneratorClient.h"
#include "PluginView.h"
+#include "Settings.h"
#include "WebCoreFrameBridge.h"
#include "WebRequestContext.h"
#include "WebViewCore.h"
@@ -61,12 +63,17 @@ String PlatformBridge::getSignedPublicKeyAndChallengeString(unsigned index, cons
return client->getSignedPublicKeyAndChallengeString(index, challenge, url);
}
-void PlatformBridge::setCookies(const KURL& url, const String& value)
+void PlatformBridge::setCookies(const Document* document, const KURL& url, const String& value)
{
#if USE(CHROME_NETWORK_STACK)
std::string cookieValue(value.utf8().data());
GURL cookieGurl(url.string().utf8().data());
- WebRequestContext::GetAndroidContext()->cookie_store()->SetCookie(cookieGurl ,cookieValue);
+ WebRequestContext* androidContext;
+ if (document->settings() && document->settings()->privateBrowsingEnabled())
+ androidContext = WebRequestContext::GetAndroidPrivateBrowsingContext();
+ else
+ androidContext = WebRequestContext::GetAndroidContext();
+ androidContext->cookie_store()->SetCookie(cookieGurl, cookieValue);
#else
CookieClient* client = JavaSharedClient::GetCookieClient();
if (!client)
@@ -76,11 +83,16 @@ void PlatformBridge::setCookies(const KURL& url, const String& value)
#endif
}
-String PlatformBridge::cookies(const KURL& url)
+String PlatformBridge::cookies(const Document* document, const KURL& url)
{
#if USE(CHROME_NETWORK_STACK)
GURL cookieGurl(url.string().utf8().data());
- std::string cookies = WebRequestContext::GetAndroidContext()->cookie_store()->GetCookies(cookieGurl);
+ WebRequestContext* androidContext;
+ if (document->settings() && document->settings()->privateBrowsingEnabled())
+ androidContext = WebRequestContext::GetAndroidPrivateBrowsingContext();
+ else
+ androidContext = WebRequestContext::GetAndroidContext();
+ std::string cookies = androidContext->cookie_store()->GetCookies(cookieGurl);
String cookieString(cookies.c_str());
return cookieString;
#else
@@ -92,7 +104,7 @@ String PlatformBridge::cookies(const KURL& url)
#endif
}
-bool PlatformBridge::cookiesEnabled()
+bool PlatformBridge::cookiesEnabled(const Document* document)
{
CookieClient* client = JavaSharedClient::GetCookieClient();
if (!client)