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

Side by Side Diff: net/http/cert_status_cache.h

Issue 17635: Remove HttpTransactionWinHttp and the --winhttp command-line... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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
« no previous file with comments | « net/build/net_unittests.vcproj ('k') | net/http/cert_status_cache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef NET_HTTP_CERT_STATUS_CACHE_H
6 #define NET_HTTP_CERT_STATUS_CACHE_H
7
8 #include <vector>
9 #include <map>
10
11 #include "net/base/x509_certificate.h"
12
13 // This class is used to remember the status of certificates, as WinHTTP
14 // does not report errors once it has been told to ignore them.
15 // It only exists because of the WinHTTP bug.
16 // IMPORTANT: this class is not thread-safe.
17
18 namespace net {
19
20 class CertStatusCache {
21 public:
22 CertStatusCache();
23 ~CertStatusCache();
24
25 int GetCertStatus(const X509Certificate& cert,
26 const std::string& host_name) const;
27 void SetCertStatus(const X509Certificate& cert,
28 const std::string& host_name,
29 int status);
30
31 private:
32 typedef std::map<X509Certificate::Fingerprint, int,
33 X509Certificate::FingerprintLessThan> StatusMap;
34 typedef std::set<std::string> StringSet;
35 typedef std::map<X509Certificate::Fingerprint, StringSet*,
36 X509Certificate::FingerprintLessThan> HostMap;
37
38 StatusMap fingerprint_to_cert_status_;
39
40 // We keep a map for each cert to the list of host names that have been marked
41 // with the CN invalid error, as that error is host name specific.
42 HostMap fingerprint_to_bad_hosts_;
43
44 DISALLOW_EVIL_CONSTRUCTORS(CertStatusCache);
45 };
46
47 } // namespace net
48
49 #endif // NET_HTTP_CERT_STATUS_CACHE_H
50
OLDNEW
« no previous file with comments | « net/build/net_unittests.vcproj ('k') | net/http/cert_status_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698