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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
225 | 225 |
226 void SSLPolicy::OnCertErrorInternal(SSLCertErrorHandler* handler, | 226 void SSLPolicy::OnCertErrorInternal(SSLCertErrorHandler* handler, |
227 int options_mask) { | 227 int options_mask) { |
228 bool overridable = (options_mask & OVERRIDABLE) != 0; | 228 bool overridable = (options_mask & OVERRIDABLE) != 0; |
229 bool strict_enforcement = (options_mask & STRICT_ENFORCEMENT) != 0; | 229 bool strict_enforcement = (options_mask & STRICT_ENFORCEMENT) != 0; |
230 bool expired_previous_decision = | 230 bool expired_previous_decision = |
231 (options_mask & EXPIRED_PREVIOUS_DECISION) != 0; | 231 (options_mask & EXPIRED_PREVIOUS_DECISION) != 0; |
232 CertificateRequestResultType result = | 232 CertificateRequestResultType result = |
233 CERTIFICATE_REQUEST_RESULT_TYPE_CONTINUE; | 233 CERTIFICATE_REQUEST_RESULT_TYPE_CONTINUE; |
234 GetContentClient()->browser()->AllowCertificateError( | 234 GetContentClient()->browser()->AllowCertificateError( |
235 handler->render_process_id(), | 235 handler->web_contents_getter(), |
davidben
2015/11/19 17:46:13
Wow, this code is all kinds of silly. This gets ca
davidben
2015/11/19 17:50:25
Oh! And even SSLPolicy is a per-WebContents object
clamy
2015/11/20 13:50:43
Done. I now expose the manager from the handler, a
| |
236 handler->render_frame_id(), | |
237 handler->cert_error(), | 236 handler->cert_error(), |
238 handler->ssl_info(), | 237 handler->ssl_info(), |
239 handler->request_url(), | 238 handler->request_url(), |
240 handler->resource_type(), | 239 handler->resource_type(), |
241 overridable, | 240 overridable, |
242 strict_enforcement, | 241 strict_enforcement, |
243 expired_previous_decision, | 242 expired_previous_decision, |
244 base::Bind(&SSLPolicy::OnAllowCertificate, | 243 base::Bind(&SSLPolicy::OnAllowCertificate, |
245 base::Unretained(this), | 244 base::Unretained(this), |
246 make_scoped_refptr(handler)), | 245 make_scoped_refptr(handler)), |
(...skipping 20 matching lines...) Expand all Loading... | |
267 entry->GetURL(), entry->GetSSL().cert_id, entry->GetSSL().cert_status); | 266 entry->GetURL(), entry->GetSSL().cert_id, entry->GetSSL().cert_status); |
268 } | 267 } |
269 | 268 |
270 void SSLPolicy::OriginRanInsecureContent(const std::string& origin, int pid) { | 269 void SSLPolicy::OriginRanInsecureContent(const std::string& origin, int pid) { |
271 GURL parsed_origin(origin); | 270 GURL parsed_origin(origin); |
272 if (parsed_origin.SchemeIsCryptographic()) | 271 if (parsed_origin.SchemeIsCryptographic()) |
273 backend_->HostRanInsecureContent(parsed_origin.host(), pid); | 272 backend_->HostRanInsecureContent(parsed_origin.host(), pid); |
274 } | 273 } |
275 | 274 |
276 } // namespace content | 275 } // namespace content |
OLD | NEW |