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

Side by Side Diff: net/base/ev_root_ca_metadata.h

Issue 5024003: Reland r65996. Disallows Singletons on non-joinable thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Allow another use that should be fixed. Created 10 years, 1 month 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/base/dns_reload_timer.cc ('k') | net/base/ev_root_ca_metadata.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_EV_ROOT_CA_METADATA_H_ 5 #ifndef NET_BASE_EV_ROOT_CA_METADATA_H_
6 #define NET_BASE_EV_ROOT_CA_METADATA_H_ 6 #define NET_BASE_EV_ROOT_CA_METADATA_H_
7 #pragma once 7 #pragma once
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
11 #if defined(USE_NSS) 11 #if defined(USE_NSS)
12 #include <secoidt.h> 12 #include <secoidt.h>
13 #endif 13 #endif
14 14
15 #include <map> 15 #include <map>
16 #include <vector> 16 #include <vector>
17 17
18 #include "net/base/x509_certificate.h" 18 #include "net/base/x509_certificate.h"
19 19
20 namespace base {
20 template <typename T> 21 template <typename T>
21 struct DefaultSingletonTraits; 22 struct DefaultLazyInstanceTraits;
23 } // namespace base
22 24
23 namespace net { 25 namespace net {
24 26
25 // A singleton. This class stores the meta data of the root CAs that issue 27 // A singleton. This class stores the meta data of the root CAs that issue
26 // extended-validation (EV) certificates. 28 // extended-validation (EV) certificates.
27 class EVRootCAMetadata { 29 class EVRootCAMetadata {
28 public: 30 public:
29 #if defined(USE_NSS) 31 #if defined(USE_NSS)
30 typedef SECOidTag PolicyOID; 32 typedef SECOidTag PolicyOID;
31 #else 33 #else
(...skipping 16 matching lines...) Expand all
48 50
49 // Returns true if policy_oid is an EV policy OID of some root CA. 51 // Returns true if policy_oid is an EV policy OID of some root CA.
50 bool IsEVPolicyOID(PolicyOID policy_oid) const; 52 bool IsEVPolicyOID(PolicyOID policy_oid) const;
51 53
52 // Returns true if the root CA with the given certificate fingerprint has 54 // Returns true if the root CA with the given certificate fingerprint has
53 // the EV policy OID policy_oid. 55 // the EV policy OID policy_oid.
54 bool HasEVPolicyOID(const SHA1Fingerprint& fingerprint, 56 bool HasEVPolicyOID(const SHA1Fingerprint& fingerprint,
55 PolicyOID policy_oid) const; 57 PolicyOID policy_oid) const;
56 58
57 private: 59 private:
58 friend struct DefaultSingletonTraits<EVRootCAMetadata>; 60 friend struct base::DefaultLazyInstanceTraits<EVRootCAMetadata>;
59 61
60 typedef std::map<SHA1Fingerprint, PolicyOID, 62 typedef std::map<SHA1Fingerprint, PolicyOID,
61 SHA1FingerprintLessThan> PolicyOidMap; 63 SHA1FingerprintLessThan> PolicyOidMap;
62 64
63 EVRootCAMetadata(); 65 EVRootCAMetadata();
64 ~EVRootCAMetadata(); 66 ~EVRootCAMetadata();
65 67
66 static bool PolicyOIDsAreEqual(PolicyOID a, PolicyOID b); 68 static bool PolicyOIDsAreEqual(PolicyOID a, PolicyOID b);
67 69
68 // Maps an EV root CA cert's SHA-1 fingerprint to its EV policy OID. 70 // Maps an EV root CA cert's SHA-1 fingerprint to its EV policy OID.
69 PolicyOidMap ev_policy_; 71 PolicyOidMap ev_policy_;
70 72
71 #if defined(OS_WIN) 73 #if defined(OS_WIN)
72 static const PolicyOID policy_oids_[]; 74 static const PolicyOID policy_oids_[];
73 int num_policy_oids_; 75 int num_policy_oids_;
74 #else 76 #else
75 std::vector<PolicyOID> policy_oids_; 77 std::vector<PolicyOID> policy_oids_;
76 #endif 78 #endif
77 79
78 DISALLOW_COPY_AND_ASSIGN(EVRootCAMetadata); 80 DISALLOW_COPY_AND_ASSIGN(EVRootCAMetadata);
79 }; 81 };
80 82
81 } // namespace net 83 } // namespace net
82 84
83 #endif // NET_BASE_EV_ROOT_CA_METADATA_H_ 85 #endif // NET_BASE_EV_ROOT_CA_METADATA_H_
OLDNEW
« no previous file with comments | « net/base/dns_reload_timer.cc ('k') | net/base/ev_root_ca_metadata.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698