Chromium Code Reviews| Index: content/browser/ssl/ssl_policy.cc |
| diff --git a/content/browser/ssl/ssl_policy.cc b/content/browser/ssl/ssl_policy.cc |
| index 610f741dd98f65e6dd77777a0f63a98029536393..8ced8a960b3a096483fe2c3e752c3dac984e8f51 100644 |
| --- a/content/browser/ssl/ssl_policy.cc |
| +++ b/content/browser/ssl/ssl_policy.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/bind.h" |
| #include "base/command_line.h" |
| #include "base/memory/singleton.h" |
| +#include "base/metrics/histogram_macros.h" |
| #include "base/strings/string_piece.h" |
| #include "base/strings/string_util.h" |
| #include "content/browser/frame_host/navigation_entry_impl.h" |
| @@ -26,6 +27,17 @@ |
| namespace content { |
| +namespace { |
| + |
| +// Events for UMA. Do not reorder or change! |
| +enum SSLGoodCertSeenEvent { |
| + NO_PREVIOUS_EXCEPTION = 0, |
| + HAD_PREVIOUS_EXCEPTION = 1, |
| + END_OF_SSL_GOOD_CERT_SEEN_EVENT = 2 |
| +}; |
| + |
| +} |
| + |
| SSLPolicy::SSLPolicy(SSLPolicyBackend* backend) |
| : backend_(backend) { |
| DCHECK(backend_); |
| @@ -110,8 +122,19 @@ void SSLPolicy::OnRequestStarted(SSLRequestInfo* info) { |
| // this information back through WebKit and out some FrameLoaderClient |
| // methods. |
| - if (net::IsCertStatusError(info->ssl_cert_status())) |
| + if (net::IsCertStatusError(info->ssl_cert_status())) { |
| backend_->HostRanInsecureContent(info->url().host(), info->child_id()); |
| + } else { |
| + SSLGoodCertSeenEvent event = NO_PREVIOUS_EXCEPTION; |
| + if (backend_->HasAllowException(info->url().host())) |
| + event = HAD_PREVIOUS_EXCEPTION; |
| + UMA_HISTOGRAM_ENUMERATION("interstitial.ssl.good_cert_seen", event, |
| + END_OF_SSL_GOOD_CERT_SEEN_EVENT); |
| + |
| + // If there's no certificate error, a good certificate has been seen, so |
| + // clear out any exceptions that were made by the user for bad certificates. |
| + backend_->RevokeUserAllowExceptions(info->url().host()); |
|
felt
2015/04/17 19:58:03
is there a specific reason why this needs to be do
jww
2015/04/17 20:16:06
Nope. Moved into the if block.
|
| + } |
| } |
| void SSLPolicy::UpdateEntry(NavigationEntryImpl* entry, |