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

Unified Diff: crypto/secure_hash.h

Issue 1751603002: [Downloads] Rework how hashes are calculated for download files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try to appease MSVC Created 4 years, 9 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
Index: crypto/secure_hash.h
diff --git a/crypto/secure_hash.h b/crypto/secure_hash.h
index 491a299a3120ba276f76e2d541a09c19b05328e3..a5590e5d0b5879a14e81b75402cabd3dcc836928 100644
--- a/crypto/secure_hash.h
+++ b/crypto/secure_hash.h
@@ -10,11 +10,6 @@
#include "base/macros.h"
#include "crypto/crypto_export.h"
-namespace base {
-class Pickle;
-class PickleIterator;
-}
-
namespace crypto {
// A wrapper to calculate secure hashes incrementally, allowing to
@@ -30,17 +25,12 @@ class CRYPTO_EXPORT SecureHash {
virtual void Update(const void* input, size_t len) = 0;
virtual void Finish(void* output, size_t len) = 0;
+ virtual size_t GetHashLength() const = 0;
- // Serialize the context, so it can be restored at a later time.
- // |pickle| will contain the serialized data.
- // Returns whether or not |pickle| was filled.
- virtual bool Serialize(base::Pickle* pickle) = 0;
-
- // Restore the context that was saved earlier.
- // |data_iterator| allows this to be used as part of a larger pickle.
- // |pickle| holds the saved data.
- // Returns success or failure.
- virtual bool Deserialize(base::PickleIterator* data_iterator) = 0;
+ // 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;
protected:
SecureHash() {}

Powered by Google App Engine
This is Rietveld 408576698