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

Unified Diff: net/cert/nss_cert_database.h

Issue 405973003: Remove the deprecated NSSCertDatabase::GetInstance() . (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed comment. Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/cert_loader_unittest.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 120e50da9bec7b214c731c8e53d101ce165f8210..4c47429303d8dbb60593ce7d3a15612e698e5939 100644
--- a/net/cert/nss_cert_database.h
+++ b/net/cert/nss_cert_database.h
@@ -20,7 +20,6 @@
#include "net/cert/x509_certificate.h"
namespace base {
-template <typename T> struct DefaultLazyInstanceTraits;
class TaskRunner;
}
template <class ObserverType> class ObserverListThreadSafe;
@@ -35,7 +34,6 @@ typedef std::vector<scoped_refptr<CryptoModule> > CryptoModuleList;
// singleton.
class NET_EXPORT NSSCertDatabase {
public:
-
class NET_EXPORT Observer {
public:
virtual ~Observer() {}
@@ -102,8 +100,17 @@ class NET_EXPORT NSSCertDatabase {
typedef base::Callback<void(bool)> DeleteCertCallback;
- // DEPRECATED: See http://crbug.com/329735.
- static NSSCertDatabase* GetInstance();
+ // Creates a NSSCertDatabase that will store public information (such as
+ // certificates and trust records) in |public_slot|, and private information
+ // (such as keys) in |private_slot|.
+ // In general, code should avoid creating an NSSCertDatabase directly,
+ // as doing so requires making opinionated decisions about where to store
+ // data, and instead prefer to be passed an existing NSSCertDatabase
+ // instance.
+ // Both slots must not be NULL but can be identical.
+ NSSCertDatabase(crypto::ScopedPK11Slot public_slot,
+ crypto::ScopedPK11Slot private_slot);
+ virtual ~NSSCertDatabase();
// Get a list of unique certificates in the certificate database (one
// instance of all certificates).
@@ -124,10 +131,10 @@ class NET_EXPORT NSSCertDatabase {
PK11SlotInfo* slot);
// Get the default slot for public key data.
- virtual crypto::ScopedPK11Slot GetPublicSlot() const;
+ crypto::ScopedPK11Slot GetPublicSlot() const;
// Get the default slot for private key or mixed private/public key data.
- virtual crypto::ScopedPK11Slot GetPrivateSlot() const;
+ crypto::ScopedPK11Slot GetPrivateSlot() const;
// Get the default module for public key data.
// The returned pointer must be stored in a scoped_refptr<CryptoModule>.
@@ -232,9 +239,6 @@ class NET_EXPORT NSSCertDatabase {
const scoped_refptr<base::TaskRunner>& task_runner);
protected:
- NSSCertDatabase();
- virtual ~NSSCertDatabase();
-
// Certificate listing implementation used by |ListCerts*| and
// |ListCertsSync|. Static so it may safely be used on the worker thread.
// If |slot| is NULL, obtains the certs of all slots, otherwise only of
@@ -248,8 +252,6 @@ class NET_EXPORT NSSCertDatabase {
scoped_refptr<base::TaskRunner> GetSlowTaskRunner() const;
private:
- friend struct base::DefaultLazyInstanceTraits<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.
@@ -277,6 +279,9 @@ class NET_EXPORT NSSCertDatabase {
// it may safely be used on the worker thread.
static bool DeleteCertAndKeyImpl(scoped_refptr<X509Certificate> cert);
+ crypto::ScopedPK11Slot public_slot_;
+ crypto::ScopedPK11Slot private_slot_;
+
// A helper observer that forwards events from this database to CertDatabase.
scoped_ptr<Observer> cert_notification_forwarder_;
« no previous file with comments | « chromeos/cert_loader_unittest.cc ('k') | net/cert/nss_cert_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698