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 | 156 |
157 SiteInstance* site_instance = entry->site_instance(); | 157 SiteInstance* site_instance = entry->site_instance(); |
158 if (!site_instance) | 158 if (!site_instance) |
159 return; | 159 return; |
160 | 160 |
161 backend_->HostRanContentWithCertErrors(security_origin.host(), | 161 backend_->HostRanContentWithCertErrors(security_origin.host(), |
162 site_instance->GetProcess()->GetID()); | 162 site_instance->GetProcess()->GetID()); |
163 } | 163 } |
164 | 164 |
165 void SSLPolicy::OnRequestStarted(const GURL& url, | 165 void SSLPolicy::OnRequestStarted(const GURL& url, |
166 int cert_id, | 166 bool has_certificate, |
167 net::CertStatus cert_status) { | 167 net::CertStatus cert_status) { |
168 if (cert_id && url.SchemeIsCryptographic() && | 168 if (has_certificate && url.SchemeIsCryptographic() && |
169 !net::IsCertStatusError(cert_status)) { | 169 !net::IsCertStatusError(cert_status)) { |
170 // If the scheme is https: or wss: *and* the security info for the | 170 // If the scheme is https: or wss: *and* the security info for the |
171 // cert has been set (i.e. the cert id is not 0) and the cert did | 171 // cert has been set (i.e. the cert id is not 0) and the cert did |
172 // not have any errors, revoke any previous decisions that | 172 // not have any errors, revoke any previous decisions that |
173 // have occurred. If the cert info has not been set, do nothing since it | 173 // have occurred. If the cert info has not been set, do nothing since it |
174 // isn't known if the connection was actually a valid connection or if it | 174 // isn't known if the connection was actually a valid connection or if it |
175 // had a cert error. | 175 // had a cert error. |
176 SSLGoodCertSeenEvent event = NO_PREVIOUS_EXCEPTION; | 176 SSLGoodCertSeenEvent event = NO_PREVIOUS_EXCEPTION; |
177 if (backend_->HasAllowException(url.host())) { | 177 if (backend_->HasAllowException(url.host())) { |
178 // If there's no certificate error, a good certificate has been seen, so | 178 // If there's no certificate error, a good certificate has been seen, so |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 web_contents, cert_error, ssl_info, request_url, resource_type, | 252 web_contents, cert_error, ssl_info, request_url, resource_type, |
253 overridable, strict_enforcement, expired_previous_decision, | 253 overridable, strict_enforcement, expired_previous_decision, |
254 base::Bind(&OnAllowCertificate, base::Owned(handler.release()), this)); | 254 base::Bind(&OnAllowCertificate, base::Owned(handler.release()), this)); |
255 } | 255 } |
256 | 256 |
257 void SSLPolicy::InitializeEntryIfNeeded(NavigationEntryImpl* entry) { | 257 void SSLPolicy::InitializeEntryIfNeeded(NavigationEntryImpl* entry) { |
258 if (entry->GetSSL().security_style != SECURITY_STYLE_UNKNOWN) | 258 if (entry->GetSSL().security_style != SECURITY_STYLE_UNKNOWN) |
259 return; | 259 return; |
260 | 260 |
261 entry->GetSSL().security_style = GetSecurityStyleForResource( | 261 entry->GetSSL().security_style = GetSecurityStyleForResource( |
262 entry->GetURL(), !!entry->GetSSL().cert_id, entry->GetSSL().cert_status); | 262 entry->GetURL(), !!entry->GetSSL().certificate, |
| 263 entry->GetSSL().cert_status); |
263 } | 264 } |
264 | 265 |
265 } // namespace content | 266 } // namespace content |
OLD | NEW |