From 2d65a5fdac818ee955287f9f7e08fb7eca90266d Mon Sep 17 00:00:00 2001 From: Kristian Monsen Date: Tue, 1 Feb 2011 20:20:39 +0000 Subject: [PATCH] Proper fix for bug 3407633 Using WebAddress to parse the url, this way we will match the java stack. Change-Id: I30979df5ef347d9770985ebbb8139ec119764460 --- core/java/android/webkit/CookieManager.java | 27 +++++++++------------ 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/core/java/android/webkit/CookieManager.java b/core/java/android/webkit/CookieManager.java index 1fea65adf0744..fe137b5d265d4 100644 --- a/core/java/android/webkit/CookieManager.java +++ b/core/java/android/webkit/CookieManager.java @@ -293,13 +293,6 @@ public final class CookieManager { * @param value The value for set-cookie: in http response header */ public void setCookie(String url, String value) { - if (JniUtil.useChromiumHttpStack()) { - if (url.indexOf("://") == -1) - url = "http://" + url; - nativeSetCookie(url, value); - return; - } - WebAddress uri; try { uri = new WebAddress(url); @@ -307,7 +300,12 @@ public final class CookieManager { Log.e(LOGTAG, "Bad address: " + url); return; } - setCookie(uri, value); + + if (JniUtil.useChromiumHttpStack()) { + nativeSetCookie(uri.toString(), value); + } else { + setCookie(uri, value); + } } /** @@ -426,12 +424,6 @@ public final class CookieManager { * @return The cookies in the format of NAME=VALUE [; NAME=VALUE] */ public String getCookie(String url) { - if (JniUtil.useChromiumHttpStack()) { - if (url.indexOf("://") == -1) - url = "http://" + url; - return nativeGetCookie(url); - } - WebAddress uri; try { uri = new WebAddress(url); @@ -439,7 +431,12 @@ public final class CookieManager { Log.e(LOGTAG, "Bad address: " + url); return null; } - return getCookie(uri); + + if (JniUtil.useChromiumHttpStack()) { + return nativeGetCookie(uri.toString()); + } else { + return getCookie(uri); + } } /**