Index: android_webview/java/src/org/chromium/android_webview/AwHttpAuthHandler.java |
diff --git a/android_webview/java/src/org/chromium/android_webview/AwHttpAuthHandler.java b/android_webview/java/src/org/chromium/android_webview/AwHttpAuthHandler.java |
index a7fc3393eb16f937fe5abe587f3969777bca13d2..5e5a9f1a45c6c74d36ac9f332624c348029fa543 100644 |
--- a/android_webview/java/src/org/chromium/android_webview/AwHttpAuthHandler.java |
+++ b/android_webview/java/src/org/chromium/android_webview/AwHttpAuthHandler.java |
@@ -11,14 +11,20 @@ import org.chromium.base.JNINamespace; |
public class AwHttpAuthHandler { |
private int mNativeAwHttpAuthHandler; |
- private boolean mFirstAttempt; |
+ private final boolean mFirstAttempt; |
public void proceed(String username, String password) { |
- nativeProceed(mNativeAwHttpAuthHandler, username, password); |
+ if (mNativeAwHttpAuthHandler != 0) { |
+ nativeProceed(mNativeAwHttpAuthHandler, username, password); |
+ mNativeAwHttpAuthHandler = 0; |
+ } |
} |
public void cancel() { |
- nativeCancel(mNativeAwHttpAuthHandler); |
+ if (mNativeAwHttpAuthHandler != 0) { |
+ nativeCancel(mNativeAwHttpAuthHandler); |
+ mNativeAwHttpAuthHandler = 0; |
+ } |
} |
public boolean isFirstAttempt() { |
@@ -35,6 +41,11 @@ public class AwHttpAuthHandler { |
mFirstAttempt = firstAttempt; |
} |
+ @CalledByNative |
+ void handlerDestroyed() { |
+ mNativeAwHttpAuthHandler = 0; |
+ } |
+ |
private native void nativeProceed(int nativeAwHttpAuthHandler, |
String username, String password); |
private native void nativeCancel(int nativeAwHttpAuthHandler); |