| Index: content/browser/download/base_file.cc
|
| diff --git a/content/browser/download/base_file.cc b/content/browser/download/base_file.cc
|
| index 51121001de8b64534119d8a7fb99411b77f7e324..db4b5a19a8808b355169dc1546e717fa29871c06 100644
|
| --- a/content/browser/download/base_file.cc
|
| +++ b/content/browser/download/base_file.cc
|
| @@ -383,11 +383,21 @@ void BaseFile::Finish() {
|
| Close();
|
| }
|
|
|
| +bool BaseFile::SetSha256Hash(const std::string& hash) {
|
| + DCHECK(!detached_);
|
| + DCHECK(hash.size() == kSha256HashLen);
|
| + if (!calculate_hash_)
|
| + return false;
|
| + memset(sha256_hash_, 0, kSha256HashLen);
|
| + memcpy(sha256_hash_, hash.c_str(), kSha256HashLen);
|
| + return true;
|
| +}
|
| +
|
| bool BaseFile::GetSha256Hash(std::string* hash) {
|
| DCHECK(!detached_);
|
| hash->assign(reinterpret_cast<const char*>(sha256_hash_),
|
| sizeof(sha256_hash_));
|
| - return (calculate_hash_ && !in_progress());
|
| + return (calculate_hash_);
|
| }
|
|
|
| bool BaseFile::IsEmptySha256Hash(const std::string& hash) {
|
|
|