Refactor client cert private key handling.

https://codereview.chromium.org/2898573002
This commit is contained in:
Aleksei Kuzmin 2017-08-21 00:35:04 +03:00 committed by Cheng Zhao
parent b69913975b
commit 5831a5ffa1
6 changed files with 22 additions and 11 deletions

View file

@ -699,10 +699,17 @@ void App::AllowCertificateError(
void App::SelectClientCertificate(
content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
net::CertificateList client_certs,
net::ClientCertIdentityList identities,
std::unique_ptr<content::ClientCertificateDelegate> delegate) {
std::shared_ptr<content::ClientCertificateDelegate>
shared_delegate(delegate.release());
// Convert the ClientCertIdentityList to a CertificateList
// to avoid changes in the API.
auto client_certs = net::CertificateList();
for (const std::unique_ptr<net::ClientCertIdentity>& identity : identities)
client_certs.push_back(identity->certificate());
bool prevent_default =
Emit("select-client-certificate",
WebContents::CreateFrom(isolate(), web_contents),