| 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 #ifndef NET_CERT_CACHING_CERT_VERIFIER_H_ | 5 #ifndef NET_CERT_CACHING_CERT_VERIFIER_H_ |
| 6 #define NET_CERT_CACHING_CERT_VERIFIER_H_ | 6 #define NET_CERT_CACHING_CERT_VERIFIER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "net/base/expiring_cache.h" | 10 #include "net/base/expiring_cache.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 explicit CachingCertVerifier(std::unique_ptr<CertVerifier> verifier); | 55 explicit CachingCertVerifier(std::unique_ptr<CertVerifier> verifier); |
| 56 | 56 |
| 57 ~CachingCertVerifier() override; | 57 ~CachingCertVerifier() override; |
| 58 | 58 |
| 59 // CertVerifier implementation: | 59 // CertVerifier implementation: |
| 60 int Verify(const RequestParams& params, | 60 int Verify(const RequestParams& params, |
| 61 CRLSet* crl_set, | 61 CRLSet* crl_set, |
| 62 CertVerifyResult* verify_result, | 62 CertVerifyResult* verify_result, |
| 63 const CompletionCallback& callback, | 63 const CompletionCallback& callback, |
| 64 std::unique_ptr<Request>* out_req, | 64 std::unique_ptr<Request>* out_req, |
| 65 const BoundNetLog& net_log) override; | 65 const NetLogWithSource& net_log) override; |
| 66 bool SupportsOCSPStapling() override; | 66 bool SupportsOCSPStapling() override; |
| 67 | 67 |
| 68 // Opportunistically attempts to add |error| and |verify_result| as the | 68 // Opportunistically attempts to add |error| and |verify_result| as the |
| 69 // result for |params|, which was obtained at |verification_time| and | 69 // result for |params|, which was obtained at |verification_time| and |
| 70 // expires at |expiration_time|. | 70 // expires at |expiration_time|. |
| 71 // This is opportunistic because it is not guaranteed that the entry | 71 // This is opportunistic because it is not guaranteed that the entry |
| 72 // will be added (such as if the cache is full or an entry already | 72 // will be added (such as if the cache is full or an entry already |
| 73 // exists). | 73 // exists). |
| 74 // Returns true if the entry was added. | 74 // Returns true if the entry was added. |
| 75 bool AddEntry(const RequestParams& params, | 75 bool AddEntry(const RequestParams& params, |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 uint64_t requests_; | 159 uint64_t requests_; |
| 160 uint64_t cache_hits_; | 160 uint64_t cache_hits_; |
| 161 | 161 |
| 162 DISALLOW_COPY_AND_ASSIGN(CachingCertVerifier); | 162 DISALLOW_COPY_AND_ASSIGN(CachingCertVerifier); |
| 163 }; | 163 }; |
| 164 | 164 |
| 165 } // namespace net | 165 } // namespace net |
| 166 | 166 |
| 167 #endif // NET_CERT_CACHING_CERT_VERIFIER_H_ | 167 #endif // NET_CERT_CACHING_CERT_VERIFIER_H_ |
| OLD | NEW |