Index: net/ssl/client_cert_store_nss.cc |
diff --git a/net/ssl/client_cert_store_nss.cc b/net/ssl/client_cert_store_nss.cc |
index 7f22765b608c68878d963c46d21baac6b1ffba9f..b5d77af6130c3689a6acfa8b817a7af29736492c 100644 |
--- a/net/ssl/client_cert_store_nss.cc |
+++ b/net/ssl/client_cert_store_nss.cc |
@@ -17,7 +17,6 @@ |
#include "base/location.h" |
#include "base/logging.h" |
#include "base/strings/string_piece.h" |
-#include "base/task_runner_util.h" |
#include "base/threading/worker_pool.h" |
#include "crypto/nss_crypto_module_delegate.h" |
#include "net/cert/scoped_nss_types.h" |
@@ -33,28 +32,29 @@ |
ClientCertStoreNSS::~ClientCertStoreNSS() {} |
-void ClientCertStoreNSS::GetClientCerts( |
- const SSLCertRequestInfo& request, |
- const ClientCertListCallback& callback) { |
+void ClientCertStoreNSS::GetClientCerts(const SSLCertRequestInfo& request, |
+ CertificateList* selected_certs, |
+ const base::Closure& callback) { |
std::unique_ptr<crypto::CryptoModuleBlockingPasswordDelegate> |
password_delegate; |
if (!password_delegate_factory_.is_null()) { |
password_delegate.reset( |
password_delegate_factory_.Run(request.host_and_port)); |
} |
- if (base::PostTaskAndReplyWithResult( |
- base::WorkerPool::GetTaskRunner(true /* task_is_slow */).get(), |
+ if (base::WorkerPool::PostTaskAndReply( |
FROM_HERE, |
base::Bind(&ClientCertStoreNSS::GetAndFilterCertsOnWorkerThread, |
// Caller is responsible for keeping the ClientCertStore |
// alive until the callback is run. |
base::Unretained(this), base::Passed(&password_delegate), |
- &request), |
- callback)) { |
+ &request, selected_certs), |
+ callback, true)) { |
return; |
} |
- // If the task could not be posted, behave as if there were no certificates. |
- callback.Run(CertificateList()); |
+ // If the task could not be posted, behave as if there were no certificates |
+ // which requires to clear |selected_certs|. |
+ selected_certs->clear(); |
+ callback.Run(); |
} |
// static |
@@ -109,15 +109,14 @@ |
x509_util::ClientCertSorter()); |
} |
-CertificateList ClientCertStoreNSS::GetAndFilterCertsOnWorkerThread( |
+void ClientCertStoreNSS::GetAndFilterCertsOnWorkerThread( |
std::unique_ptr<crypto::CryptoModuleBlockingPasswordDelegate> |
password_delegate, |
- const SSLCertRequestInfo* request) { |
+ const SSLCertRequestInfo* request, |
+ CertificateList* selected_certs) { |
CertificateList platform_certs; |
GetPlatformCertsOnWorkerThread(std::move(password_delegate), &platform_certs); |
- CertificateList selected_certs; |
- FilterCertsOnWorkerThread(platform_certs, *request, &selected_certs); |
- return selected_certs; |
+ FilterCertsOnWorkerThread(platform_certs, *request, selected_certs); |
} |
// static |