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_BASE_MULTI_THREADED_CERT_VERIFIER_H_ | 5 #ifndef NET_BASE_MULTI_THREADED_CERT_VERIFIER_H_ |
6 #define NET_BASE_MULTI_THREADED_CERT_VERIFIER_H_ | 6 #define NET_BASE_MULTI_THREADED_CERT_VERIFIER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 friend class CertVerifierJob; | 58 friend class CertVerifierJob; |
59 friend class MultiThreadedCertVerifierTest; | 59 friend class MultiThreadedCertVerifierTest; |
60 FRIEND_TEST_ALL_PREFIXES(MultiThreadedCertVerifierTest, CacheHit); | 60 FRIEND_TEST_ALL_PREFIXES(MultiThreadedCertVerifierTest, CacheHit); |
61 FRIEND_TEST_ALL_PREFIXES(MultiThreadedCertVerifierTest, DifferentCACerts); | 61 FRIEND_TEST_ALL_PREFIXES(MultiThreadedCertVerifierTest, DifferentCACerts); |
62 FRIEND_TEST_ALL_PREFIXES(MultiThreadedCertVerifierTest, InflightJoin); | 62 FRIEND_TEST_ALL_PREFIXES(MultiThreadedCertVerifierTest, InflightJoin); |
63 FRIEND_TEST_ALL_PREFIXES(MultiThreadedCertVerifierTest, CancelRequest); | 63 FRIEND_TEST_ALL_PREFIXES(MultiThreadedCertVerifierTest, CancelRequest); |
64 FRIEND_TEST_ALL_PREFIXES(MultiThreadedCertVerifierTest, | 64 FRIEND_TEST_ALL_PREFIXES(MultiThreadedCertVerifierTest, |
65 RequestParamsComparators); | 65 RequestParamsComparators); |
66 | 66 |
67 // Input parameters of a certificate verification request. | 67 // Input parameters of a certificate verification request. |
68 struct RequestParams { | 68 struct NET_EXPORT_PRIVATE RequestParams { |
69 RequestParams(const SHA1Fingerprint& cert_fingerprint_arg, | 69 RequestParams(const SHA1Fingerprint& cert_fingerprint_arg, |
70 const SHA1Fingerprint& ca_fingerprint_arg, | 70 const SHA1Fingerprint& ca_fingerprint_arg, |
71 const std::string& hostname_arg, | 71 const std::string& hostname_arg, |
72 int flags_arg) | 72 int flags_arg); |
73 : cert_fingerprint(cert_fingerprint_arg), | |
74 ca_fingerprint(ca_fingerprint_arg), | |
75 hostname(hostname_arg), | |
76 flags(flags_arg) {} | |
77 | 73 |
78 bool operator<(const RequestParams& other) const { | 74 bool operator<(const RequestParams& other) const { |
79 // |flags| is compared before |cert_fingerprint|, |ca_fingerprint|, and | 75 // |flags| is compared before |cert_fingerprint|, |ca_fingerprint|, and |
80 // |hostname| under assumption that integer comparisons are faster than | 76 // |hostname| under assumption that integer comparisons are faster than |
81 // memory and string comparisons. | 77 // memory and string comparisons. |
82 if (flags != other.flags) | 78 if (flags != other.flags) |
83 return flags < other.flags; | 79 return flags < other.flags; |
84 int rv = memcmp(cert_fingerprint.data, other.cert_fingerprint.data, | 80 int rv = memcmp(cert_fingerprint.data, other.cert_fingerprint.data, |
85 sizeof(cert_fingerprint.data)); | 81 sizeof(cert_fingerprint.data)); |
86 if (rv != 0) | 82 if (rv != 0) |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 uint64 inflight_joins_; | 157 uint64 inflight_joins_; |
162 | 158 |
163 scoped_refptr<CertVerifyProc> verify_proc_; | 159 scoped_refptr<CertVerifyProc> verify_proc_; |
164 | 160 |
165 DISALLOW_COPY_AND_ASSIGN(MultiThreadedCertVerifier); | 161 DISALLOW_COPY_AND_ASSIGN(MultiThreadedCertVerifier); |
166 }; | 162 }; |
167 | 163 |
168 } // namespace net | 164 } // namespace net |
169 | 165 |
170 #endif // NET_BASE_MULTI_THREADED_CERT_VERIFIER_H_ | 166 #endif // NET_BASE_MULTI_THREADED_CERT_VERIFIER_H_ |
OLD | NEW |