diff options
-rw-r--r-- | chrome/browser/cert_store.cc | 12 | ||||
-rw-r--r-- | chrome/browser/cert_store.h | 4 |
2 files changed, 7 insertions, 9 deletions
diff --git a/chrome/browser/cert_store.cc b/chrome/browser/cert_store.cc index 09e71b8..adc7ff1 100644 --- a/chrome/browser/cert_store.cc +++ b/chrome/browser/cert_store.cc @@ -36,14 +36,10 @@ CertStore::CertStore() : next_cert_id_(1) { // removed from cache, and remove the cert when we know it // is not used anymore. - // TODO(tc): This notification observer never gets removed because the - // CertStore is never deleted. - NotificationService::current()->AddObserver(this, - NotificationType::RENDERER_PROCESS_TERMINATED, - NotificationService::AllSources()); - NotificationService::current()->AddObserver(this, - NotificationType::RENDERER_PROCESS_CLOSED, - NotificationService::AllSources()); + registrar_.Add(this, NotificationType::RENDERER_PROCESS_TERMINATED, + NotificationService::AllSources()); + registrar_.Add(this, NotificationType::RENDERER_PROCESS_CLOSED, + NotificationService::AllSources()); } CertStore::~CertStore() { diff --git a/chrome/browser/cert_store.h b/chrome/browser/cert_store.h index 6638a94..7ef3b3e 100644 --- a/chrome/browser/cert_store.h +++ b/chrome/browser/cert_store.h @@ -10,7 +10,7 @@ #include "base/lock.h" #include "base/singleton.h" -#include "chrome/common/notification_observer.h" +#include "chrome/common/notification_registrar.h" #include "net/base/x509_certificate.h" // The purpose of the cert store is to provide an easy way to store/retrieve @@ -63,6 +63,8 @@ class CertStore : public NotificationObserver { typedef std::map<net::X509Certificate*, int, net::X509Certificate::LessThan> ReverseCertMap; + NotificationRegistrar registrar_; + IDMap process_id_to_cert_id_; IDMap cert_id_to_process_id_; |