| 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 25 matching lines...) Expand all Loading... |
| 36 SSL_GOOD_CERT_SEEN_EVENT_MAX = 2 | 36 SSL_GOOD_CERT_SEEN_EVENT_MAX = 2 |
| 37 }; | 37 }; |
| 38 } | 38 } |
| 39 | 39 |
| 40 SSLPolicy::SSLPolicy(SSLPolicyBackend* backend) | 40 SSLPolicy::SSLPolicy(SSLPolicyBackend* backend) |
| 41 : backend_(backend) { | 41 : backend_(backend) { |
| 42 DCHECK(backend_); | 42 DCHECK(backend_); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void SSLPolicy::OnCertError(SSLCertErrorHandler* handler) { | 45 void SSLPolicy::OnCertError(SSLCertErrorHandler* handler) { |
| 46 bool expired_previous_decision; | 46 bool expired_previous_decision = false; |
| 47 // First we check if we know the policy for this error. | 47 // First we check if we know the policy for this error. |
| 48 DCHECK(handler->ssl_info().is_valid()); | 48 DCHECK(handler->ssl_info().is_valid()); |
| 49 SSLHostStateDelegate::CertJudgment judgment = | 49 SSLHostStateDelegate::CertJudgment judgment = |
| 50 backend_->QueryPolicy(*handler->ssl_info().cert.get(), | 50 backend_->QueryPolicy(*handler->ssl_info().cert.get(), |
| 51 handler->request_url().host(), | 51 handler->request_url().host(), |
| 52 handler->cert_error(), | 52 handler->cert_error(), |
| 53 &expired_previous_decision); | 53 &expired_previous_decision); |
| 54 | 54 |
| 55 if (judgment == SSLHostStateDelegate::ALLOWED) { | 55 if (judgment == SSLHostStateDelegate::ALLOWED) { |
| 56 handler->ContinueRequest(); | 56 handler->ContinueRequest(); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 entry->GetURL(), entry->GetSSL().cert_id, entry->GetSSL().cert_status); | 259 entry->GetURL(), entry->GetSSL().cert_id, entry->GetSSL().cert_status); |
| 260 } | 260 } |
| 261 | 261 |
| 262 void SSLPolicy::OriginRanInsecureContent(const std::string& origin, int pid) { | 262 void SSLPolicy::OriginRanInsecureContent(const std::string& origin, int pid) { |
| 263 GURL parsed_origin(origin); | 263 GURL parsed_origin(origin); |
| 264 if (parsed_origin.SchemeIsCryptographic()) | 264 if (parsed_origin.SchemeIsCryptographic()) |
| 265 backend_->HostRanInsecureContent(parsed_origin.host(), pid); | 265 backend_->HostRanInsecureContent(parsed_origin.host(), pid); |
| 266 } | 266 } |
| 267 | 267 |
| 268 } // namespace content | 268 } // namespace content |
| OLD | NEW |