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

Unified Diff: content/browser/cert_store_impl.cc

Issue 9691003: Add Content API around CertStore. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix clang Created 8 years, 9 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 | « content/browser/cert_store_impl.h ('k') | content/browser/renderer_host/resource_dispatcher_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/cert_store_impl.cc
===================================================================
--- content/browser/cert_store_impl.cc (revision 126145)
+++ content/browser/cert_store_impl.cc (working copy)
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/browser/cert_store.h"
+#include "content/browser/cert_store_impl.h"
#include <algorithm>
#include <functional>
@@ -26,26 +26,31 @@
T value;
};
+// static
+content::CertStore* content::CertStore::GetInstance() {
+ return CertStoreImpl::GetInstance();
+}
+
// static
-CertStore* CertStore::GetInstance() {
- return Singleton<CertStore>::get();
+CertStoreImpl* CertStoreImpl::GetInstance() {
+ return Singleton<CertStoreImpl>::get();
}
-CertStore::CertStore() : next_cert_id_(1) {
+CertStoreImpl::CertStoreImpl() : next_cert_id_(1) {
if (content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
RegisterForNotification();
} else {
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
- base::Bind(&CertStore::RegisterForNotification,
+ base::Bind(&CertStoreImpl::RegisterForNotification,
base::Unretained(this)));
}
}
-CertStore::~CertStore() {
+CertStoreImpl::~CertStoreImpl() {
}
-void CertStore::RegisterForNotification() {
+void CertStoreImpl::RegisterForNotification() {
// We watch for RenderProcess termination, as this is how we clear
// certificates for now.
// TODO(jcampan): we should be listening to events such as resource cached/
@@ -58,7 +63,7 @@
content::NotificationService::AllBrowserContextsAndSources());
}
-int CertStore::StoreCert(net::X509Certificate* cert, int process_id) {
+int CertStoreImpl::StoreCert(net::X509Certificate* cert, int process_id) {
DCHECK(cert);
base::AutoLock auto_lock(cert_lock_);
@@ -98,8 +103,8 @@
return cert_id;
}
-bool CertStore::RetrieveCert(int cert_id,
- scoped_refptr<net::X509Certificate>* cert) {
+bool CertStoreImpl::RetrieveCert(int cert_id,
+ scoped_refptr<net::X509Certificate>* cert) {
base::AutoLock auto_lock(cert_lock_);
CertMap::iterator iter = id_to_cert_.find(cert_id);
@@ -110,7 +115,7 @@
return true;
}
-void CertStore::RemoveCertInternal(int cert_id) {
+void CertStoreImpl::RemoveCertInternal(int cert_id) {
CertMap::iterator cert_iter = id_to_cert_.find(cert_id);
DCHECK(cert_iter != id_to_cert_.end());
@@ -122,7 +127,7 @@
id_to_cert_.erase(cert_iter);
}
-void CertStore::RemoveCertsForRenderProcesHost(int process_id) {
+void CertStoreImpl::RemoveCertsForRenderProcesHost(int process_id) {
base::AutoLock auto_lock(cert_lock_);
// We iterate through all the cert ids for that process.
@@ -162,9 +167,9 @@
process_id_to_cert_id_.erase(process_ids.first, process_ids.second);
}
-void CertStore::Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
+void CertStoreImpl::Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) {
DCHECK(type == content::NOTIFICATION_RENDERER_PROCESS_TERMINATED ||
type == content::NOTIFICATION_RENDERER_PROCESS_CLOSED);
content::RenderProcessHost* rph =
« no previous file with comments | « content/browser/cert_store_impl.h ('k') | content/browser/renderer_host/resource_dispatcher_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698