Commit 2c50fa52 authored by Omar Morsi's avatar Omar Morsi Committed by Commit Bot

Accept only OnceCallbacks in PlatformKeysService interface

Bug: 1130594
Change-Id: I815675d485a40f7131e48908cd1f25d8f20c74d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2421459Reviewed-by: default avatarPavol Marko <pmarko@chromium.org>
Commit-Queue: Omar Morsi <omorsi@google.com>
Cr-Commit-Position: refs/heads/master@{#809232}
parent 6b2a0e0d
...@@ -57,7 +57,7 @@ CertificateHelperForTesting::~CertificateHelperForTesting() = default; ...@@ -57,7 +57,7 @@ CertificateHelperForTesting::~CertificateHelperForTesting() = default;
void CertificateHelperForTesting::GetCertificates( void CertificateHelperForTesting::GetCertificates(
platform_keys::TokenId token_id, platform_keys::TokenId token_id,
const platform_keys::GetCertificatesCallback& callback) { platform_keys::GetCertificatesCallback callback) {
auto result = std::make_unique<net::CertificateList>(); auto result = std::make_unique<net::CertificateList>();
*result = cert_list_; *result = cert_list_;
std::move(callback).Run(std::move(result), platform_keys::Status::kSuccess); std::move(callback).Run(std::move(result), platform_keys::Status::kSuccess);
......
...@@ -63,7 +63,7 @@ struct CertificateHelperForTesting { ...@@ -63,7 +63,7 @@ struct CertificateHelperForTesting {
private: private:
void GetCertificates(platform_keys::TokenId token_id, void GetCertificates(platform_keys::TokenId token_id,
const platform_keys::GetCertificatesCallback& callback); platform_keys::GetCertificatesCallback callback);
platform_keys::MockPlatformKeysService* platform_keys_service_ = nullptr; platform_keys::MockPlatformKeysService* platform_keys_service_ = nullptr;
scoped_refptr<net::X509Certificate> template_cert_; scoped_refptr<net::X509Certificate> template_cert_;
......
...@@ -39,14 +39,14 @@ class MockPlatformKeysService : public PlatformKeysService { ...@@ -39,14 +39,14 @@ class MockPlatformKeysService : public PlatformKeysService {
GenerateRSAKey, GenerateRSAKey,
(TokenId token_id, (TokenId token_id,
unsigned int modulus_length_bits, unsigned int modulus_length_bits,
const GenerateKeyCallback& callback), GenerateKeyCallback callback),
(override)); (override));
MOCK_METHOD(void, MOCK_METHOD(void,
GenerateECKey, GenerateECKey,
(TokenId token_id, (TokenId token_id,
const std::string& named_curve, const std::string& named_curve,
const GenerateKeyCallback& callback), GenerateKeyCallback callback),
(override)); (override));
MOCK_METHOD(void, MOCK_METHOD(void,
...@@ -55,7 +55,7 @@ class MockPlatformKeysService : public PlatformKeysService { ...@@ -55,7 +55,7 @@ class MockPlatformKeysService : public PlatformKeysService {
const std::string& data, const std::string& data,
const std::string& public_key_spki_der, const std::string& public_key_spki_der,
HashAlgorithm hash_algorithm, HashAlgorithm hash_algorithm,
const SignCallback& callback), SignCallback callback),
(override)); (override));
MOCK_METHOD(void, MOCK_METHOD(void,
...@@ -63,7 +63,7 @@ class MockPlatformKeysService : public PlatformKeysService { ...@@ -63,7 +63,7 @@ class MockPlatformKeysService : public PlatformKeysService {
(base::Optional<TokenId> token_id, (base::Optional<TokenId> token_id,
const std::string& data, const std::string& data,
const std::string& public_key_spki_der, const std::string& public_key_spki_der,
const SignCallback& callback), SignCallback callback),
(override)); (override));
MOCK_METHOD(void, MOCK_METHOD(void,
...@@ -72,18 +72,18 @@ class MockPlatformKeysService : public PlatformKeysService { ...@@ -72,18 +72,18 @@ class MockPlatformKeysService : public PlatformKeysService {
const std::string& data, const std::string& data,
const std::string& public_key_spki_der, const std::string& public_key_spki_der,
HashAlgorithm hash_algorithm, HashAlgorithm hash_algorithm,
const SignCallback& callback), SignCallback callback),
(override)); (override));
MOCK_METHOD(void, MOCK_METHOD(void,
SelectClientCertificates, SelectClientCertificates,
(const std::vector<std::string>& certificate_authorities, (const std::vector<std::string>& certificate_authorities,
const SelectCertificatesCallback& callback), SelectCertificatesCallback callback),
(override)); (override));
MOCK_METHOD(void, MOCK_METHOD(void,
GetCertificates, GetCertificates,
(TokenId token_id, const GetCertificatesCallback& callback), (TokenId token_id, GetCertificatesCallback callback),
(override)); (override));
MOCK_METHOD(void, MOCK_METHOD(void,
...@@ -95,14 +95,14 @@ class MockPlatformKeysService : public PlatformKeysService { ...@@ -95,14 +95,14 @@ class MockPlatformKeysService : public PlatformKeysService {
ImportCertificate, ImportCertificate,
(TokenId token_id, (TokenId token_id,
const scoped_refptr<net::X509Certificate>& certificate, const scoped_refptr<net::X509Certificate>& certificate,
const ImportCertificateCallback& callback), ImportCertificateCallback callback),
(override)); (override));
MOCK_METHOD(void, MOCK_METHOD(void,
RemoveCertificate, RemoveCertificate,
(TokenId token_id, (TokenId token_id,
const scoped_refptr<net::X509Certificate>& certificate, const scoped_refptr<net::X509Certificate>& certificate,
const RemoveCertificateCallback& callback), RemoveCertificateCallback callback),
(override)); (override));
MOCK_METHOD(void, MOCK_METHOD(void,
...@@ -117,7 +117,7 @@ class MockPlatformKeysService : public PlatformKeysService { ...@@ -117,7 +117,7 @@ class MockPlatformKeysService : public PlatformKeysService {
MOCK_METHOD(void, MOCK_METHOD(void,
GetKeyLocations, GetKeyLocations,
(const std::string& public_key_spki_der, (const std::string& public_key_spki_der,
const GetKeyLocationsCallback& callback), GetKeyLocationsCallback callback),
(override)); (override));
MOCK_METHOD(void, MOCK_METHOD(void,
......
...@@ -30,24 +30,25 @@ namespace chromeos { ...@@ -30,24 +30,25 @@ namespace chromeos {
namespace platform_keys { namespace platform_keys {
using GenerateKeyCallback = using GenerateKeyCallback =
base::Callback<void(const std::string& public_key_spki_der, Status status)>; base::OnceCallback<void(const std::string& public_key_spki_der,
Status status)>;
using SignCallback = using SignCallback =
base::Callback<void(const std::string& signature, Status status)>; base::OnceCallback<void(const std::string& signature, Status status)>;
// If the certificate request could be processed successfully, |matches| will // If the certificate request could be processed successfully, |matches| will
// contain the list of matching certificates (which may be empty). If an error // contain the list of matching certificates (which may be empty). If an error
// occurred, |matches| will be null. // occurred, |matches| will be null.
using SelectCertificatesCallback = using SelectCertificatesCallback =
base::Callback<void(std::unique_ptr<net::CertificateList> matches, base::OnceCallback<void(std::unique_ptr<net::CertificateList> matches,
Status status)>; Status status)>;
// If the list of certificates could be successfully retrieved, |certs| will // If the list of certificates could be successfully retrieved, |certs| will
// contain the list of available certificates (maybe empty). If an error // contain the list of available certificates (maybe empty). If an error
// occurred, |certs| will be empty. // occurred, |certs| will be empty.
using GetCertificatesCallback = using GetCertificatesCallback =
base::Callback<void(std::unique_ptr<net::CertificateList> certs, base::OnceCallback<void(std::unique_ptr<net::CertificateList> certs,
Status status)>; Status status)>;
// If the list of key pairs could be successfully retrieved, // If the list of key pairs could be successfully retrieved,
// |public_key_spki_der_list| will contain the list of available key pairs (may // |public_key_spki_der_list| will contain the list of available key pairs (may
...@@ -77,11 +78,9 @@ using GetTokensCallback = ...@@ -77,11 +78,9 @@ using GetTokensCallback =
// user has access to. Note that this is also the case if the key exists on the // user has access to. Note that this is also the case if the key exists on the
// system token, but the current user does not have access to the system token. // system token, but the current user does not have access to the system token.
// If an error occurred during processing, |token_ids| will be empty. // If an error occurred during processing, |token_ids| will be empty.
// TODO(pmarko): This is currently a RepeatingCallback because of
// GetNSSCertDatabaseForResourceContext semantics.
using GetKeyLocationsCallback = using GetKeyLocationsCallback =
base::RepeatingCallback<void(const std::vector<TokenId>& token_ids, base::OnceCallback<void(const std::vector<TokenId>& token_ids,
Status status)>; Status status)>;
using SetAttributeForKeyCallback = base::OnceCallback<void(Status status)>; using SetAttributeForKeyCallback = base::OnceCallback<void(Status status)>;
...@@ -130,14 +129,14 @@ class PlatformKeysService : public KeyedService { ...@@ -130,14 +129,14 @@ class PlatformKeysService : public KeyedService {
// resulting public key or an error status. // resulting public key or an error status.
virtual void GenerateRSAKey(TokenId token_id, virtual void GenerateRSAKey(TokenId token_id,
unsigned int modulus_length_bits, unsigned int modulus_length_bits,
const GenerateKeyCallback& callback) = 0; GenerateKeyCallback callback) = 0;
// Generates a EC key pair with |named_curve|. |token_id| specifies the token // Generates a EC key pair with |named_curve|. |token_id| specifies the token
// to store the key pair on. |callback| will be invoked with the resulting // to store the key pair on. |callback| will be invoked with the resulting
// public key or an error status. // public key or an error status.
virtual void GenerateECKey(TokenId token_id, virtual void GenerateECKey(TokenId token_id,
const std::string& named_curve, const std::string& named_curve,
const GenerateKeyCallback& callback) = 0; GenerateKeyCallback callback) = 0;
// Digests |data|, applies PKCS1 padding and afterwards signs the data with // Digests |data|, applies PKCS1 padding and afterwards signs the data with
// the private key matching |public_key_spki_der|. If the key is not found in // the private key matching |public_key_spki_der|. If the key is not found in
...@@ -148,7 +147,7 @@ class PlatformKeysService : public KeyedService { ...@@ -148,7 +147,7 @@ class PlatformKeysService : public KeyedService {
const std::string& data, const std::string& data,
const std::string& public_key_spki_der, const std::string& public_key_spki_der,
HashAlgorithm hash_algorithm, HashAlgorithm hash_algorithm,
const SignCallback& callback) = 0; SignCallback callback) = 0;
// Applies PKCS1 padding and afterwards signs the data with the private key // Applies PKCS1 padding and afterwards signs the data with the private key
// matching |public_key_spki_der|. |data| is not digested. If the key is not // matching |public_key_spki_der|. |data| is not digested. If the key is not
...@@ -159,7 +158,7 @@ class PlatformKeysService : public KeyedService { ...@@ -159,7 +158,7 @@ class PlatformKeysService : public KeyedService {
virtual void SignRSAPKCS1Raw(base::Optional<TokenId> token_id, virtual void SignRSAPKCS1Raw(base::Optional<TokenId> token_id,
const std::string& data, const std::string& data,
const std::string& public_key_spki_der, const std::string& public_key_spki_der,
const SignCallback& callback) = 0; SignCallback callback) = 0;
// Digests |data| and afterwards signs the data with the private key matching // Digests |data| and afterwards signs the data with the private key matching
// |public_key_spki_der|. If the key is not found in that |token_id| (or in // |public_key_spki_der|. If the key is not found in that |token_id| (or in
...@@ -170,7 +169,7 @@ class PlatformKeysService : public KeyedService { ...@@ -170,7 +169,7 @@ class PlatformKeysService : public KeyedService {
const std::string& data, const std::string& data,
const std::string& public_key_spki_der, const std::string& public_key_spki_der,
HashAlgorithm hash_algorithm, HashAlgorithm hash_algorithm,
const SignCallback& callback) = 0; SignCallback callback) = 0;
// Returns the list of all certificates that were issued by one of the // Returns the list of all certificates that were issued by one of the
// |certificate_authorities|. If |certificate_authorities| is empty, all // |certificate_authorities|. If |certificate_authorities| is empty, all
...@@ -178,14 +177,14 @@ class PlatformKeysService : public KeyedService { ...@@ -178,14 +177,14 @@ class PlatformKeysService : public KeyedService {
// or an error status. // or an error status.
virtual void SelectClientCertificates( virtual void SelectClientCertificates(
const std::vector<std::string>& certificate_authorities, const std::vector<std::string>& certificate_authorities,
const SelectCertificatesCallback& callback) = 0; const SelectCertificatesCallback callback) = 0;
// Returns the list of all certificates with stored private key available from // Returns the list of all certificates with stored private key available from
// the given token. Only certificates from the specified |token_id| are // the given token. Only certificates from the specified |token_id| are
// listed. |callback| will be invoked with the list of available certificates // listed. |callback| will be invoked with the list of available certificates
// or an error status. // or an error status.
virtual void GetCertificates(TokenId token_id, virtual void GetCertificates(TokenId token_id,
const GetCertificatesCallback& callback) = 0; const GetCertificatesCallback callback) = 0;
// Returns the list of all keys available from the given |token_id| as a list // Returns the list of all keys available from the given |token_id| as a list
// of der-encoded SubjectPublicKeyInfo strings. |callback| will be invoked on // of der-encoded SubjectPublicKeyInfo strings. |callback| will be invoked on
...@@ -201,7 +200,7 @@ class PlatformKeysService : public KeyedService { ...@@ -201,7 +200,7 @@ class PlatformKeysService : public KeyedService {
virtual void ImportCertificate( virtual void ImportCertificate(
TokenId token_id, TokenId token_id,
const scoped_refptr<net::X509Certificate>& certificate, const scoped_refptr<net::X509Certificate>& certificate,
const ImportCertificateCallback& callback) = 0; ImportCertificateCallback callback) = 0;
// Removes |certificate| from the given token. Any intermediate of // Removes |certificate| from the given token. Any intermediate of
// |certificate| will be ignored. |token_id| specifies the token to remove the // |certificate| will be ignored. |token_id| specifies the token to remove the
...@@ -210,7 +209,7 @@ class PlatformKeysService : public KeyedService { ...@@ -210,7 +209,7 @@ class PlatformKeysService : public KeyedService {
virtual void RemoveCertificate( virtual void RemoveCertificate(
TokenId token_id, TokenId token_id,
const scoped_refptr<net::X509Certificate>& certificate, const scoped_refptr<net::X509Certificate>& certificate,
const RemoveCertificateCallback& callback) = 0; RemoveCertificateCallback callback) = 0;
// Removes the key pair if no matching certificates exist. Only keys in the // Removes the key pair if no matching certificates exist. Only keys in the
// given |token_id| are considered. |callback| will be invoked on the UI // given |token_id| are considered. |callback| will be invoked on the UI
...@@ -229,7 +228,7 @@ class PlatformKeysService : public KeyedService { ...@@ -229,7 +228,7 @@ class PlatformKeysService : public KeyedService {
// ids are determined, possibly with an error status. Calls |callback| on the // ids are determined, possibly with an error status. Calls |callback| on the
// UI thread. // UI thread.
virtual void GetKeyLocations(const std::string& public_key_spki_der, virtual void GetKeyLocations(const std::string& public_key_spki_der,
const GetKeyLocationsCallback& callback) = 0; GetKeyLocationsCallback callback) = 0;
// Sets |attribute_type| for the private key corresponding to // Sets |attribute_type| for the private key corresponding to
// |public_key_spki_der| to |attribute_value| only if the key is in // |public_key_spki_der| to |attribute_value| only if the key is in
...@@ -314,42 +313,42 @@ class PlatformKeysServiceImpl final : public PlatformKeysService { ...@@ -314,42 +313,42 @@ class PlatformKeysServiceImpl final : public PlatformKeysService {
void RemoveObserver(PlatformKeysServiceObserver* observer) override; void RemoveObserver(PlatformKeysServiceObserver* observer) override;
void GenerateRSAKey(TokenId token_id, void GenerateRSAKey(TokenId token_id,
unsigned int modulus_length_bits, unsigned int modulus_length_bits,
const GenerateKeyCallback& callback) override; GenerateKeyCallback callback) override;
void GenerateECKey(TokenId token_id, void GenerateECKey(TokenId token_id,
const std::string& named_curve, const std::string& named_curve,
const GenerateKeyCallback& callback) override; GenerateKeyCallback callback) override;
void SignRSAPKCS1Digest(base::Optional<TokenId> token_id, void SignRSAPKCS1Digest(base::Optional<TokenId> token_id,
const std::string& data, const std::string& data,
const std::string& public_key_spki_der, const std::string& public_key_spki_der,
HashAlgorithm hash_algorithm, HashAlgorithm hash_algorithm,
const SignCallback& callback) override; SignCallback callback) override;
void SignRSAPKCS1Raw(base::Optional<TokenId> token_id, void SignRSAPKCS1Raw(base::Optional<TokenId> token_id,
const std::string& data, const std::string& data,
const std::string& public_key_spki_der, const std::string& public_key_spki_der,
const SignCallback& callback) override; SignCallback callback) override;
void SignECDSADigest(base::Optional<TokenId> token_id, void SignECDSADigest(base::Optional<TokenId> token_id,
const std::string& data, const std::string& data,
const std::string& public_key_spki_der, const std::string& public_key_spki_der,
HashAlgorithm hash_algorithm, HashAlgorithm hash_algorithm,
const SignCallback& callback) override; SignCallback callback) override;
void SelectClientCertificates( void SelectClientCertificates(
const std::vector<std::string>& certificate_authorities, const std::vector<std::string>& certificate_authorities,
const SelectCertificatesCallback& callback) override; SelectCertificatesCallback callback) override;
void GetCertificates(TokenId token_id, void GetCertificates(TokenId token_id,
const GetCertificatesCallback& callback) override; GetCertificatesCallback callback) override;
void GetAllKeys(TokenId token_id, GetAllKeysCallback callback) override; void GetAllKeys(TokenId token_id, GetAllKeysCallback callback) override;
void ImportCertificate(TokenId token_id, void ImportCertificate(TokenId token_id,
const scoped_refptr<net::X509Certificate>& certificate, const scoped_refptr<net::X509Certificate>& certificate,
const ImportCertificateCallback& callback) override; ImportCertificateCallback callback) override;
void RemoveCertificate(TokenId token_id, void RemoveCertificate(TokenId token_id,
const scoped_refptr<net::X509Certificate>& certificate, const scoped_refptr<net::X509Certificate>& certificate,
const RemoveCertificateCallback& callback) override; RemoveCertificateCallback callback) override;
void RemoveKey(TokenId token_id, void RemoveKey(TokenId token_id,
const std::string& public_key_spki_der, const std::string& public_key_spki_der,
RemoveKeyCallback callback) override; RemoveKeyCallback callback) override;
void GetTokens(GetTokensCallback callback) override; void GetTokens(GetTokensCallback callback) override;
void GetKeyLocations(const std::string& public_key_spki_der, void GetKeyLocations(const std::string& public_key_spki_der,
const GetKeyLocationsCallback& callback) override; const GetKeyLocationsCallback callback) override;
void SetAttributeForKey(TokenId token_id, void SetAttributeForKey(TokenId token_id,
const std::string& public_key_spki_der, const std::string& public_key_spki_der,
KeyAttributeType attribute_type, KeyAttributeType attribute_type,
......
...@@ -165,7 +165,7 @@ class GenerateRSAKeyState : public NSSOperationState { ...@@ -165,7 +165,7 @@ class GenerateRSAKeyState : public NSSOperationState {
public: public:
GenerateRSAKeyState(ServiceWeakPtr weak_ptr, GenerateRSAKeyState(ServiceWeakPtr weak_ptr,
unsigned int modulus_length_bits, unsigned int modulus_length_bits,
const GenerateKeyCallback& callback); GenerateKeyCallback callback);
~GenerateRSAKeyState() override = default; ~GenerateRSAKeyState() override = default;
void OnError(const base::Location& from, Status status) override { void OnError(const base::Location& from, Status status) override {
...@@ -186,7 +186,7 @@ class GenerateRSAKeyState : public NSSOperationState { ...@@ -186,7 +186,7 @@ class GenerateRSAKeyState : public NSSOperationState {
UMA_HISTOGRAM_BOOLEAN("ChromeOS.PlatformKeysService.GenerateKey.RSA", UMA_HISTOGRAM_BOOLEAN("ChromeOS.PlatformKeysService.GenerateKey.RSA",
status == Status::kSuccess); status == Status::kSuccess);
auto bound_callback = auto bound_callback =
base::BindOnce(callback_, public_key_spki_der, status); base::BindOnce(std::move(callback_), public_key_spki_der, status);
origin_task_runner_->PostTask( origin_task_runner_->PostTask(
from, base::BindOnce(&NSSOperationState::RunCallback, from, base::BindOnce(&NSSOperationState::RunCallback,
std::move(bound_callback), service_weak_ptr_)); std::move(bound_callback), service_weak_ptr_));
...@@ -200,7 +200,7 @@ class GenerateECKeyState : public NSSOperationState { ...@@ -200,7 +200,7 @@ class GenerateECKeyState : public NSSOperationState {
public: public:
GenerateECKeyState(ServiceWeakPtr weak_ptr, GenerateECKeyState(ServiceWeakPtr weak_ptr,
const std::string& named_curve, const std::string& named_curve,
const GenerateKeyCallback& callback); GenerateKeyCallback callback);
~GenerateECKeyState() override = default; ~GenerateECKeyState() override = default;
void OnError(const base::Location& from, Status status) override { void OnError(const base::Location& from, Status status) override {
...@@ -221,7 +221,7 @@ class GenerateECKeyState : public NSSOperationState { ...@@ -221,7 +221,7 @@ class GenerateECKeyState : public NSSOperationState {
UMA_HISTOGRAM_BOOLEAN("ChromeOS.PlatformKeysService.GenerateKey.EC", UMA_HISTOGRAM_BOOLEAN("ChromeOS.PlatformKeysService.GenerateKey.EC",
status == Status::kSuccess); status == Status::kSuccess);
auto bound_callback = auto bound_callback =
base::BindOnce(callback_, public_key_spki_der, status); base::BindOnce(std::move(callback_), public_key_spki_der, status);
origin_task_runner_->PostTask( origin_task_runner_->PostTask(
from, base::BindOnce(&NSSOperationState::RunCallback, from, base::BindOnce(&NSSOperationState::RunCallback,
std::move(bound_callback), service_weak_ptr_)); std::move(bound_callback), service_weak_ptr_));
...@@ -239,7 +239,7 @@ class SignState : public NSSOperationState { ...@@ -239,7 +239,7 @@ class SignState : public NSSOperationState {
bool raw_pkcs1, bool raw_pkcs1,
HashAlgorithm hash_algorithm, HashAlgorithm hash_algorithm,
const KeyType key_type, const KeyType key_type,
const SignCallback& callback); SignCallback callback);
~SignState() override = default; ~SignState() override = default;
void OnError(const base::Location& from, Status status) override { void OnError(const base::Location& from, Status status) override {
...@@ -276,7 +276,8 @@ class SignState : public NSSOperationState { ...@@ -276,7 +276,8 @@ class SignState : public NSSOperationState {
const std::string& signature, const std::string& signature,
Status status) { Status status) {
EmitOperationStatusToHistogram(status == Status::kSuccess); EmitOperationStatusToHistogram(status == Status::kSuccess);
auto bound_callback = base::BindOnce(callback_, signature, status); auto bound_callback =
base::BindOnce(std::move(callback_), signature, status);
origin_task_runner_->PostTask( origin_task_runner_->PostTask(
from, base::BindOnce(&NSSOperationState::RunCallback, from, base::BindOnce(&NSSOperationState::RunCallback,
std::move(bound_callback), service_weak_ptr_)); std::move(bound_callback), service_weak_ptr_));
...@@ -304,7 +305,7 @@ class SelectCertificatesState : public NSSOperationState { ...@@ -304,7 +305,7 @@ class SelectCertificatesState : public NSSOperationState {
explicit SelectCertificatesState( explicit SelectCertificatesState(
ServiceWeakPtr weak_ptr, ServiceWeakPtr weak_ptr,
const scoped_refptr<net::SSLCertRequestInfo>& request, const scoped_refptr<net::SSLCertRequestInfo>& request,
const SelectCertificatesCallback& callback); SelectCertificatesCallback callback);
~SelectCertificatesState() override = default; ~SelectCertificatesState() override = default;
void OnError(const base::Location& from, Status status) override { void OnError(const base::Location& from, Status status) override {
...@@ -324,7 +325,8 @@ class SelectCertificatesState : public NSSOperationState { ...@@ -324,7 +325,8 @@ class SelectCertificatesState : public NSSOperationState {
void CallBack(const base::Location& from, void CallBack(const base::Location& from,
std::unique_ptr<net::CertificateList> matches, std::unique_ptr<net::CertificateList> matches,
Status status) { Status status) {
auto bound_callback = base::BindOnce(callback_, std::move(matches), status); auto bound_callback =
base::BindOnce(std::move(callback_), std::move(matches), status);
origin_task_runner_->PostTask( origin_task_runner_->PostTask(
from, base::BindOnce(&NSSOperationState::RunCallback, from, base::BindOnce(&NSSOperationState::RunCallback,
std::move(bound_callback), service_weak_ptr_)); std::move(bound_callback), service_weak_ptr_));
...@@ -337,7 +339,7 @@ class SelectCertificatesState : public NSSOperationState { ...@@ -337,7 +339,7 @@ class SelectCertificatesState : public NSSOperationState {
class GetCertificatesState : public NSSOperationState { class GetCertificatesState : public NSSOperationState {
public: public:
explicit GetCertificatesState(ServiceWeakPtr weak_ptr, explicit GetCertificatesState(ServiceWeakPtr weak_ptr,
const GetCertificatesCallback& callback); GetCertificatesCallback callback);
~GetCertificatesState() override = default; ~GetCertificatesState() override = default;
void OnError(const base::Location& from, Status status) override { void OnError(const base::Location& from, Status status) override {
...@@ -357,7 +359,8 @@ class GetCertificatesState : public NSSOperationState { ...@@ -357,7 +359,8 @@ class GetCertificatesState : public NSSOperationState {
void CallBack(const base::Location& from, void CallBack(const base::Location& from,
std::unique_ptr<net::CertificateList> certs, std::unique_ptr<net::CertificateList> certs,
Status status) { Status status) {
auto bound_callback = base::BindOnce(callback_, std::move(certs), status); auto bound_callback =
base::BindOnce(std::move(callback_), std::move(certs), status);
origin_task_runner_->PostTask( origin_task_runner_->PostTask(
from, base::BindOnce(&NSSOperationState::RunCallback, from, base::BindOnce(&NSSOperationState::RunCallback,
std::move(bound_callback), service_weak_ptr_)); std::move(bound_callback), service_weak_ptr_));
...@@ -402,7 +405,7 @@ class ImportCertificateState : public NSSOperationState { ...@@ -402,7 +405,7 @@ class ImportCertificateState : public NSSOperationState {
public: public:
ImportCertificateState(ServiceWeakPtr weak_ptr, ImportCertificateState(ServiceWeakPtr weak_ptr,
const scoped_refptr<net::X509Certificate>& certificate, const scoped_refptr<net::X509Certificate>& certificate,
const ImportCertificateCallback& callback); ImportCertificateCallback callback);
~ImportCertificateState() override = default; ~ImportCertificateState() override = default;
void OnError(const base::Location& from, Status status) override { void OnError(const base::Location& from, Status status) override {
...@@ -417,7 +420,7 @@ class ImportCertificateState : public NSSOperationState { ...@@ -417,7 +420,7 @@ class ImportCertificateState : public NSSOperationState {
private: private:
void CallBack(const base::Location& from, Status status) { void CallBack(const base::Location& from, Status status) {
auto bound_callback = base::BindOnce(callback_, status); auto bound_callback = base::BindOnce(std::move(callback_), status);
origin_task_runner_->PostTask( origin_task_runner_->PostTask(
from, base::BindOnce(&NSSOperationState::RunCallback, from, base::BindOnce(&NSSOperationState::RunCallback,
std::move(bound_callback), service_weak_ptr_)); std::move(bound_callback), service_weak_ptr_));
...@@ -431,7 +434,7 @@ class RemoveCertificateState : public NSSOperationState { ...@@ -431,7 +434,7 @@ class RemoveCertificateState : public NSSOperationState {
public: public:
RemoveCertificateState(ServiceWeakPtr weak_ptr, RemoveCertificateState(ServiceWeakPtr weak_ptr,
const scoped_refptr<net::X509Certificate>& certificate, const scoped_refptr<net::X509Certificate>& certificate,
const RemoveCertificateCallback& callback); RemoveCertificateCallback callback);
~RemoveCertificateState() override = default; ~RemoveCertificateState() override = default;
void OnError(const base::Location& from, Status status) override { void OnError(const base::Location& from, Status status) override {
...@@ -446,7 +449,7 @@ class RemoveCertificateState : public NSSOperationState { ...@@ -446,7 +449,7 @@ class RemoveCertificateState : public NSSOperationState {
private: private:
void CallBack(const base::Location& from, Status status) { void CallBack(const base::Location& from, Status status) {
auto bound_callback = base::BindOnce(callback_, status); auto bound_callback = base::BindOnce(std::move(callback_), status);
origin_task_runner_->PostTask( origin_task_runner_->PostTask(
from, base::BindOnce(&NSSOperationState::RunCallback, from, base::BindOnce(&NSSOperationState::RunCallback,
std::move(bound_callback), service_weak_ptr_)); std::move(bound_callback), service_weak_ptr_));
...@@ -520,7 +523,7 @@ class GetKeyLocationsState : public NSSOperationState { ...@@ -520,7 +523,7 @@ class GetKeyLocationsState : public NSSOperationState {
public: public:
GetKeyLocationsState(ServiceWeakPtr weak_ptr, GetKeyLocationsState(ServiceWeakPtr weak_ptr,
const std::string& public_key_spki_der, const std::string& public_key_spki_der,
const GetKeyLocationsCallback& callback); GetKeyLocationsCallback callback);
~GetKeyLocationsState() override = default; ~GetKeyLocationsState() override = default;
void OnError(const base::Location& from, Status status) override { void OnError(const base::Location& from, Status status) override {
...@@ -539,7 +542,8 @@ class GetKeyLocationsState : public NSSOperationState { ...@@ -539,7 +542,8 @@ class GetKeyLocationsState : public NSSOperationState {
void CallBack(const base::Location& from, void CallBack(const base::Location& from,
const std::vector<TokenId>& token_ids, const std::vector<TokenId>& token_ids,
Status status) { Status status) {
auto bound_callback = base::BindOnce(callback_, token_ids, status); auto bound_callback =
base::BindOnce(std::move(callback_), token_ids, status);
origin_task_runner_->PostTask( origin_task_runner_->PostTask(
from, base::BindOnce(&NSSOperationState::RunCallback, from, base::BindOnce(&NSSOperationState::RunCallback,
std::move(bound_callback), service_weak_ptr_)); std::move(bound_callback), service_weak_ptr_));
...@@ -625,17 +629,17 @@ NSSOperationState::NSSOperationState(ServiceWeakPtr weak_ptr) ...@@ -625,17 +629,17 @@ NSSOperationState::NSSOperationState(ServiceWeakPtr weak_ptr)
GenerateRSAKeyState::GenerateRSAKeyState(ServiceWeakPtr weak_ptr, GenerateRSAKeyState::GenerateRSAKeyState(ServiceWeakPtr weak_ptr,
unsigned int modulus_length_bits, unsigned int modulus_length_bits,
const GenerateKeyCallback& callback) GenerateKeyCallback callback)
: NSSOperationState(weak_ptr), : NSSOperationState(weak_ptr),
modulus_length_bits_(modulus_length_bits), modulus_length_bits_(modulus_length_bits),
callback_(callback) {} callback_(std::move(callback)) {}
GenerateECKeyState::GenerateECKeyState(ServiceWeakPtr weak_ptr, GenerateECKeyState::GenerateECKeyState(ServiceWeakPtr weak_ptr,
const std::string& named_curve, const std::string& named_curve,
const GenerateKeyCallback& callback) GenerateKeyCallback callback)
: NSSOperationState(weak_ptr), : NSSOperationState(weak_ptr),
named_curve_(named_curve), named_curve_(named_curve),
callback_(callback) {} callback_(std::move(callback)) {}
SignState::SignState(ServiceWeakPtr weak_ptr, SignState::SignState(ServiceWeakPtr weak_ptr,
const std::string& data, const std::string& data,
...@@ -643,27 +647,26 @@ SignState::SignState(ServiceWeakPtr weak_ptr, ...@@ -643,27 +647,26 @@ SignState::SignState(ServiceWeakPtr weak_ptr,
bool raw_pkcs1, bool raw_pkcs1,
HashAlgorithm hash_algorithm, HashAlgorithm hash_algorithm,
const KeyType key_type, const KeyType key_type,
const SignCallback& callback) SignCallback callback)
: NSSOperationState(weak_ptr), : NSSOperationState(weak_ptr),
data_(data), data_(data),
public_key_spki_der_(public_key_spki_der), public_key_spki_der_(public_key_spki_der),
raw_pkcs1_(raw_pkcs1), raw_pkcs1_(raw_pkcs1),
hash_algorithm_(hash_algorithm), hash_algorithm_(hash_algorithm),
key_type_(key_type), key_type_(key_type),
callback_(callback) {} callback_(std::move(callback)) {}
SelectCertificatesState::SelectCertificatesState( SelectCertificatesState::SelectCertificatesState(
ServiceWeakPtr weak_ptr, ServiceWeakPtr weak_ptr,
const scoped_refptr<net::SSLCertRequestInfo>& cert_request_info, const scoped_refptr<net::SSLCertRequestInfo>& cert_request_info,
const SelectCertificatesCallback& callback) SelectCertificatesCallback callback)
: NSSOperationState(weak_ptr), : NSSOperationState(weak_ptr),
cert_request_info_(cert_request_info), cert_request_info_(cert_request_info),
callback_(callback) {} callback_(std::move(callback)) {}
GetCertificatesState::GetCertificatesState( GetCertificatesState::GetCertificatesState(ServiceWeakPtr weak_ptr,
ServiceWeakPtr weak_ptr, GetCertificatesCallback callback)
const GetCertificatesCallback& callback) : NSSOperationState(weak_ptr), callback_(std::move(callback)) {}
: NSSOperationState(weak_ptr), callback_(callback) {}
GetAllKeysState::GetAllKeysState(ServiceWeakPtr weak_ptr, GetAllKeysState::GetAllKeysState(ServiceWeakPtr weak_ptr,
GetAllKeysCallback callback) GetAllKeysCallback callback)
...@@ -672,18 +675,18 @@ GetAllKeysState::GetAllKeysState(ServiceWeakPtr weak_ptr, ...@@ -672,18 +675,18 @@ GetAllKeysState::GetAllKeysState(ServiceWeakPtr weak_ptr,
ImportCertificateState::ImportCertificateState( ImportCertificateState::ImportCertificateState(
ServiceWeakPtr weak_ptr, ServiceWeakPtr weak_ptr,
const scoped_refptr<net::X509Certificate>& certificate, const scoped_refptr<net::X509Certificate>& certificate,
const ImportCertificateCallback& callback) ImportCertificateCallback callback)
: NSSOperationState(weak_ptr), : NSSOperationState(weak_ptr),
certificate_(certificate), certificate_(certificate),
callback_(callback) {} callback_(std::move(callback)) {}
RemoveCertificateState::RemoveCertificateState( RemoveCertificateState::RemoveCertificateState(
ServiceWeakPtr weak_ptr, ServiceWeakPtr weak_ptr,
const scoped_refptr<net::X509Certificate>& certificate, const scoped_refptr<net::X509Certificate>& certificate,
const RemoveCertificateCallback& callback) RemoveCertificateCallback callback)
: NSSOperationState(weak_ptr), : NSSOperationState(weak_ptr),
certificate_(certificate), certificate_(certificate),
callback_(callback) {} callback_(std::move(callback)) {}
RemoveKeyState::RemoveKeyState(ServiceWeakPtr weak_ptr, RemoveKeyState::RemoveKeyState(ServiceWeakPtr weak_ptr,
const std::string& public_key_spki_der, const std::string& public_key_spki_der,
...@@ -699,10 +702,10 @@ GetTokensState::GetTokensState(ServiceWeakPtr weak_ptr, ...@@ -699,10 +702,10 @@ GetTokensState::GetTokensState(ServiceWeakPtr weak_ptr,
GetKeyLocationsState::GetKeyLocationsState( GetKeyLocationsState::GetKeyLocationsState(
ServiceWeakPtr weak_ptr, ServiceWeakPtr weak_ptr,
const std::string& public_key_spki_der, const std::string& public_key_spki_der,
const GetKeyLocationsCallback& callback) GetKeyLocationsCallback callback)
: NSSOperationState(weak_ptr), : NSSOperationState(weak_ptr),
public_key_spki_der_(public_key_spki_der), public_key_spki_der_(public_key_spki_der),
callback_(callback) {} callback_(std::move(callback)) {}
SetAttributeForKeyState::SetAttributeForKeyState( SetAttributeForKeyState::SetAttributeForKeyState(
ServiceWeakPtr weak_ptr, ServiceWeakPtr weak_ptr,
...@@ -1418,13 +1421,12 @@ void GetAttributeForKeyWithDb(std::unique_ptr<GetAttributeForKeyState> state, ...@@ -1418,13 +1421,12 @@ void GetAttributeForKeyWithDb(std::unique_ptr<GetAttributeForKeyState> state,
} // namespace } // namespace
void PlatformKeysServiceImpl::GenerateRSAKey( void PlatformKeysServiceImpl::GenerateRSAKey(TokenId token_id,
TokenId token_id, unsigned int modulus_length_bits,
unsigned int modulus_length_bits, GenerateKeyCallback callback) {
const GenerateKeyCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
auto state = std::make_unique<GenerateRSAKeyState>( auto state = std::make_unique<GenerateRSAKeyState>(
weak_factory_.GetWeakPtr(), modulus_length_bits, callback); weak_factory_.GetWeakPtr(), modulus_length_bits, std::move(callback));
if (delegate_->IsShutDown()) { if (delegate_->IsShutDown()) {
state->OnError(FROM_HERE, Status::kErrorShutDown); state->OnError(FROM_HERE, Status::kErrorShutDown);
return; return;
...@@ -1441,13 +1443,12 @@ void PlatformKeysServiceImpl::GenerateRSAKey( ...@@ -1441,13 +1443,12 @@ void PlatformKeysServiceImpl::GenerateRSAKey(
delegate_.get(), state_ptr); delegate_.get(), state_ptr);
} }
void PlatformKeysServiceImpl::GenerateECKey( void PlatformKeysServiceImpl::GenerateECKey(TokenId token_id,
TokenId token_id, const std::string& named_curve,
const std::string& named_curve, GenerateKeyCallback callback) {
const GenerateKeyCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
auto state = std::make_unique<GenerateECKeyState>(weak_factory_.GetWeakPtr(), auto state = std::make_unique<GenerateECKeyState>(
named_curve, callback); weak_factory_.GetWeakPtr(), named_curve, std::move(callback));
if (delegate_->IsShutDown()) { if (delegate_->IsShutDown()) {
state->OnError(FROM_HERE, Status::kErrorShutDown); state->OnError(FROM_HERE, Status::kErrorShutDown);
return; return;
...@@ -1464,12 +1465,12 @@ void PlatformKeysServiceImpl::SignRSAPKCS1Digest( ...@@ -1464,12 +1465,12 @@ void PlatformKeysServiceImpl::SignRSAPKCS1Digest(
const std::string& data, const std::string& data,
const std::string& public_key_spki_der, const std::string& public_key_spki_der,
HashAlgorithm hash_algorithm, HashAlgorithm hash_algorithm,
const SignCallback& callback) { SignCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
auto state = std::make_unique<SignState>( auto state = std::make_unique<SignState>(
weak_factory_.GetWeakPtr(), data, public_key_spki_der, weak_factory_.GetWeakPtr(), data, public_key_spki_der,
/*raw_pkcs1=*/false, hash_algorithm, /*raw_pkcs1=*/false, hash_algorithm,
/*key_type=*/KeyType::kRsassaPkcs1V15, callback); /*key_type=*/KeyType::kRsassaPkcs1V15, std::move(callback));
if (delegate_->IsShutDown()) { if (delegate_->IsShutDown()) {
state->OnError(FROM_HERE, Status::kErrorShutDown); state->OnError(FROM_HERE, Status::kErrorShutDown);
return; return;
...@@ -1489,12 +1490,12 @@ void PlatformKeysServiceImpl::SignRSAPKCS1Raw( ...@@ -1489,12 +1490,12 @@ void PlatformKeysServiceImpl::SignRSAPKCS1Raw(
base::Optional<TokenId> token_id, base::Optional<TokenId> token_id,
const std::string& data, const std::string& data,
const std::string& public_key_spki_der, const std::string& public_key_spki_der,
const SignCallback& callback) { SignCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
auto state = std::make_unique<SignState>( auto state = std::make_unique<SignState>(
weak_factory_.GetWeakPtr(), data, public_key_spki_der, weak_factory_.GetWeakPtr(), data, public_key_spki_der,
/*raw_pkcs1=*/true, HASH_ALGORITHM_NONE, /*raw_pkcs1=*/true, HASH_ALGORITHM_NONE,
/*key_type=*/KeyType::kRsassaPkcs1V15, callback); /*key_type=*/KeyType::kRsassaPkcs1V15, std::move(callback));
if (delegate_->IsShutDown()) { if (delegate_->IsShutDown()) {
state->OnError(FROM_HERE, Status::kErrorShutDown); state->OnError(FROM_HERE, Status::kErrorShutDown);
return; return;
...@@ -1515,12 +1516,12 @@ void PlatformKeysServiceImpl::SignECDSADigest( ...@@ -1515,12 +1516,12 @@ void PlatformKeysServiceImpl::SignECDSADigest(
const std::string& data, const std::string& data,
const std::string& public_key_spki_der, const std::string& public_key_spki_der,
HashAlgorithm hash_algorithm, HashAlgorithm hash_algorithm,
const SignCallback& callback) { SignCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
auto state = std::make_unique<SignState>( auto state = std::make_unique<SignState>(
weak_factory_.GetWeakPtr(), data, public_key_spki_der, weak_factory_.GetWeakPtr(), data, public_key_spki_der,
/*raw_pkcs1=*/false, hash_algorithm, /*raw_pkcs1=*/false, hash_algorithm,
/*key_type=*/KeyType::kEcdsa, callback); /*key_type=*/KeyType::kEcdsa, std::move(callback));
if (delegate_->IsShutDown()) { if (delegate_->IsShutDown()) {
state->OnError(FROM_HERE, Status::kErrorShutDown); state->OnError(FROM_HERE, Status::kErrorShutDown);
return; return;
...@@ -1538,7 +1539,7 @@ void PlatformKeysServiceImpl::SignECDSADigest( ...@@ -1538,7 +1539,7 @@ void PlatformKeysServiceImpl::SignECDSADigest(
void PlatformKeysServiceImpl::SelectClientCertificates( void PlatformKeysServiceImpl::SelectClientCertificates(
const std::vector<std::string>& certificate_authorities, const std::vector<std::string>& certificate_authorities,
const SelectCertificatesCallback& callback) { SelectCertificatesCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
auto cert_request_info = base::MakeRefCounted<net::SSLCertRequestInfo>(); auto cert_request_info = base::MakeRefCounted<net::SSLCertRequestInfo>();
...@@ -1550,7 +1551,7 @@ void PlatformKeysServiceImpl::SelectClientCertificates( ...@@ -1550,7 +1551,7 @@ void PlatformKeysServiceImpl::SelectClientCertificates(
cert_request_info->cert_authorities = certificate_authorities; cert_request_info->cert_authorities = certificate_authorities;
auto state = std::make_unique<SelectCertificatesState>( auto state = std::make_unique<SelectCertificatesState>(
weak_factory_.GetWeakPtr(), cert_request_info, callback); weak_factory_.GetWeakPtr(), cert_request_info, std::move(callback));
if (delegate_->IsShutDown()) { if (delegate_->IsShutDown()) {
state->OnError(FROM_HERE, Status::kErrorShutDown); state->OnError(FROM_HERE, Status::kErrorShutDown);
return; return;
...@@ -1693,10 +1694,10 @@ bool GetPublicKeyBySpki(const std::string& spki, ...@@ -1693,10 +1694,10 @@ bool GetPublicKeyBySpki(const std::string& spki,
void PlatformKeysServiceImpl::GetCertificates( void PlatformKeysServiceImpl::GetCertificates(
TokenId token_id, TokenId token_id,
const GetCertificatesCallback& callback) { GetCertificatesCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
auto state = std::make_unique<GetCertificatesState>( auto state = std::make_unique<GetCertificatesState>(
weak_factory_.GetWeakPtr(), callback); weak_factory_.GetWeakPtr(), std::move(callback));
if (delegate_->IsShutDown()) { if (delegate_->IsShutDown()) {
state->OnError(FROM_HERE, Status::kErrorShutDown); state->OnError(FROM_HERE, Status::kErrorShutDown);
return; return;
...@@ -1728,10 +1729,10 @@ void PlatformKeysServiceImpl::GetAllKeys(TokenId token_id, ...@@ -1728,10 +1729,10 @@ void PlatformKeysServiceImpl::GetAllKeys(TokenId token_id,
void PlatformKeysServiceImpl::ImportCertificate( void PlatformKeysServiceImpl::ImportCertificate(
TokenId token_id, TokenId token_id,
const scoped_refptr<net::X509Certificate>& certificate, const scoped_refptr<net::X509Certificate>& certificate,
const ImportCertificateCallback& callback) { ImportCertificateCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
auto state = std::make_unique<ImportCertificateState>( auto state = std::make_unique<ImportCertificateState>(
weak_factory_.GetWeakPtr(), certificate, callback); weak_factory_.GetWeakPtr(), certificate, std::move(callback));
if (delegate_->IsShutDown()) { if (delegate_->IsShutDown()) {
state->OnError(FROM_HERE, Status::kErrorShutDown); state->OnError(FROM_HERE, Status::kErrorShutDown);
return; return;
...@@ -1750,10 +1751,10 @@ void PlatformKeysServiceImpl::ImportCertificate( ...@@ -1750,10 +1751,10 @@ void PlatformKeysServiceImpl::ImportCertificate(
void PlatformKeysServiceImpl::RemoveCertificate( void PlatformKeysServiceImpl::RemoveCertificate(
TokenId token_id, TokenId token_id,
const scoped_refptr<net::X509Certificate>& certificate, const scoped_refptr<net::X509Certificate>& certificate,
const RemoveCertificateCallback& callback) { RemoveCertificateCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
auto state = std::make_unique<RemoveCertificateState>( auto state = std::make_unique<RemoveCertificateState>(
weak_factory_.GetWeakPtr(), certificate, callback); weak_factory_.GetWeakPtr(), certificate, std::move(callback));
if (delegate_->IsShutDown()) { if (delegate_->IsShutDown()) {
state->OnError(FROM_HERE, Status::kErrorShutDown); state->OnError(FROM_HERE, Status::kErrorShutDown);
return; return;
...@@ -1807,10 +1808,10 @@ void PlatformKeysServiceImpl::GetTokens(GetTokensCallback callback) { ...@@ -1807,10 +1808,10 @@ void PlatformKeysServiceImpl::GetTokens(GetTokensCallback callback) {
void PlatformKeysServiceImpl::GetKeyLocations( void PlatformKeysServiceImpl::GetKeyLocations(
const std::string& public_key_spki_der, const std::string& public_key_spki_der,
const GetKeyLocationsCallback& callback) { GetKeyLocationsCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
auto state = std::make_unique<GetKeyLocationsState>( auto state = std::make_unique<GetKeyLocationsState>(
weak_factory_.GetWeakPtr(), public_key_spki_der, callback); weak_factory_.GetWeakPtr(), public_key_spki_der, std::move(callback));
if (delegate_->IsShutDown()) { if (delegate_->IsShutDown()) {
state->OnError(FROM_HERE, Status::kErrorShutDown); state->OnError(FROM_HERE, Status::kErrorShutDown);
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment