| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/ssl/ssl_policy.h" | 5 #include "content/browser/ssl/ssl_policy.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // If the scheme is https: or wss: *and* the security info for the | 156 // If the scheme is https: or wss: *and* the security info for the |
| 157 // cert has been set (i.e. the cert id is not 0) and the cert did | 157 // cert has been set (i.e. the cert id is not 0) and the cert did |
| 158 // not have any errors, revoke any previous decisions that | 158 // not have any errors, revoke any previous decisions that |
| 159 // have occurred. If the cert info has not been set, do nothing since it | 159 // have occurred. If the cert info has not been set, do nothing since it |
| 160 // isn't known if the connection was actually a valid connection or if it | 160 // isn't known if the connection was actually a valid connection or if it |
| 161 // had a cert error. | 161 // had a cert error. |
| 162 SSLGoodCertSeenEvent event = NO_PREVIOUS_EXCEPTION; | 162 SSLGoodCertSeenEvent event = NO_PREVIOUS_EXCEPTION; |
| 163 if (backend_->HasAllowException(url.host())) { | 163 if (backend_->HasAllowException(url.host())) { |
| 164 // If there's no certificate error, a good certificate has been seen, so | 164 // If there's no certificate error, a good certificate has been seen, so |
| 165 // clear out any exceptions that were made by the user for bad | 165 // clear out any exceptions that were made by the user for bad |
| 166 // certificates. | 166 // certificates. This intentionally does not apply to cached resources |
| 167 // (see https://crbug.com/634553 for an explanation). |
| 167 backend_->RevokeUserAllowExceptions(url.host()); | 168 backend_->RevokeUserAllowExceptions(url.host()); |
| 168 event = HAD_PREVIOUS_EXCEPTION; | 169 event = HAD_PREVIOUS_EXCEPTION; |
| 169 } | 170 } |
| 170 UMA_HISTOGRAM_ENUMERATION("interstitial.ssl.good_cert_seen", event, | 171 UMA_HISTOGRAM_ENUMERATION("interstitial.ssl.good_cert_seen", event, |
| 171 SSL_GOOD_CERT_SEEN_EVENT_MAX); | 172 SSL_GOOD_CERT_SEEN_EVENT_MAX); |
| 172 } | 173 } |
| 173 } | 174 } |
| 174 | 175 |
| 175 void SSLPolicy::UpdateEntry(NavigationEntryImpl* entry, | 176 void SSLPolicy::UpdateEntry(NavigationEntryImpl* entry, |
| 176 WebContents* web_contents) { | 177 WebContents* web_contents) { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 | 245 |
| 245 void SSLPolicy::InitializeEntryIfNeeded(NavigationEntryImpl* entry) { | 246 void SSLPolicy::InitializeEntryIfNeeded(NavigationEntryImpl* entry) { |
| 246 if (entry->GetSSL().security_style != SECURITY_STYLE_UNKNOWN) | 247 if (entry->GetSSL().security_style != SECURITY_STYLE_UNKNOWN) |
| 247 return; | 248 return; |
| 248 | 249 |
| 249 entry->GetSSL().security_style = GetSecurityStyleForResource( | 250 entry->GetSSL().security_style = GetSecurityStyleForResource( |
| 250 entry->GetURL(), entry->GetSSL().cert_id, entry->GetSSL().cert_status); | 251 entry->GetURL(), entry->GetSSL().cert_id, entry->GetSSL().cert_status); |
| 251 } | 252 } |
| 252 | 253 |
| 253 } // namespace content | 254 } // namespace content |
| OLD | NEW |