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

Unified Diff: android_webview/browser/aw_content_browser_client.cc

Issue 2869103002: [Android WebView] Propagate Java exceptions thrown in OnReceivedSslError (Closed)
Patch Set: Add comments to ssl_manager.h as well. Created 3 years, 7 months 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
Index: android_webview/browser/aw_content_browser_client.cc
diff --git a/android_webview/browser/aw_content_browser_client.cc b/android_webview/browser/aw_content_browser_client.cc
index 9d2ad2555099ee4ed200f6716c2d610426ed67ea..fd8125f886775f5f2fd3ad9b1f26da794496a0ea 100644
--- a/android_webview/browser/aw_content_browser_client.cc
+++ b/android_webview/browser/aw_content_browser_client.cc
@@ -388,12 +388,19 @@ void AwContentBrowserClient::AllowCertificateError(
AwContentsClientBridgeBase* client =
AwContentsClientBridgeBase::FromWebContents(web_contents);
bool cancel_request = true;
- if (client)
+ if (client) {
client->AllowCertificateError(cert_error,
ssl_info.cert.get(),
request_url,
callback,
&cancel_request);
+ if (client->HasPendingJavaException()) {
+ // If there is a pending Java exception we should return out to our Java
+ // handler as quickly as possible - and avoid calling back into Java
+ // through JNI.
+ return;
+ }
+ }
if (cancel_request)
callback.Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY);
}

Powered by Google App Engine
This is Rietveld 408576698