| Index: content/browser/download/base_file.h
|
| diff --git a/content/browser/download/base_file.h b/content/browser/download/base_file.h
|
| index 2a0994358055c89d9f84c59b1fca13c4f5076f5e..493099630bbd7e32aa130e46132ccde32a6cea47 100644
|
| --- a/content/browser/download/base_file.h
|
| +++ b/content/browser/download/base_file.h
|
| @@ -33,6 +33,7 @@ class CONTENT_EXPORT BaseFile {
|
| const GURL& source_url,
|
| const GURL& referrer_url,
|
| int64 received_bytes,
|
| + const std::string& hash_state,
|
| const linked_ptr<net::FileStream>& file_stream);
|
| virtual ~BaseFile();
|
|
|
| @@ -65,10 +66,16 @@ class CONTENT_EXPORT BaseFile {
|
| bool in_progress() const { return file_stream_ != NULL; }
|
| int64 bytes_so_far() const { return bytes_so_far_; }
|
|
|
| - // Set |hash| with sha256 digest for the file.
|
| + // Fills |hash| with the sha256 digest for the file.
|
| // Returns true if digest is successfully calculated.
|
| virtual bool GetSha256Hash(std::string* hash);
|
|
|
| + // Returns the current (intermediate) state of the hash as a byte string.
|
| + virtual std::string GetSha256HashState();
|
| +
|
| + // Resets the current state of the hash to the contents of |hash_state_bytes|.
|
| + virtual bool SetSha256HashState(const std::string& hash_state_bytes);
|
| +
|
| // Returns true if the given hash is considered empty. An empty hash is
|
| // a string of size kSha256HashLen that contains only zeros (initial value
|
| // for the hash).
|
| @@ -114,6 +121,9 @@ class CONTENT_EXPORT BaseFile {
|
| // is set.
|
| scoped_ptr<crypto::SecureHash> secure_hash_;
|
|
|
| + // The hash state is stored here on creation.
|
| + std::string initial_hash_state_;
|
| +
|
| unsigned char sha256_hash_[kSha256HashLen];
|
|
|
| // Indicates that this class no longer owns the associated file, and so
|
|
|