From 018d0db613993f7ec1b08eb0c7543e0111e242ed Mon Sep 17 00:00:00 2001 From: eugenebut Date: Thu, 5 Nov 2015 18:50:33 -0800 Subject: [ios] UMA metric to report cache hit/miss for WKWebView cert verification. WKWebView Web Controller has a cache of pending cert verification results to avoid extra verifications when presenting SSL interstitial. This metric helps to understand whether or not cache miss is possible. BUG=541736 Review URL: https://codereview.chromium.org/1414793014 Cr-Commit-Position: refs/heads/master@{#358240} --- ios/web/web_state/ui/crw_wk_web_view_web_controller.mm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ios') diff --git a/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm b/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm index e901ad81..d85fdb7 100644 --- a/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm +++ b/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm @@ -962,12 +962,13 @@ WKWebViewErrorSource WKWebViewErrorSourceFromError(NSError* error) { if (leafCert) { auto error = _certVerificationErrors->Get( {leafCert, base::SysNSStringToUTF8(host)}); - if (error != _certVerificationErrors->end()) { + bool cacheHit = error != _certVerificationErrors->end(); + if (cacheHit) { status.cert_status = error->second.status; recoverable = error->second.is_recoverable; - } else { - // TODO(eugenebut): Report UMA with cache size (crbug.com/541736). } + UMA_HISTOGRAM_BOOLEAN("WebController.CertVerificationErrorsCacheHit", + cacheHit); } } -- cgit v1.1