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

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: 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_nss.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 1c4daf817937c83d328441d491b196be8858af86..120e50da9bec7b214c731c8e53d101ce165f8210 100644
--- a/net/cert/nss_cert_database.h
+++ b/net/cert/nss_cert_database.h
@@ -31,6 +31,8 @@ class CryptoModule;
typedef std::vector<scoped_refptr<CryptoModule> > CryptoModuleList;
// Provides functions to manipulate the NSS certificate stores.
+// Forwards notifications about certificate changes to the global CertDatabase
+// singleton.
class NET_EXPORT NSSCertDatabase {
public:
@@ -225,19 +227,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 +250,18 @@ class NET_EXPORT NSSCertDatabase {
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.
+ // NOTE: Observers registered here will only receive notifications generated
+ // directly through the NSSCertDatabase, but not those from the CertDatabase.
+ // CertDatabase observers will receive all certificate notifications.
+ 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,
@@ -276,6 +277,9 @@ class NET_EXPORT NSSCertDatabase {
// it may safely be used on the worker thread.
static bool DeleteCertAndKeyImpl(scoped_refptr<X509Certificate> cert);
+ // A helper observer that forwards events from this database to CertDatabase.
+ scoped_ptr<Observer> cert_notification_forwarder_;
+
// Task runner that should be used in tests if set.
scoped_refptr<base::TaskRunner> slow_task_runner_for_test_;
« no previous file with comments | « net/cert/cert_database_nss.cc ('k') | net/cert/nss_cert_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698