| Index: android_webview/java/src/org/chromium/android_webview/AwContentsClientBridge.java
|
| diff --git a/android_webview/java/src/org/chromium/android_webview/AwContentsClientBridge.java b/android_webview/java/src/org/chromium/android_webview/AwContentsClientBridge.java
|
| index a294913efc1270ead695e6a680faae6726f85b01..d5b68192edb5340944c3162d60318129a9d1a102 100644
|
| --- a/android_webview/java/src/org/chromium/android_webview/AwContentsClientBridge.java
|
| +++ b/android_webview/java/src/org/chromium/android_webview/AwContentsClientBridge.java
|
| @@ -7,6 +7,7 @@ package org.chromium.android_webview;
|
| import android.content.Context;
|
| import android.net.http.SslCertificate;
|
| import android.net.http.SslError;
|
| +import android.os.Handler;
|
| import android.util.Log;
|
| import android.webkit.ValueCallback;
|
|
|
| @@ -172,7 +173,7 @@ public class AwContentsClientBridge {
|
| return false;
|
| }
|
| final SslError sslError = SslUtil.sslErrorFromNetErrorCode(certError, cert, url);
|
| - ValueCallback<Boolean> callback = new ValueCallback<Boolean>() {
|
| + final ValueCallback<Boolean> callback = new ValueCallback<Boolean>() {
|
| @Override
|
| public void onReceiveValue(final Boolean value) {
|
| ThreadUtils.runOnUiThread(new Runnable() {
|
| @@ -183,7 +184,16 @@ public class AwContentsClientBridge {
|
| });
|
| }
|
| };
|
| - mClient.onReceivedSslError(callback, sslError);
|
| + // Post the application callback back to the current thread to ensure the application
|
| + // callback is executed without any native code on the stack. This so that any exception
|
| + // thrown by the application callback won't have to be propagated through a native call
|
| + // stack.
|
| + new Handler().post(new Runnable() {
|
| + @Override
|
| + public void run() {
|
| + mClient.onReceivedSslError(callback, sslError);
|
| + }
|
| + });
|
| return true;
|
| }
|
|
|
|
|