Commit b80c1e0d authored by Ryan Sleevi's avatar Ryan Sleevi Committed by Commit Bot

iOS: Avoid an unnecessary CertStatus <-> net::Error round trip

Rather than converting a net::CertStatus into a net:Error,
and then back from a net::Error into a net::CertStatus,
use the original net::CertStatus passed through the layers.

For iOS, we don't use the Chrome network stack for these
loads, and so there will only ever be an NSError and not a
net::Error.

Bug: 618799
Change-Id: Ic94c2e248e74651e78cb604421dd93c6067250be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1879796
Auto-Submit: Ryan Sleevi <rsleevi@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Ryan Sleevi <rsleevi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#709198}
parent 445f3596
......@@ -98,7 +98,7 @@ base::string16 WebViewWebClient::GetPluginNotSupportedText() const {
void WebViewWebClient::AllowCertificateError(
web::WebState* web_state,
int cert_error,
int net_error,
const net::SSLInfo& ssl_info,
const GURL& request_url,
bool overridable,
......@@ -110,10 +110,10 @@ void WebViewWebClient::AllowCertificateError(
SEL selector = @selector
(webView:didFailNavigationWithSSLError:overridable:decisionHandler:);
if ([web_view.navigationDelegate respondsToSelector:selector]) {
CWVCertStatus cert_status = CWVCertStatusFromNetCertStatus(
net::MapNetErrorToCertStatus(cert_error));
CWVCertStatus cert_status =
CWVCertStatusFromNetCertStatus(ssl_info.cert_status);
ssl_errors::ErrorInfo error_info = ssl_errors::ErrorInfo::CreateError(
ssl_errors::ErrorInfo::NetErrorToErrorType(cert_error),
ssl_errors::ErrorInfo::NetErrorToErrorType(net_error),
ssl_info.cert.get(), request_url);
NSString* error_description =
base::SysUTF16ToNSString(error_info.short_description());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment