summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/jni/CookieManager.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2012-02-16 17:33:50 +0000
committerSteve Block <steveblock@google.com>2012-02-22 17:09:24 +0000
commit4bcd50196a7fe4c0c909ce6a7cfac6a808336611 (patch)
treed196d6ed654433d3953cbf9476e76f7db8394ef3 /Source/WebKit/android/jni/CookieManager.cpp
parentfa20d5d7a15b724e0209ba319750249dcd540402 (diff)
downloadexternal_webkit-4bcd50196a7fe4c0c909ce6a7cfac6a808336611.zip
external_webkit-4bcd50196a7fe4c0c909ce6a7cfac6a808336611.tar.gz
external_webkit-4bcd50196a7fe4c0c909ce6a7cfac6a808336611.tar.bz2
Drop support for Android HTTP stack
All future releases will use the Chromium HTTP stack and maintaining two HTTP stacks adds maintenance overhead. The Chromium HTTP stack requires V8, but we now use V8 in all build targets (b/5495373), so we can safely drop the Android HTTP stack. See corresponding framework change https://android-git.corp.google.com/g/166325. Bug: 5495616 Change-Id: I41117b6750fbc1c84cbd4a5951b0d1a457354f93
Diffstat (limited to 'Source/WebKit/android/jni/CookieManager.cpp')
-rw-r--r--Source/WebKit/android/jni/CookieManager.cpp41
1 files changed, 0 insertions, 41 deletions
diff --git a/Source/WebKit/android/jni/CookieManager.cpp b/Source/WebKit/android/jni/CookieManager.cpp
index 357d158..fca612f 100644
--- a/Source/WebKit/android/jni/CookieManager.cpp
+++ b/Source/WebKit/android/jni/CookieManager.cpp
@@ -40,49 +40,30 @@ static const char* javaCookieManagerClass = "android/webkit/CookieManager";
static bool acceptCookie(JNIEnv*, jobject)
{
-#if USE(CHROME_NETWORK_STACK)
// This is a static method which gets the cookie policy for all WebViews. We
// always apply the same configuration to the contexts for both regular and
// private browsing, so expect the same result here.
bool regularAcceptCookies = WebCookieJar::get(false)->allowCookies();
ASSERT(regularAcceptCookies == WebCookieJar::get(true)->allowCookies());
return regularAcceptCookies;
-#else
- // The Android HTTP stack is implemented Java-side.
- ASSERT_NOT_REACHED();
- return false;
-#endif
}
static jstring getCookie(JNIEnv* env, jobject, jstring url, jboolean privateBrowsing)
{
-#if USE(CHROME_NETWORK_STACK)
GURL gurl(jstringToStdString(env, url));
CookieOptions options;
options.set_include_httponly();
std::string cookies = WebCookieJar::get(privateBrowsing)->cookieStore()->GetCookieMonster()->GetCookiesWithOptions(gurl, options);
return stdStringToJstring(env, cookies);
-#else
- // The Android HTTP stack is implemented Java-side.
- ASSERT_NOT_REACHED();
- return jstring();
-#endif
}
static bool hasCookies(JNIEnv*, jobject, jboolean privateBrowsing)
{
-#if USE(CHROME_NETWORK_STACK)
return WebCookieJar::get(privateBrowsing)->getNumCookiesInDatabase() > 0;
-#else
- // The Android HTTP stack is implemented Java-side.
- ASSERT_NOT_REACHED();
- return false;
-#endif
}
static void removeAllCookie(JNIEnv*, jobject)
{
-#if USE(CHROME_NETWORK_STACK)
WebCookieJar::get(false)->cookieStore()->GetCookieMonster()->DeleteAll(true);
// This will lazily create a new private browsing context. However, if the
// context doesn't already exist, there's no need to create it, as cookies
@@ -94,84 +75,62 @@ static void removeAllCookie(JNIEnv*, jobject)
// The Java code removes cookies directly from the backing database, so we do the same,
// but with a NULL callback so it's asynchronous.
WebCookieJar::get(true)->cookieStore()->GetCookieMonster()->FlushStore(NULL);
-#endif
}
static void removeExpiredCookie(JNIEnv*, jobject)
{
-#if USE(CHROME_NETWORK_STACK)
// This simply forces a GC. The getters delete expired cookies so won't return expired cookies anyway.
WebCookieJar::get(false)->cookieStore()->GetCookieMonster()->GetAllCookies();
WebCookieJar::get(true)->cookieStore()->GetCookieMonster()->GetAllCookies();
-#endif
}
static void removeSessionCookies(WebCookieJar* cookieJar)
{
-#if USE(CHROME_NETWORK_STACK)
CookieMonster* cookieMonster = cookieJar->cookieStore()->GetCookieMonster();
CookieList cookies = cookieMonster->GetAllCookies();
for (CookieList::const_iterator iter = cookies.begin(); iter != cookies.end(); ++iter) {
if (iter->IsSessionCookie())
cookieMonster->DeleteCanonicalCookie(*iter);
}
-#endif
}
static void removeSessionCookie(JNIEnv*, jobject)
{
-#if USE(CHROME_NETWORK_STACK)
removeSessionCookies(WebCookieJar::get(false));
removeSessionCookies(WebCookieJar::get(true));
-#endif
}
static void setAcceptCookie(JNIEnv*, jobject, jboolean accept)
{
-#if USE(CHROME_NETWORK_STACK)
// This is a static method which configures the cookie policy for all
// WebViews, so we configure the contexts for both regular and private
// browsing.
WebCookieJar::get(false)->setAllowCookies(accept);
WebCookieJar::get(true)->setAllowCookies(accept);
-#endif
}
static void setCookie(JNIEnv* env, jobject, jstring url, jstring value, jboolean privateBrowsing)
{
-#if USE(CHROME_NETWORK_STACK)
GURL gurl(jstringToStdString(env, url));
std::string line(jstringToStdString(env, value));
CookieOptions options;
options.set_include_httponly();
WebCookieJar::get(privateBrowsing)->cookieStore()->GetCookieMonster()->SetCookieWithOptions(gurl, line, options);
-#endif
}
static void flushCookieStore(JNIEnv*, jobject)
{
-#if USE(CHROME_NETWORK_STACK)
WebCookieJar::flush();
-#endif
}
static bool acceptFileSchemeCookies(JNIEnv*, jobject)
{
-#if USE(CHROME_NETWORK_STACK)
return WebCookieJar::acceptFileSchemeCookies();
-#else
- // File scheme cookies are always accepted with the Android HTTP stack.
- return true;
-#endif
}
static void setAcceptFileSchemeCookies(JNIEnv*, jobject, jboolean accept)
{
-#if USE(CHROME_NETWORK_STACK)
WebCookieJar::setAcceptFileSchemeCookies(accept);
-#else
- // File scheme cookies are always accepted with the Android HTTP stack.
-#endif
}
static JNINativeMethod gCookieManagerMethods[] = {