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

Unified Diff: net/cert/cert_database_nss.cc

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 | « net/cert/cert_database.h ('k') | net/cert/nss_cert_database.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/cert_database_nss.cc
diff --git a/net/cert/cert_database_nss.cc b/net/cert/cert_database_nss.cc
index 9819dded6cb4b4b6c1858446caee09b42374818a..6d66cc1db881b73d857d7113abb6a6977ec7290e 100644
--- a/net/cert/cert_database_nss.cc
+++ b/net/cert/cert_database_nss.cc
@@ -13,42 +13,13 @@
#include "crypto/nss_util.h"
#include "crypto/scoped_nss_types.h"
#include "net/base/net_errors.h"
-#include "net/cert/nss_cert_database.h"
#include "net/cert/x509_certificate.h"
#include "net/cert/x509_util_nss.h"
namespace net {
-// Helper that observes events from the NSSCertDatabase and forwards them to
-// the given CertDatabase.
-class CertDatabase::Notifier : public NSSCertDatabase::Observer {
- public:
- explicit Notifier(CertDatabase* cert_db) : cert_db_(cert_db) {}
-
- virtual ~Notifier() {}
-
- // NSSCertDatabase::Observer implementation:
- virtual void OnCertAdded(const X509Certificate* cert) OVERRIDE {
- cert_db_->NotifyObserversOfCertAdded(cert);
- }
-
- virtual void OnCertRemoved(const X509Certificate* cert) OVERRIDE {
- cert_db_->NotifyObserversOfCertRemoved(cert);
- }
-
- virtual void OnCACertChanged(const X509Certificate* cert) OVERRIDE {
- cert_db_->NotifyObserversOfCACertChanged(cert);
- }
-
- private:
- CertDatabase* cert_db_;
-
- DISALLOW_COPY_AND_ASSIGN(Notifier);
-};
-
CertDatabase::CertDatabase()
- : observer_list_(new ObserverListThreadSafe<Observer>),
- notifier_(new Notifier(this)) {
+ : observer_list_(new ObserverListThreadSafe<Observer>) {
crypto::EnsureNSSInit();
}
@@ -104,8 +75,4 @@ int CertDatabase::AddUserCert(X509Certificate* cert_obj) {
return OK;
}
-void CertDatabase::ObserveNSSCertDatabase(NSSCertDatabase* source) {
- source->AddObserver(this->notifier_.get());
-}
-
} // namespace net
« no previous file with comments | « net/cert/cert_database.h ('k') | net/cert/nss_cert_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698