diff options
author | Marcin Kosiba <mkosiba@google.com> | 2013-07-01 14:51:01 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-07-01 14:51:02 +0000 |
commit | ffa63216ba3a69255af88d436feb2f7d758cc321 (patch) | |
tree | 3935e3573a5d2148121979ef60793b52cd7ce63e /chromium/java/com/android/webview | |
parent | 3740f51cc627b7e9274f8614fe78962f259547b8 (diff) | |
parent | 7da9c0c080655cfd18bb4ab0937d89be4c2ca659 (diff) | |
download | webview-ffa63216ba3a69255af88d436feb2f7d758cc321.tar.gz |
Merge "Ensure that the description in onReceivedError is not null." into master-chromium
Diffstat (limited to 'chromium/java/com/android/webview')
-rw-r--r-- | chromium/java/com/android/webview/chromium/WebViewContentsClientAdapter.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/chromium/java/com/android/webview/chromium/WebViewContentsClientAdapter.java b/chromium/java/com/android/webview/chromium/WebViewContentsClientAdapter.java index 682bd67..9201798 100644 --- a/chromium/java/com/android/webview/chromium/WebViewContentsClientAdapter.java +++ b/chromium/java/com/android/webview/chromium/WebViewContentsClientAdapter.java @@ -21,6 +21,7 @@ import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.Picture; +import android.net.http.ErrorStrings; import android.net.http.SslError; import android.os.Handler; import android.os.Looper; @@ -403,6 +404,12 @@ public class WebViewContentsClientAdapter extends AwContentsClient { */ @Override public void onReceivedError(int errorCode, String description, String failingUrl) { + if (description == null || description.isEmpty()) { + // ErrorStrings is @hidden, so we can't do this in AwContents. + // Normally the net/ layer will set a valid description, but for synthesized callbacks + // (like in the case for intercepted requests) AwContents will pass in null. + description = ErrorStrings.getString(errorCode, mWebView.getContext()); + } mWebViewClient.onReceivedError(mWebView, errorCode, description, failingUrl); } |