OSDN Git Service

Hook up CookieManager.getCookie() for Chromium HTTP stack
authorSteve Block <steveblock@google.com>
Wed, 27 Oct 2010 16:13:48 +0000 (17:13 +0100)
committerSteve Block <steveblock@google.com>
Wed, 27 Oct 2010 16:13:48 +0000 (17:13 +0100)
Requires a change to external/webkit ...
https://android-git.corp.google.com/g/76603

Bug: 3116410
Change-Id: Id0cd5871fd13f952d4f2aa963576a4e610459a18

core/java/android/webkit/CookieManager.java

index addea3e..dcac243 100644 (file)
@@ -427,6 +427,10 @@ public final class CookieManager {
      * @return The cookies in the format of NAME=VALUE [; NAME=VALUE]
      */
     public String getCookie(String url) {
+        if (useChromiumHttpStack()) {
+            return nativeGetCookie(url);
+        }
+
         WebAddress uri;
         try {
             uri = new WebAddress(url);
@@ -1045,6 +1049,7 @@ public final class CookieManager {
     // Native functions
     private static native boolean nativeUseChromiumHttpStack();
     private static native boolean nativeAcceptCookie();
+    private static native String nativeGetCookie(String url);
     private static native void nativeRemoveAllCookie();
     private static native void nativeSetAcceptCookie(boolean accept);
 }