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

Unified Diff: crypto/ec_signature_creator.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 | « crypto/ec_private_key_unittest.cc ('k') | crypto/ec_signature_creator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/ec_signature_creator.h
diff --git a/crypto/ec_signature_creator.h b/crypto/ec_signature_creator.h
index 47128fed1b88116f4a754f0ad865845c516c605d..72e09dfe9d7941598c894fd3bc2ffc2aac082314 100644
--- a/crypto/ec_signature_creator.h
+++ b/crypto/ec_signature_creator.h
@@ -7,6 +7,7 @@
#include <stdint.h>
+#include <memory>
#include <string>
#include <vector>
@@ -21,7 +22,7 @@ class CRYPTO_EXPORT ECSignatureCreatorFactory {
public:
virtual ~ECSignatureCreatorFactory() {}
- virtual ECSignatureCreator* Create(ECPrivateKey* key) = 0;
+ virtual std::unique_ptr<ECSignatureCreator> Create(ECPrivateKey* key) = 0;
};
// Signs data using a bare private key (as opposed to a full certificate).
@@ -35,7 +36,7 @@ class CRYPTO_EXPORT ECSignatureCreator {
// instance outlives the created ECSignatureCreator.
// TODO(rch): This is currently hard coded to use SHA256. Ideally, we should
// pass in the hash algorithm identifier.
- static ECSignatureCreator* Create(ECPrivateKey* key);
+ static std::unique_ptr<ECSignatureCreator> Create(ECPrivateKey* key);
// Set a factory to make the Create function return non-standard
// ECSignatureCreator objects. Because the ECDSA algorithm involves
« no previous file with comments | « crypto/ec_private_key_unittest.cc ('k') | crypto/ec_signature_creator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698