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

Unified Diff: net/base/default_origin_bound_cert_store.cc

Issue 7585037: Add functionality to OriginBoundCertStore interface and implementations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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/base/default_origin_bound_cert_store.cc
===================================================================
--- net/base/default_origin_bound_cert_store.cc (revision 94628)
+++ net/base/default_origin_bound_cert_store.cc (working copy)
@@ -58,6 +58,37 @@
return true;
}
+void DefaultOriginBoundCertStore::DeleteOriginBoundCert(
+ const std::string& origin) {
+ base::AutoLock autolock(lock_);
+ InitIfNecessary();
+ InternalDeleteOriginBoundCert(origin);
+}
+
+void DefaultOriginBoundCertStore::DeleteAll() {
+ base::AutoLock autolock(lock_);
+ InitIfNecessary();
+ for (OriginBoundCertMap::iterator it = origin_bound_certs_.begin();
+ it != origin_bound_certs_.end(); ++it) {
+ InternalDeleteOriginBoundCert(it->second->origin());
+ }
+}
+
+void DefaultOriginBoundCertStore::GetAllOriginBoundCerts(
+ std::vector<OriginBoundCertInfo>* origin_bound_certs) {
+ base::AutoLock autolock(lock_);
+ InitIfNecessary();
+ for (OriginBoundCertMap::iterator it = origin_bound_certs_.begin();
+ it != origin_bound_certs_.end(); ++it) {
+ struct OriginBoundCertInfo cert_info = {
wtc 2011/08/10 21:35:59 Remove "struct". We should be able to just do o
+ it->second->origin(),
+ it->second->private_key(),
+ it->second->cert()
+ };
+ origin_bound_certs->push_back(cert_info);
+ }
+}
+
int DefaultOriginBoundCertStore::GetCertCount() {
base::AutoLock autolock(lock_);
InitIfNecessary();
@@ -66,14 +97,14 @@
}
DefaultOriginBoundCertStore::~DefaultOriginBoundCertStore() {
- DeleteAll();
+ DeleteAllInMemory();
}
-void DefaultOriginBoundCertStore::DeleteAll() {
+void DefaultOriginBoundCertStore::DeleteAllInMemory() {
base::AutoLock autolock(lock_);
for (OriginBoundCertMap::iterator it = origin_bound_certs_.begin();
- it != origin_bound_certs_.end(); it++) {
+ it != origin_bound_certs_.end(); ++it) {
delete it->second;
}
origin_bound_certs_.clear();

Powered by Google App Engine
This is Rietveld 408576698