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

Unified Diff: net/cert/nss_cert_database.h

Issue 111273002: NSSCertDatabaseChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: refactoring and 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
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..d2f113a79e924899b1f1cfa9094b4851bea55e6f 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 {
@@ -93,13 +95,13 @@ class NET_EXPORT NSSCertDatabase {
// 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 +118,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 +198,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);

Powered by Google App Engine
This is Rietveld 408576698