Chromium Code Reviews| 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(); |