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

Unified Diff: crypto/ec_private_key.h

Issue 2095523002: Make //crypto factories return std::unique_ptr<>s (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: I'm blind Created 4 years, 6 months 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 | « content/browser/download/download_item_impl.cc ('k') | crypto/ec_private_key.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/ec_private_key.h
diff --git a/crypto/ec_private_key.h b/crypto/ec_private_key.h
index 3e543d3db18a3d818851963ce1bb97ae5a20c037..9cdb453e1d3de1913a58492468155eabf08fb225 100644
--- a/crypto/ec_private_key.h
+++ b/crypto/ec_private_key.h
@@ -30,10 +30,10 @@ class CRYPTO_EXPORT ECPrivateKey {
public:
~ECPrivateKey();
- // Creates a new random instance. Can return NULL if initialization fails.
+ // Creates a new random instance. Can return nullptr if initialization fails.
// The created key will use the NIST P-256 curve.
// TODO(mattm): Add a curve parameter.
- static ECPrivateKey* Create();
+ static std::unique_ptr<ECPrivateKey> Create();
// Create a new instance by importing an existing private key. The format is
// an ASN.1-encoded PrivateKeyInfo block from PKCS #8. This can return
@@ -44,17 +44,17 @@ class CRYPTO_EXPORT ECPrivateKey {
// Creates a new instance by importing an existing key pair.
// The key pair is given as an ASN.1-encoded PKCS #8 EncryptedPrivateKeyInfo
// block and an X.509 SubjectPublicKeyInfo block.
- // Returns NULL if initialization fails.
+ // Returns nullptr if initialization fails.
//
// This function is deprecated. Use CreateFromPrivateKeyInfo for new code.
// See https://crbug.com/603319.
- static ECPrivateKey* CreateFromEncryptedPrivateKeyInfo(
+ static std::unique_ptr<ECPrivateKey> CreateFromEncryptedPrivateKeyInfo(
const std::string& password,
const std::vector<uint8_t>& encrypted_private_key_info,
const std::vector<uint8_t>& subject_public_key_info);
// Returns a copy of the object.
- ECPrivateKey* Copy() const;
+ std::unique_ptr<ECPrivateKey> Copy() const;
EVP_PKEY* key() { return key_; }
« no previous file with comments | « content/browser/download/download_item_impl.cc ('k') | crypto/ec_private_key.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698