Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Unified Diff: components/webcrypto/algorithms/rsa.cc

Issue 1548203002: Convert Pass()→std::move() in //components/[n-z]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bad headers Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/webcrypto/algorithms/ec.cc ('k') | components/webcrypto/algorithms/rsa_oaep_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/webcrypto/algorithms/rsa.cc
diff --git a/components/webcrypto/algorithms/rsa.cc b/components/webcrypto/algorithms/rsa.cc
index 888b1577f30d6d707a6f9835bf27375d38754f33..36da48bd02941c60a5ab7b65f02ea691e45c109b 100644
--- a/components/webcrypto/algorithms/rsa.cc
+++ b/components/webcrypto/algorithms/rsa.cc
@@ -5,6 +5,7 @@
#include "components/webcrypto/algorithms/rsa.h"
#include <openssl/evp.h>
+#include <utility>
#include "base/logging.h"
#include "components/webcrypto/algorithms/asymmetric_key_util.h"
@@ -147,7 +148,7 @@ Status CreateWebCryptoRsaPrivateKey(
if (status.IsError())
return status;
- return CreateWebCryptoPrivateKey(private_key.Pass(), key_algorithm,
+ return CreateWebCryptoPrivateKey(std::move(private_key), key_algorithm,
extractable, usages, key);
}
@@ -165,8 +166,8 @@ Status CreateWebCryptoRsaPublicKey(
if (status.IsError())
return status;
- return CreateWebCryptoPublicKey(public_key.Pass(), key_algorithm, extractable,
- usages, key);
+ return CreateWebCryptoPublicKey(std::move(public_key), key_algorithm,
+ extractable, usages, key);
}
Status ImportRsaPrivateKey(const blink::WebCryptoAlgorithm& algorithm,
@@ -199,7 +200,7 @@ Status ImportRsaPrivateKey(const blink::WebCryptoAlgorithm& algorithm,
if (!pkey || !EVP_PKEY_set1_RSA(pkey.get(), rsa.get()))
return Status::OperationError();
- return CreateWebCryptoRsaPrivateKey(pkey.Pass(), algorithm.id(),
+ return CreateWebCryptoRsaPrivateKey(std::move(pkey), algorithm.id(),
algorithm.rsaHashedImportParams()->hash(),
extractable, usages, key);
}
@@ -223,7 +224,7 @@ Status ImportRsaPublicKey(const blink::WebCryptoAlgorithm& algorithm,
if (!pkey || !EVP_PKEY_set1_RSA(pkey.get(), rsa.get()))
return Status::OperationError();
- return CreateWebCryptoRsaPublicKey(pkey.Pass(), algorithm.id(),
+ return CreateWebCryptoRsaPublicKey(std::move(pkey), algorithm.id(),
algorithm.rsaHashedImportParams()->hash(),
extractable, usages, key);
}
@@ -320,13 +321,13 @@ Status RsaHashedAlgorithm::GenerateKey(
// Note that extractable is unconditionally set to true. This is because per
// the WebCrypto spec generated public keys are always extractable.
- status = CreateWebCryptoRsaPublicKey(public_pkey.Pass(), algorithm.id(),
+ status = CreateWebCryptoRsaPublicKey(std::move(public_pkey), algorithm.id(),
params->hash(), true, public_usages,
&public_key);
if (status.IsError())
return status;
- status = CreateWebCryptoRsaPrivateKey(private_pkey.Pass(), algorithm.id(),
+ status = CreateWebCryptoRsaPrivateKey(std::move(private_pkey), algorithm.id(),
params->hash(), extractable,
private_usages, &private_key);
if (status.IsError())
@@ -365,7 +366,7 @@ Status RsaHashedAlgorithm::ImportKeyPkcs8(
// TODO(eroman): Validate the algorithm OID against the webcrypto provided
// hash. http://crbug.com/389400
- return CreateWebCryptoRsaPrivateKey(private_key.Pass(), algorithm.id(),
+ return CreateWebCryptoRsaPrivateKey(std::move(private_key), algorithm.id(),
algorithm.rsaHashedImportParams()->hash(),
extractable, usages, key);
}
@@ -385,7 +386,7 @@ Status RsaHashedAlgorithm::ImportKeySpki(
// TODO(eroman): Validate the algorithm OID against the webcrypto provided
// hash. http://crbug.com/389400
- return CreateWebCryptoRsaPublicKey(public_key.Pass(), algorithm.id(),
+ return CreateWebCryptoRsaPublicKey(std::move(public_key), algorithm.id(),
algorithm.rsaHashedImportParams()->hash(),
extractable, usages, key);
}
« no previous file with comments | « components/webcrypto/algorithms/ec.cc ('k') | components/webcrypto/algorithms/rsa_oaep_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698