Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: net/cert/multi_threaded_cert_verifier.h

Issue 27500004: Listen for new system certificates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Follow review. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 OnCertTrustChanged(const X509Certificate* cert) OVERRIDE; 140 virtual void OnCertTrustChanged(const X509Certificate* cert) OVERRIDE;
141 virtual void OnDatabaseChanged() OVERRIDE;
141 142
142 // For unit testing. 143 // For unit testing.
143 void ClearCache() { cache_.Clear(); } 144 void ClearCache() { cache_.Clear(); }
144 size_t GetCacheSize() const { return cache_.size(); } 145 size_t GetCacheSize() const { return cache_.size(); }
145 uint64 cache_hits() const { return cache_hits_; } 146 uint64 cache_hits() const { return cache_hits_; }
146 uint64 requests() const { return requests_; } 147 uint64 requests() const { return requests_; }
147 uint64 inflight_joins() const { return inflight_joins_; } 148 uint64 inflight_joins() const { return inflight_joins_; }
148 149
149 // cache_ maps from a request to a cached result. 150 // cache_ maps from a request to a cached result.
150 CertVerifierCache cache_; 151 CertVerifierCache cache_;
151 152
152 // inflight_ maps from a request to an active verification which is taking 153 // inflight_ maps from a request to an active verification which is taking
153 // place. 154 // place.
154 std::map<RequestParams, CertVerifierJob*> inflight_; 155 std::map<RequestParams, CertVerifierJob*> inflight_;
155 156
156 uint64 requests_; 157 uint64 requests_;
157 uint64 cache_hits_; 158 uint64 cache_hits_;
158 uint64 inflight_joins_; 159 uint64 inflight_joins_;
159 160
160 scoped_refptr<CertVerifyProc> verify_proc_; 161 scoped_refptr<CertVerifyProc> verify_proc_;
161 162
162 CertTrustAnchorProvider* trust_anchor_provider_; 163 CertTrustAnchorProvider* trust_anchor_provider_;
163 164
164 DISALLOW_COPY_AND_ASSIGN(MultiThreadedCertVerifier); 165 DISALLOW_COPY_AND_ASSIGN(MultiThreadedCertVerifier);
165 }; 166 };
166 167
167 } // namespace net 168 } // namespace net
168 169
169 #endif // NET_CERT_MULTI_THREADED_CERT_VERIFIER_H_ 170 #endif // NET_CERT_MULTI_THREADED_CERT_VERIFIER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698