Index: android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java |
diff --git a/android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java b/android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java |
index 8413a716660ff86c612dd634543b045ef2e7c1fe..54d1e79fb9efd2dce5648401a12d05416fef82c9 100644 |
--- a/android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java |
+++ b/android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java |
@@ -587,13 +587,43 @@ public class WebViewContentsClientAdapter extends AwContentsClient { |
description = mWebViewDelegate.getErrorString(mContext, errorCode); |
} |
if (TRACE) Log.d(TAG, "onReceivedError=" + failingUrl); |
- mWebViewClient.onReceivedError(mWebView, errorCode, description, failingUrl); |
+ // TODO(mnaganov): In the next version of glue, this will look as follows: |
+ // if (!<next-level-api>) { |
+ // mWebViewClient.onReceivedError(mWebView, errorCode, description, failingUrl); |
+ // } |
+ mWebViewClient.onReceivedError( |
+ mWebView, errorCode, description, failingUrl); |
} finally { |
TraceEvent.end("WebViewContentsClientAdapter.onReceivedError"); |
} |
} |
/** |
+ * @see ContentViewClient#onReceivedError( |
+ * AwContentsClient.AwWebResourceRequest,AwContentsClient.AwWebResourceError) |
+ */ |
+ @Override |
+ public void onReceivedError2(AwContentsClient.AwWebResourceRequest request, |
+ AwContentsClient.AwWebResourceError error) { |
+ try { |
+ TraceEvent.begin("WebViewContentsClientAdapter.onReceivedError2"); |
+ if (error.description == null || error.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. |
+ error.description = mWebViewDelegate.getErrorString(mContext, error.errorCode); |
Torne
2015/03/09 16:00:36
Is this costly at all? We might want to only do it
mnaganov (inactive)
2015/03/09 16:53:39
It goes into some reflection bullsh*t, so indeed l
|
+ } |
+ if (TRACE) Log.d(TAG, "onReceivedError2=" + request.url); |
+ // TODO(mnaganov): In the next version of glue, this will look as follows: |
+ // if (<next-level-api>) { |
+ // mWebViewClient.onReceivedError(request, error); |
+ // } |
+ } finally { |
+ TraceEvent.end("WebViewContentsClientAdapter.onReceivedError2"); |
+ } |
+ } |
+ |
+ /** |
* @see ContentViewClient#onReceivedTitle(String) |
*/ |
@Override |