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

Side by Side Diff: content/browser/ssl/ssl_policy.cc

Issue 2218253002: Stop revoking cert exceptions on resources loaded from cache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clearer comment Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « content/browser/ssl/ssl_manager.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/ssl/ssl_manager.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698