| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_host_state.h" | 5 #include "content/browser/ssl/ssl_host_state.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "content/public/browser/browser_context.h" | 9 #include "content/public/browser/browser_context.h" |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 cert_policy_for_host_[host].Deny(cert); | 43 cert_policy_for_host_[host].Deny(cert); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void SSLHostState::AllowCertForHost(net::X509Certificate* cert, | 46 void SSLHostState::AllowCertForHost(net::X509Certificate* cert, |
| 47 const std::string& host) { | 47 const std::string& host) { |
| 48 DCHECK(CalledOnValidThread()); | 48 DCHECK(CalledOnValidThread()); |
| 49 | 49 |
| 50 cert_policy_for_host_[host].Allow(cert); | 50 cert_policy_for_host_[host].Allow(cert); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void SSLHostState::Clear() { |
| 54 DCHECK(CalledOnValidThread()); |
| 55 |
| 56 cert_policy_for_host_.clear(); |
| 57 } |
| 58 |
| 53 net::CertPolicy::Judgment SSLHostState::QueryPolicy( | 59 net::CertPolicy::Judgment SSLHostState::QueryPolicy( |
| 54 net::X509Certificate* cert, const std::string& host) { | 60 net::X509Certificate* cert, const std::string& host) { |
| 55 DCHECK(CalledOnValidThread()); | 61 DCHECK(CalledOnValidThread()); |
| 56 | 62 |
| 57 return cert_policy_for_host_[host].Check(cert); | 63 return cert_policy_for_host_[host].Check(cert); |
| 58 } | 64 } |
| OLD | NEW |