* @param value The value for set-cookie: in http response header
*/
public void setCookie(String url, String value) {
+ if (useChromiumHttpStack()) {
+ nativeSetCookie(url, value);
+ return;
+ }
+
WebAddress uri;
try {
uri = new WebAddress(url);
* Remove all session cookies, which are cookies without expiration date
*/
public void removeSessionCookie() {
+ if (useChromiumHttpStack()) {
+ nativeRemoveSessionCookie();
+ return;
+ }
+
final Runnable clearCache = new Runnable() {
public void run() {
synchronized(CookieManager.this) {
* Return true if there are stored cookies.
*/
public synchronized boolean hasCookies() {
+ if (useChromiumHttpStack()) {
+ return nativeHasCookies();
+ }
+
return CookieSyncManager.getInstance().hasCookies();
}
* Remove all expired cookies
*/
public void removeExpiredCookie() {
+ if (useChromiumHttpStack()) {
+ nativeRemoveExpiredCookie();
+ return;
+ }
+
final Runnable clearCache = new Runnable() {
public void run() {
synchronized(CookieManager.this) {
private static native boolean nativeUseChromiumHttpStack();
private static native boolean nativeAcceptCookie();
private static native String nativeGetCookie(String url);
+ private static native boolean nativeHasCookies();
private static native void nativeRemoveAllCookie();
+ private static native void nativeRemoveExpiredCookie();
+ private static native void nativeRemoveSessionCookie();
private static native void nativeSetAcceptCookie(boolean accept);
+ private static native void nativeSetCookie(String url, String value);
}