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

Unified Diff: net/cert/nss_cert_database.h

Issue 370633003: Break cyclic dependency between CertDatabase and NSSCertDatabase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: net/cert/nss_cert_database.h
diff --git a/net/cert/nss_cert_database.h b/net/cert/nss_cert_database.h
index 1c4daf817937c83d328441d491b196be8858af86..b0a2e392a74553018b6594f42326f9cd3f448fc4 100644
--- a/net/cert/nss_cert_database.h
+++ b/net/cert/nss_cert_database.h
@@ -16,6 +16,7 @@
#include "crypto/scoped_nss_types.h"
#include "net/base/net_errors.h"
#include "net/base/net_export.h"
+#include "net/cert/cert_database.h"
#include "net/cert/cert_type.h"
#include "net/cert/x509_certificate.h"
@@ -33,31 +34,6 @@ typedef std::vector<scoped_refptr<CryptoModule> > CryptoModuleList;
// Provides functions to manipulate the NSS certificate stores.
class NET_EXPORT NSSCertDatabase {
public:
-
- class NET_EXPORT Observer {
- public:
- virtual ~Observer() {}
-
- // Will be called when a new certificate is added.
- // Called with |cert| == NULL after importing a list of certificates
- // in ImportFromPKCS12().
- virtual void OnCertAdded(const X509Certificate* cert) {}
-
- // Will be called when a certificate is removed.
- virtual void OnCertRemoved(const X509Certificate* cert) {}
-
- // Will be called when a CA certificate is changed.
- // Called with |cert| == NULL after importing a list of certificates
- // in ImportCACerts().
- virtual void OnCACertChanged(const X509Certificate* cert) {}
-
- protected:
- Observer() {}
-
- private:
- DISALLOW_COPY_AND_ASSIGN(Observer);
- };
-
// Stores per-certificate error codes for import failures.
struct NET_EXPORT ImportCertFailure {
public:
@@ -225,19 +201,6 @@ class NET_EXPORT NSSCertDatabase {
// Check whether cert is stored in a hardware slot.
bool IsHardwareBacked(const X509Certificate* cert) const;
- // 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 receive notifications generated directly through the
- // NSSCertDatabase, but not those from the CertDatabase. The CertDatabase
- // observers will receive 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);
-
// Overrides task runner that's used for running slow tasks.
void SetSlowTaskRunnerForTest(
const scoped_refptr<base::TaskRunner>& task_runner);
@@ -261,6 +224,18 @@ class NET_EXPORT NSSCertDatabase {
private:
friend struct base::DefaultLazyInstanceTraits<NSSCertDatabase>;
+ typedef CertDatabase::Observer Observer;
+
+ // 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.
+ // This is forward notifications a CertDatabase.
+ 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);
+
// Notifies observers of the removal of |cert| and calls |callback| with
// |success| as argument.
void NotifyCertRemovalAndCallBack(scoped_refptr<X509Certificate> cert,

Powered by Google App Engine
This is Rietveld 408576698