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

Unified Diff: net/cert/cert_database.h

Issue 370633003: Break cyclic dependency between CertDatabase and NSSCertDatabase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed comments. 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 | « no previous file | net/cert/cert_database_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/cert_database.h
diff --git a/net/cert/cert_database.h b/net/cert/cert_database.h
index 865d685097d691e763c156c8cc714b995016f22f..3653e81b1fb38120c29b7692db4ec816122fbfdf 100644
--- a/net/cert/cert_database.h
+++ b/net/cert/cert_database.h
@@ -16,8 +16,6 @@ template <class ObserverType> class ObserverListThreadSafe;
namespace net {
-class NSSCertDatabase;
-
// This class provides cross-platform functions to verify and add user
// certificates, and to observe changes to the underlying certificate stores.
@@ -28,15 +26,17 @@ class NSSCertDatabase;
class NET_EXPORT CertDatabase {
public:
// A CertDatabase::Observer will be notified on certificate database changes.
- // The change could be either a new user certificate is added or trust on
- // a certificate is changed. Observers can register themselves
- // via CertDatabase::AddObserver, and can un-register with
+ // The change could be either a user certificate is added/removed or trust on
+ // a certificate is changed. Observers can be registered via
+ // CertDatabase::AddObserver, and can un-register with
// CertDatabase::RemoveObserver.
class NET_EXPORT Observer {
public:
virtual ~Observer() {}
- // Will be called when a new certificate is added.
+ // Will be called when a new certificate is added. If the imported cert can
+ // be determined, |cert| will be non-NULL, but if not, or if multiple
+ // certificates were imported, |cert| may be NULL.
virtual void OnCertAdded(const X509Certificate* cert) {}
// Will be called when a certificate is removed.
@@ -93,11 +93,12 @@ class NET_EXPORT CertDatabase {
void OnAndroidKeyChainChanged();
#endif
-#if defined(USE_NSS)
- // Observe events from the |source| and forward them to observers of this
- // CertDatabase.
- void ObserveNSSCertDatabase(NSSCertDatabase* source);
-#endif
+ // Synthetically injects notifications to all observers. In general, this
+ // should only be called by the creator of the CertDatabase. Used to inject
+ // notifcations from other DB interfaces.
+ void NotifyObserversOfCertAdded(const X509Certificate* cert);
+ void NotifyObserversOfCertRemoved(const X509Certificate* cert);
+ void NotifyObserversOfCACertChanged(const X509Certificate* cert);
private:
friend struct DefaultSingletonTraits<CertDatabase>;
@@ -105,14 +106,9 @@ class NET_EXPORT CertDatabase {
CertDatabase();
~CertDatabase();
- // Broadcasts notifications to all registered observers.
- void NotifyObserversOfCertAdded(const X509Certificate* cert);
- void NotifyObserversOfCertRemoved(const X509Certificate* cert);
- void NotifyObserversOfCACertChanged(const X509Certificate* cert);
-
const scoped_refptr<ObserverListThreadSafe<Observer> > observer_list_;
-#if defined(USE_NSS) || (defined(OS_MACOSX) && !defined(OS_IOS))
+#if defined(OS_MACOSX) && !defined(OS_IOS)
class Notifier;
friend class Notifier;
scoped_ptr<Notifier> notifier_;
« no previous file with comments | « no previous file | net/cert/cert_database_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698