Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2173)

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwHttpAuthHandler.java

Issue 11661013: Tell java side when the native auth handler is gone (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix2 Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/browser/aw_login_delegate.cc ('k') | android_webview/native/aw_http_auth_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « android_webview/browser/aw_login_delegate.cc ('k') | android_webview/native/aw_http_auth_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698