| 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 #ifndef NET_CERT_MULTI_THREADED_CERT_VERIFIER_H_ | 5 #ifndef NET_CERT_MULTI_THREADED_CERT_VERIFIER_H_ |
| 6 #define NET_CERT_MULTI_THREADED_CERT_VERIFIER_H_ | 6 #define NET_CERT_MULTI_THREADED_CERT_VERIFIER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 CertTrustAnchorProvider* trust_anchor_provider); | 54 CertTrustAnchorProvider* trust_anchor_provider); |
| 55 | 55 |
| 56 // CertVerifier implementation | 56 // CertVerifier implementation |
| 57 virtual int Verify(X509Certificate* cert, | 57 virtual int Verify(X509Certificate* cert, |
| 58 const std::string& hostname, | 58 const std::string& hostname, |
| 59 int flags, | 59 int flags, |
| 60 CRLSet* crl_set, | 60 CRLSet* crl_set, |
| 61 CertVerifyResult* verify_result, | 61 CertVerifyResult* verify_result, |
| 62 const CompletionCallback& callback, | 62 const CompletionCallback& callback, |
| 63 CertVerifier::RequestHandle* out_req, | 63 CertVerifier::RequestHandle* out_req, |
| 64 const BoundNetLog& net_log) OVERRIDE; | 64 const BoundNetLog& net_log) override; |
| 65 | 65 |
| 66 virtual void CancelRequest(CertVerifier::RequestHandle req) OVERRIDE; | 66 virtual void CancelRequest(CertVerifier::RequestHandle req) override; |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 friend class CertVerifierWorker; // Calls HandleResult. | 69 friend class CertVerifierWorker; // Calls HandleResult. |
| 70 friend class CertVerifierRequest; | 70 friend class CertVerifierRequest; |
| 71 friend class CertVerifierJob; | 71 friend class CertVerifierJob; |
| 72 friend class MultiThreadedCertVerifierTest; | 72 friend class MultiThreadedCertVerifierTest; |
| 73 FRIEND_TEST_ALL_PREFIXES(MultiThreadedCertVerifierTest, CacheHit); | 73 FRIEND_TEST_ALL_PREFIXES(MultiThreadedCertVerifierTest, CacheHit); |
| 74 FRIEND_TEST_ALL_PREFIXES(MultiThreadedCertVerifierTest, DifferentCACerts); | 74 FRIEND_TEST_ALL_PREFIXES(MultiThreadedCertVerifierTest, DifferentCACerts); |
| 75 FRIEND_TEST_ALL_PREFIXES(MultiThreadedCertVerifierTest, InflightJoin); | 75 FRIEND_TEST_ALL_PREFIXES(MultiThreadedCertVerifierTest, InflightJoin); |
| 76 FRIEND_TEST_ALL_PREFIXES(MultiThreadedCertVerifierTest, CancelRequest); | 76 FRIEND_TEST_ALL_PREFIXES(MultiThreadedCertVerifierTest, CancelRequest); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 CacheExpirationFunctor> CertVerifierCache; | 130 CacheExpirationFunctor> CertVerifierCache; |
| 131 | 131 |
| 132 void HandleResult(X509Certificate* cert, | 132 void HandleResult(X509Certificate* cert, |
| 133 const std::string& hostname, | 133 const std::string& hostname, |
| 134 int flags, | 134 int flags, |
| 135 const CertificateList& additional_trust_anchors, | 135 const CertificateList& additional_trust_anchors, |
| 136 int error, | 136 int error, |
| 137 const CertVerifyResult& verify_result); | 137 const CertVerifyResult& verify_result); |
| 138 | 138 |
| 139 // CertDatabase::Observer methods: | 139 // CertDatabase::Observer methods: |
| 140 virtual void OnCACertChanged(const X509Certificate* cert) OVERRIDE; | 140 virtual void OnCACertChanged(const X509Certificate* cert) override; |
| 141 | 141 |
| 142 // For unit testing. | 142 // For unit testing. |
| 143 void ClearCache() { cache_.Clear(); } | 143 void ClearCache() { cache_.Clear(); } |
| 144 size_t GetCacheSize() const { return cache_.size(); } | 144 size_t GetCacheSize() const { return cache_.size(); } |
| 145 uint64 cache_hits() const { return cache_hits_; } | 145 uint64 cache_hits() const { return cache_hits_; } |
| 146 uint64 requests() const { return requests_; } | 146 uint64 requests() const { return requests_; } |
| 147 uint64 inflight_joins() const { return inflight_joins_; } | 147 uint64 inflight_joins() const { return inflight_joins_; } |
| 148 | 148 |
| 149 // cache_ maps from a request to a cached result. | 149 // cache_ maps from a request to a cached result. |
| 150 CertVerifierCache cache_; | 150 CertVerifierCache cache_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 163 scoped_refptr<CertVerifyProc> verify_proc_; | 163 scoped_refptr<CertVerifyProc> verify_proc_; |
| 164 | 164 |
| 165 CertTrustAnchorProvider* trust_anchor_provider_; | 165 CertTrustAnchorProvider* trust_anchor_provider_; |
| 166 | 166 |
| 167 DISALLOW_COPY_AND_ASSIGN(MultiThreadedCertVerifier); | 167 DISALLOW_COPY_AND_ASSIGN(MultiThreadedCertVerifier); |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 } // namespace net | 170 } // namespace net |
| 171 | 171 |
| 172 #endif // NET_CERT_MULTI_THREADED_CERT_VERIFIER_H_ | 172 #endif // NET_CERT_MULTI_THREADED_CERT_VERIFIER_H_ |
| OLD | NEW |