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

Unified Diff: net/cert/nss_cert_database.h

Issue 111273002: NSSCertDatabaseChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review changes Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cert/cert_database_nss.cc ('k') | net/cert/nss_cert_database.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/nss_cert_database.h
diff --git a/net/cert/nss_cert_database.h b/net/cert/nss_cert_database.h
index 28751a46d01c45ac7224b7e9524aae3767ce24b0..0707b8d8c619c3bc3ba088414341cee3a39acc42 100644
--- a/net/cert/nss_cert_database.h
+++ b/net/cert/nss_cert_database.h
@@ -16,7 +16,9 @@
#include "net/cert/cert_type.h"
#include "net/cert/x509_certificate.h"
-template <typename T> struct DefaultSingletonTraits;
+namespace base {
+template <typename T> struct DefaultLazyInstanceTraits;
+}
template <class ObserverType> class ObserverListThreadSafe;
namespace net {
@@ -89,17 +91,18 @@ class NET_EXPORT NSSCertDatabase {
DISTRUSTED_OBJ_SIGN = 1 << 5,
};
+ // DEPRECATED: See http://crbug.com/329735.
static NSSCertDatabase* GetInstance();
// Get a list of unique certificates in the certificate database (one
// instance of all certificates).
- void ListCerts(CertificateList* certs);
+ virtual void ListCerts(CertificateList* certs);
// Get the default slot for public key data.
- crypto::ScopedPK11Slot GetPublicSlot() const;
+ virtual crypto::ScopedPK11Slot GetPublicSlot() const;
// Get the default slot for private key or mixed private/public key data.
- crypto::ScopedPK11Slot GetPrivateSlot() const;
+ virtual crypto::ScopedPK11Slot GetPrivateSlot() const;
// Get the default module for public key data.
// The returned pointer must be stored in a scoped_refptr<CryptoModule>.
@@ -116,7 +119,7 @@ class NET_EXPORT NSSCertDatabase {
// Get all modules.
// If |need_rw| is true, only writable modules will be returned.
// TODO(mattm): come up with better alternative to CryptoModuleList.
- void ListModules(CryptoModuleList* modules, bool need_rw) const;
+ virtual void ListModules(CryptoModuleList* modules, bool need_rw) const;
// Import certificates and private keys from PKCS #12 blob into the module.
// If |is_extractable| is false, mark the private key as being unextractable
@@ -196,17 +199,22 @@ class NET_EXPORT NSSCertDatabase {
// Registers |observer| to receive notifications of certificate changes. The
// thread on which this is called is the thread on which |observer| will be
// called back with notifications.
+ // NOTE: CertDatabase::AddObserver should be preferred. Observers registered
+ // here will only recieve notifications generated directly through the
+ // NSSCertDatabase, but not those from the CertDatabase. The CertDatabase
+ // observers will recieve both.
void AddObserver(Observer* observer);
// Unregisters |observer| from receiving notifications. This must be called
// on the same thread on which AddObserver() was called.
void RemoveObserver(Observer* observer);
- private:
- friend struct DefaultSingletonTraits<NSSCertDatabase>;
-
+ protected:
NSSCertDatabase();
- ~NSSCertDatabase();
+ virtual ~NSSCertDatabase();
+
+ private:
+ friend struct base::DefaultLazyInstanceTraits<NSSCertDatabase>;
// Broadcasts notifications to all registered observers.
void NotifyObserversOfCertAdded(const X509Certificate* cert);
« no previous file with comments | « net/cert/cert_database_nss.cc ('k') | net/cert/nss_cert_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698