| Index: net/ssl/default_server_bound_cert_store.cc
|
| diff --git a/net/ssl/default_server_bound_cert_store.cc b/net/ssl/default_server_bound_cert_store.cc
|
| index 6fb9180e875fbee9c293bf48638bba3371094f05..8c86add87e85d535b082ac9904f5030a8ccf4392 100644
|
| --- a/net/ssl/default_server_bound_cert_store.cc
|
| +++ b/net/ssl/default_server_bound_cert_store.cc
|
| @@ -52,8 +52,7 @@ class DefaultServerBoundCertStore::GetServerBoundCertTask
|
| DefaultServerBoundCertStore::GetServerBoundCertTask::GetServerBoundCertTask(
|
| const std::string& server_identifier,
|
| const GetCertCallback& callback)
|
| - : server_identifier_(server_identifier),
|
| - callback_(callback) {
|
| + : server_identifier_(server_identifier), callback_(callback) {
|
| }
|
|
|
| DefaultServerBoundCertStore::GetServerBoundCertTask::~GetServerBoundCertTask() {
|
| @@ -64,13 +63,19 @@ void DefaultServerBoundCertStore::GetServerBoundCertTask::Run(
|
| base::Time expiration_time;
|
| std::string private_key_result;
|
| std::string cert_result;
|
| - int err = store->GetServerBoundCert(
|
| - server_identifier_, &expiration_time, &private_key_result,
|
| - &cert_result, GetCertCallback());
|
| + int err = store->GetServerBoundCert(server_identifier_,
|
| + &expiration_time,
|
| + &private_key_result,
|
| + &cert_result,
|
| + GetCertCallback());
|
| DCHECK(err != ERR_IO_PENDING);
|
|
|
| - InvokeCallback(base::Bind(callback_, err, server_identifier_,
|
| - expiration_time, private_key_result, cert_result));
|
| + InvokeCallback(base::Bind(callback_,
|
| + err,
|
| + server_identifier_,
|
| + expiration_time,
|
| + private_key_result,
|
| + cert_result));
|
| }
|
|
|
| // --------------------------------------------------------------------------
|
| @@ -112,8 +117,11 @@ DefaultServerBoundCertStore::SetServerBoundCertTask::~SetServerBoundCertTask() {
|
|
|
| void DefaultServerBoundCertStore::SetServerBoundCertTask::Run(
|
| DefaultServerBoundCertStore* store) {
|
| - store->SyncSetServerBoundCert(server_identifier_, creation_time_,
|
| - expiration_time_, private_key_, cert_);
|
| + store->SyncSetServerBoundCert(server_identifier_,
|
| + creation_time_,
|
| + expiration_time_,
|
| + private_key_,
|
| + cert_);
|
| }
|
|
|
| // --------------------------------------------------------------------------
|
| @@ -132,11 +140,9 @@ class DefaultServerBoundCertStore::DeleteServerBoundCertTask
|
| };
|
|
|
| DefaultServerBoundCertStore::DeleteServerBoundCertTask::
|
| - DeleteServerBoundCertTask(
|
| - const std::string& server_identifier,
|
| - const base::Closure& callback)
|
| - : server_identifier_(server_identifier),
|
| - callback_(callback) {
|
| + DeleteServerBoundCertTask(const std::string& server_identifier,
|
| + const base::Closure& callback)
|
| + : server_identifier_(server_identifier), callback_(callback) {
|
| }
|
|
|
| DefaultServerBoundCertStore::DeleteServerBoundCertTask::
|
| @@ -168,13 +174,12 @@ class DefaultServerBoundCertStore::DeleteAllCreatedBetweenTask
|
| };
|
|
|
| DefaultServerBoundCertStore::DeleteAllCreatedBetweenTask::
|
| - DeleteAllCreatedBetweenTask(
|
| - base::Time delete_begin,
|
| - base::Time delete_end,
|
| - const base::Closure& callback)
|
| - : delete_begin_(delete_begin),
|
| - delete_end_(delete_end),
|
| - callback_(callback) {
|
| + DeleteAllCreatedBetweenTask(base::Time delete_begin,
|
| + base::Time delete_end,
|
| + const base::Closure& callback)
|
| + : delete_begin_(delete_begin),
|
| + delete_end_(delete_end),
|
| + callback_(callback) {
|
| }
|
|
|
| DefaultServerBoundCertStore::DeleteAllCreatedBetweenTask::
|
| @@ -204,7 +209,7 @@ class DefaultServerBoundCertStore::GetAllServerBoundCertsTask
|
|
|
| DefaultServerBoundCertStore::GetAllServerBoundCertsTask::
|
| GetAllServerBoundCertsTask(const GetCertListCallback& callback)
|
| - : callback_(callback) {
|
| + : callback_(callback) {
|
| }
|
|
|
| DefaultServerBoundCertStore::GetAllServerBoundCertsTask::
|
| @@ -225,12 +230,12 @@ void DefaultServerBoundCertStore::GetAllServerBoundCertsTask::Run(
|
| // static
|
| const size_t DefaultServerBoundCertStore::kMaxCerts = 3300;
|
|
|
| -DefaultServerBoundCertStore::DefaultServerBoundCertStore(
|
| - PersistentStore* store)
|
| +DefaultServerBoundCertStore::DefaultServerBoundCertStore(PersistentStore* store)
|
| : initialized_(false),
|
| loaded_(false),
|
| store_(store),
|
| - weak_ptr_factory_(this) {}
|
| + weak_ptr_factory_(this) {
|
| +}
|
|
|
| int DefaultServerBoundCertStore::GetServerBoundCert(
|
| const std::string& server_identifier,
|
| @@ -267,8 +272,7 @@ void DefaultServerBoundCertStore::SetServerBoundCert(
|
| const std::string& private_key,
|
| const std::string& cert) {
|
| RunOrEnqueueTask(scoped_ptr<Task>(new SetServerBoundCertTask(
|
| - server_identifier, creation_time, expiration_time, private_key,
|
| - cert)));
|
| + server_identifier, creation_time, expiration_time, private_key, cert)));
|
| }
|
|
|
| void DefaultServerBoundCertStore::DeleteServerBoundCert(
|
| @@ -286,8 +290,7 @@ void DefaultServerBoundCertStore::DeleteAllCreatedBetween(
|
| new DeleteAllCreatedBetweenTask(delete_begin, delete_end, callback)));
|
| }
|
|
|
| -void DefaultServerBoundCertStore::DeleteAll(
|
| - const base::Closure& callback) {
|
| +void DefaultServerBoundCertStore::DeleteAll(const base::Closure& callback) {
|
| DeleteAllCreatedBetween(base::Time(), base::Time(), callback);
|
| }
|
|
|
| @@ -318,7 +321,8 @@ void DefaultServerBoundCertStore::DeleteAllInMemory() {
|
| DCHECK(CalledOnValidThread());
|
|
|
| for (ServerBoundCertMap::iterator it = server_bound_certs_.begin();
|
| - it != server_bound_certs_.end(); ++it) {
|
| + it != server_bound_certs_.end();
|
| + ++it) {
|
| delete it->second;
|
| }
|
| server_bound_certs_.clear();
|
| @@ -338,7 +342,8 @@ void DefaultServerBoundCertStore::OnLoaded(
|
| DCHECK(CalledOnValidThread());
|
|
|
| for (std::vector<ServerBoundCert*>::const_iterator it = certs->begin();
|
| - it != certs->end(); ++it) {
|
| + it != certs->end();
|
| + ++it) {
|
| DCHECK(server_bound_certs_.find((*it)->server_identifier()) ==
|
| server_bound_certs_.end());
|
| server_bound_certs_[(*it)->server_identifier()] = *it;
|
| @@ -359,9 +364,9 @@ void DefaultServerBoundCertStore::OnLoaded(
|
| UMA_HISTOGRAM_COUNTS_100("DomainBoundCerts.TaskWaitCount",
|
| waiting_tasks_.size());
|
|
|
| -
|
| for (ScopedVector<Task>::iterator i = waiting_tasks_.begin();
|
| - i != waiting_tasks_.end(); ++i)
|
| + i != waiting_tasks_.end();
|
| + ++i)
|
| (*i)->Run(this);
|
| waiting_tasks_.clear();
|
| }
|
| @@ -376,11 +381,12 @@ void DefaultServerBoundCertStore::SyncSetServerBoundCert(
|
| DCHECK(loaded_);
|
|
|
| InternalDeleteServerBoundCert(server_identifier);
|
| - InternalInsertServerBoundCert(
|
| - server_identifier,
|
| - new ServerBoundCert(
|
| - server_identifier, creation_time, expiration_time, private_key,
|
| - cert));
|
| + InternalInsertServerBoundCert(server_identifier,
|
| + new ServerBoundCert(server_identifier,
|
| + creation_time,
|
| + expiration_time,
|
| + private_key,
|
| + cert));
|
| }
|
|
|
| void DefaultServerBoundCertStore::SyncDeleteServerBoundCert(
|
| @@ -415,7 +421,8 @@ void DefaultServerBoundCertStore::SyncGetAllServerBoundCerts(
|
| DCHECK(CalledOnValidThread());
|
| DCHECK(loaded_);
|
| for (ServerBoundCertMap::iterator it = server_bound_certs_.begin();
|
| - it != server_bound_certs_.end(); ++it)
|
| + it != server_bound_certs_.end();
|
| + ++it)
|
| cert_list->push_back(*it->second);
|
| }
|
|
|
| @@ -466,8 +473,10 @@ void DefaultServerBoundCertStore::InternalInsertServerBoundCert(
|
| server_bound_certs_[server_identifier] = cert;
|
| }
|
|
|
| -DefaultServerBoundCertStore::PersistentStore::PersistentStore() {}
|
| +DefaultServerBoundCertStore::PersistentStore::PersistentStore() {
|
| +}
|
|
|
| -DefaultServerBoundCertStore::PersistentStore::~PersistentStore() {}
|
| +DefaultServerBoundCertStore::PersistentStore::~PersistentStore() {
|
| +}
|
|
|
| } // namespace net
|
|
|