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

@ -5,6 +5,7 @@
#include "brightray/browser/net/devtools_network_transaction.h"
#include <string>
#include <utility>
#include "brightray/browser/net/devtools_network_controller.h"
#include "brightray/browser/net/devtools_network_upload_data_stream.h"
@ -165,18 +166,18 @@ int DevToolsNetworkTransaction::RestartIgnoringLastError(
}
int DevToolsNetworkTransaction::RestartWithCertificate(
net::X509Certificate* client_cert,
net::SSLPrivateKey* client_private_key,
scoped_refptr<net::X509Certificate> client_cert,
scoped_refptr<net::SSLPrivateKey> client_private_key,
const net::CompletionCallback& callback) {
if (CheckFailed())
return net::ERR_INTERNET_DISCONNECTED;
if (!interceptor_) {
return transaction_->RestartWithCertificate(
client_cert, client_private_key, callback);
std::move(client_cert), std::move(client_private_key), callback);
}
int result = transaction_->RestartWithCertificate(
client_cert, client_private_key,
std::move(client_cert), std::move(client_private_key),
base::Bind(&DevToolsNetworkTransaction::IOCallback,
base::Unretained(this), callback, true));
return Throttle(callback, true, result);