OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "net/cert/caching_cert_verifier.h" | 5 #include "net/cert/caching_cert_verifier.h" |
6 | 6 |
7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
8 #include "net/base/net_errors.h" | 8 #include "net/base/net_errors.h" |
9 | 9 |
10 namespace net { | 10 namespace net { |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 CachingCertVerifier::~CachingCertVerifier() { | 30 CachingCertVerifier::~CachingCertVerifier() { |
31 CertDatabase::GetInstance()->RemoveObserver(this); | 31 CertDatabase::GetInstance()->RemoveObserver(this); |
32 } | 32 } |
33 | 33 |
34 int CachingCertVerifier::Verify(const CertVerifier::RequestParams& params, | 34 int CachingCertVerifier::Verify(const CertVerifier::RequestParams& params, |
35 CRLSet* crl_set, | 35 CRLSet* crl_set, |
36 CertVerifyResult* verify_result, | 36 CertVerifyResult* verify_result, |
37 const CompletionCallback& callback, | 37 const CompletionCallback& callback, |
38 std::unique_ptr<Request>* out_req, | 38 std::unique_ptr<Request>* out_req, |
39 const BoundNetLog& net_log) { | 39 const NetLogWithSource& net_log) { |
40 out_req->reset(); | 40 out_req->reset(); |
41 | 41 |
42 requests_++; | 42 requests_++; |
43 | 43 |
44 const CertVerificationCache::value_type* cached_entry = | 44 const CertVerificationCache::value_type* cached_entry = |
45 cache_.Get(params, CacheValidityPeriod(base::Time::Now())); | 45 cache_.Get(params, CacheValidityPeriod(base::Time::Now())); |
46 if (cached_entry) { | 46 if (cached_entry) { |
47 ++cache_hits_; | 47 ++cache_hits_; |
48 *verify_result = cached_entry->result; | 48 *verify_result = cached_entry->result; |
49 return cached_entry->error; | 49 return cached_entry->error; |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 204 |
205 void CachingCertVerifier::ClearCache() { | 205 void CachingCertVerifier::ClearCache() { |
206 cache_.Clear(); | 206 cache_.Clear(); |
207 } | 207 } |
208 | 208 |
209 size_t CachingCertVerifier::GetCacheSize() const { | 209 size_t CachingCertVerifier::GetCacheSize() const { |
210 return cache_.size(); | 210 return cache_.size(); |
211 } | 211 } |
212 | 212 |
213 } // namespace net | 213 } // namespace net |
OLD | NEW |