diff options
author | Kristian Monsen <kristianm@google.com> | 2010-08-12 09:02:47 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-08-12 09:02:47 -0700 |
commit | 1338f824ca6c264f4bc118d7e945e45132cf93b4 (patch) | |
tree | 0bd3cf03ee325cb51818b32caaa1de3c2bb44885 /WebKit | |
parent | a16f4e9ca1577e716a15120149de94106ef81536 (diff) | |
parent | 3e1fb9526199fc05fdb2266189e71728299745c0 (diff) | |
download | external_webkit-1338f824ca6c264f4bc118d7e945e45132cf93b4.zip external_webkit-1338f824ca6c264f4bc118d7e945e45132cf93b4.tar.gz external_webkit-1338f824ca6c264f4bc118d7e945e45132cf93b4.tar.bz2 |
Merge "Connecting cookies set from WebCore to the chromium cookies"
Diffstat (limited to 'WebKit')
-rw-r--r-- | WebKit/android/WebCoreSupport/PlatformBridge.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/WebKit/android/WebCoreSupport/PlatformBridge.cpp b/WebKit/android/WebCoreSupport/PlatformBridge.cpp index 833deb5..31e3101 100644 --- a/WebKit/android/WebCoreSupport/PlatformBridge.cpp +++ b/WebKit/android/WebCoreSupport/PlatformBridge.cpp @@ -33,6 +33,7 @@ #include "KeyGeneratorClient.h" #include "PluginView.h" #include "WebCoreFrameBridge.h" +#include "WebRequestContext.h" #include "WebViewCore.h" #include "npruntime.h" #include <wtf/android/AndroidThreading.h> @@ -62,20 +63,33 @@ String PlatformBridge::getSignedPublicKeyAndChallengeString(unsigned index, cons void PlatformBridge::setCookies(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); +#else CookieClient* client = JavaSharedClient::GetCookieClient(); if (!client) return; client->setCookies(url, value); +#endif } String PlatformBridge::cookies(const KURL& url) { +#if USE(CHROME_NETWORK_STACK) + GURL cookieGurl(url.string().utf8().data()); + std::string cookies = WebRequestContext::GetAndroidContext()->cookie_store()->GetCookies(cookieGurl); + String cookieString(cookies.c_str()); + return cookieString; +#else CookieClient* client = JavaSharedClient::GetCookieClient(); if (!client) return String(); return client->cookies(url); +#endif } bool PlatformBridge::cookiesEnabled() |