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

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: 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/cert_database_nss.cc
diff --git a/net/cert/cert_database_nss.cc b/net/cert/cert_database_nss.cc
index 9819dded6cb4b4b6c1858446caee09b42374818a..5c1fadd27f7bc6c456d32b03927cf9ffabe1b5fc 100644
--- a/net/cert/cert_database_nss.cc
+++ b/net/cert/cert_database_nss.cc
@@ -13,21 +13,20 @@
#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 {
+// Helper that observes events from any other cert database (currently
+// NSSCertDatabase) and forwards them to the given CertDatabase.
+class CertDatabase::Notifier : public CertDatabase::Observer {
public:
explicit Notifier(CertDatabase* cert_db) : cert_db_(cert_db) {}
virtual ~Notifier() {}
- // NSSCertDatabase::Observer implementation:
+ // CertDatabase::Observer implementation:
virtual void OnCertAdded(const X509Certificate* cert) OVERRIDE {
cert_db_->NotifyObserversOfCertAdded(cert);
}
@@ -104,8 +103,8 @@ int CertDatabase::AddUserCert(X509Certificate* cert_obj) {
return OK;
}
-void CertDatabase::ObserveNSSCertDatabase(NSSCertDatabase* source) {
- source->AddObserver(this->notifier_.get());
+CertDatabase::Observer* CertDatabase::GetObserver() {
+ return notifier_.get();
}
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698