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_CERT_DATABASE_H_ | 5 #ifndef NET_CERT_CERT_DATABASE_H_ |
6 #define NET_CERT_CERT_DATABASE_H_ | 6 #define NET_CERT_CERT_DATABASE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "net/base/net_export.h" | 11 #include "net/base/net_export.h" |
12 #include "net/cert/x509_certificate.h" | 12 #include "net/cert/x509_certificate.h" |
13 | 13 |
| 14 namespace base { |
14 template <typename T> struct DefaultSingletonTraits; | 15 template <typename T> struct DefaultSingletonTraits; |
15 | 16 |
16 namespace base { | |
17 template <class ObserverType> | 17 template <class ObserverType> |
18 class ObserverListThreadSafe; | 18 class ObserverListThreadSafe; |
19 } | 19 } |
20 | 20 |
21 namespace net { | 21 namespace net { |
22 | 22 |
23 // This class provides cross-platform functions to verify and add user | 23 // This class provides cross-platform functions to verify and add user |
24 // certificates, and to observe changes to the underlying certificate stores. | 24 // certificates, and to observe changes to the underlying certificate stores. |
25 | 25 |
26 // TODO(gauravsh): This class could be augmented with methods | 26 // TODO(gauravsh): This class could be augmented with methods |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 #endif | 98 #endif |
99 | 99 |
100 // Synthetically injects notifications to all observers. In general, this | 100 // Synthetically injects notifications to all observers. In general, this |
101 // should only be called by the creator of the CertDatabase. Used to inject | 101 // should only be called by the creator of the CertDatabase. Used to inject |
102 // notifcations from other DB interfaces. | 102 // notifcations from other DB interfaces. |
103 void NotifyObserversOfCertAdded(const X509Certificate* cert); | 103 void NotifyObserversOfCertAdded(const X509Certificate* cert); |
104 void NotifyObserversOfCertRemoved(const X509Certificate* cert); | 104 void NotifyObserversOfCertRemoved(const X509Certificate* cert); |
105 void NotifyObserversOfCACertChanged(const X509Certificate* cert); | 105 void NotifyObserversOfCACertChanged(const X509Certificate* cert); |
106 | 106 |
107 private: | 107 private: |
108 friend struct DefaultSingletonTraits<CertDatabase>; | 108 friend struct base::DefaultSingletonTraits<CertDatabase>; |
109 | 109 |
110 CertDatabase(); | 110 CertDatabase(); |
111 ~CertDatabase(); | 111 ~CertDatabase(); |
112 | 112 |
113 const scoped_refptr<base::ObserverListThreadSafe<Observer>> observer_list_; | 113 const scoped_refptr<base::ObserverListThreadSafe<Observer>> observer_list_; |
114 | 114 |
115 #if defined(OS_MACOSX) && !defined(OS_IOS) | 115 #if defined(OS_MACOSX) && !defined(OS_IOS) |
116 class Notifier; | 116 class Notifier; |
117 friend class Notifier; | 117 friend class Notifier; |
118 scoped_ptr<Notifier> notifier_; | 118 scoped_ptr<Notifier> notifier_; |
119 #endif | 119 #endif |
120 | 120 |
121 DISALLOW_COPY_AND_ASSIGN(CertDatabase); | 121 DISALLOW_COPY_AND_ASSIGN(CertDatabase); |
122 }; | 122 }; |
123 | 123 |
124 } // namespace net | 124 } // namespace net |
125 | 125 |
126 #endif // NET_CERT_CERT_DATABASE_H_ | 126 #endif // NET_CERT_CERT_DATABASE_H_ |
OLD | NEW |