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

Unified Diff: crypto/secure_hash.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/nss_util_internal.h ('k') | crypto/secure_hash.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/secure_hash.h
diff --git a/crypto/secure_hash.h b/crypto/secure_hash.h
index a5590e5d0b5879a14e81b75402cabd3dcc836928..30b9fdc5f283fa3f5bfb6c3056c16c8f85201c35 100644
--- a/crypto/secure_hash.h
+++ b/crypto/secure_hash.h
@@ -7,6 +7,8 @@
#include <stddef.h>
+#include <memory>
+
#include "base/macros.h"
#include "crypto/crypto_export.h"
@@ -21,7 +23,7 @@ class CRYPTO_EXPORT SecureHash {
};
virtual ~SecureHash() {}
- static SecureHash* Create(Algorithm type);
+ static std::unique_ptr<SecureHash> Create(Algorithm type);
virtual void Update(const void* input, size_t len) = 0;
virtual void Finish(void* output, size_t len) = 0;
@@ -30,7 +32,7 @@ class CRYPTO_EXPORT SecureHash {
// Create a clone of this SecureHash. The returned clone and this both
// represent the same hash state. But from this point on, calling
// Update()/Finish() on either doesn't affect the state of the other.
- virtual SecureHash* Clone() const = 0;
+ virtual std::unique_ptr<SecureHash> Clone() const = 0;
protected:
SecureHash() {}
« no previous file with comments | « crypto/nss_util_internal.h ('k') | crypto/secure_hash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698