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

Unified Diff: content/browser/cert_store_impl.h

Issue 71153005: Pull implementation of CertStore out to be reused. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes for avi. Created 7 years, 1 month 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 | content/browser/cert_store_impl.cc » ('j') | content/browser/cert_store_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/cert_store_impl.h
diff --git a/content/browser/cert_store_impl.h b/content/browser/cert_store_impl.h
index 8a326e95e8f9c3e0e419587f1349b645e395ee91..cba87207d27f965fc43cca6770f25f6e6e8b5681 100644
--- a/content/browser/cert_store_impl.h
+++ b/content/browser/cert_store_impl.h
@@ -5,19 +5,14 @@
#ifndef CONTENT_BROWSER_CERT_STORE_IMPL_H_
#define CONTENT_BROWSER_CERT_STORE_IMPL_H_
-#include <map>
-
#include "base/memory/singleton.h"
-#include "base/synchronization/lock.h"
+#include "content/browser/renderer_data_memoizing_store.h"
#include "content/public/browser/cert_store.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
#include "net/cert/x509_certificate.h"
namespace content {
-class CertStoreImpl : public CertStore,
- public NotificationObserver {
+class CertStoreImpl : public CertStore {
public:
// Returns the singleton instance of the CertStore.
static CertStoreImpl* GetInstance();
@@ -28,10 +23,6 @@ class CertStoreImpl : public CertStore,
virtual bool RetrieveCert(int cert_id,
scoped_refptr<net::X509Certificate>* cert) OVERRIDE;
- // NotificationObserver implementation.
- virtual void Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details) OVERRIDE;
protected:
CertStoreImpl();
virtual ~CertStoreImpl();
@@ -39,34 +30,7 @@ class CertStoreImpl : public CertStore,
private:
friend struct DefaultSingletonTraits<CertStoreImpl>;
- void RegisterForNotification();
-
- // Remove the specified cert from id_to_cert_ and cert_to_id_.
- // NOTE: the caller (RemoveCertsForRenderProcesHost) must hold cert_lock_.
- void RemoveCertInternal(int cert_id);
-
- // Removes all the certs associated with the specified process from the store.
- void RemoveCertsForRenderProcesHost(int render_process_host_id);
-
- typedef std::multimap<int, int> IDMap;
- typedef std::map<int, scoped_refptr<net::X509Certificate> > CertMap;
- typedef std::map<net::X509Certificate*, int, net::X509Certificate::LessThan>
- ReverseCertMap;
-
- // Is only used on the UI Thread.
- NotificationRegistrar registrar_;
-
- IDMap process_id_to_cert_id_;
- IDMap cert_id_to_process_id_;
-
- CertMap id_to_cert_;
- ReverseCertMap cert_to_id_;
-
- int next_cert_id_;
-
- // This lock protects: process_to_ids_, id_to_processes_, id_to_cert_ and
- // cert_to_id_.
- base::Lock cert_lock_;
+ RendererDataMemoizingStore<net::X509Certificate> store_;
DISALLOW_COPY_AND_ASSIGN(CertStoreImpl);
};
« no previous file with comments | « no previous file | content/browser/cert_store_impl.cc » ('j') | content/browser/cert_store_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698