OSDN Git Service

Hook up CookieManager.acceptCookie() and setAcceptCookie() for the Chromium HTTP...
authorSteve Block <steveblock@google.com>
Mon, 25 Oct 2010 11:23:20 +0000 (12:23 +0100)
committerSteve Block <steveblock@google.com>
Wed, 27 Oct 2010 13:06:54 +0000 (14:06 +0100)
Also requires a change to external/webkit ...
https://android-git.corp.google.com/g/76066

Bug: 3116410
Change-Id: If8562468708e7d68c5be53db3860647687ebf3bd

core/java/android/webkit/CookieManager.java

index 3010178..addea3e 100644 (file)
@@ -273,6 +273,11 @@ public final class CookieManager {
      * @param accept TRUE if accept cookie
      */
     public synchronized void setAcceptCookie(boolean accept) {
+        if (useChromiumHttpStack()) {
+            nativeSetAcceptCookie(accept);
+            return;
+        }
+
         mAcceptCookie = accept;
     }
 
@@ -281,6 +286,10 @@ public final class CookieManager {
      * @return TRUE if accept cookie
      */
     public synchronized boolean acceptCookie() {
+        if (useChromiumHttpStack()) {
+            return nativeAcceptCookie();
+        }
+
         return mAcceptCookie;
     }
 
@@ -1035,5 +1044,7 @@ public final class CookieManager {
 
     // Native functions
     private static native boolean nativeUseChromiumHttpStack();
+    private static native boolean nativeAcceptCookie();
     private static native void nativeRemoveAllCookie();
+    private static native void nativeSetAcceptCookie(boolean accept);
 }