Index: extensions/browser/content_verify_job.cc |
diff --git a/extensions/browser/content_verify_job.cc b/extensions/browser/content_verify_job.cc |
index 1bf68cb6a6bada05f471d5ed5c8fe173390dc1d3..f8618bc02e9bfc525240a940ad533d2e36cc090b 100644 |
--- a/extensions/browser/content_verify_job.cc |
+++ b/extensions/browser/content_verify_job.cc |
@@ -137,15 +137,16 @@ bool ContentVerifyJob::FinishBlock() { |
return true; |
std::string final(crypto::kSHA256Length, 0); |
current_hash_->Finish(string_as_array(&final), final.size()); |
+ current_hash_.reset(); |
+ current_hash_byte_count_ = 0; |
+ |
+ int block = current_block_++; |
const std::string* expected_hash = NULL; |
- if (!hash_reader_->GetHashForBlock(current_block_, &expected_hash) || |
+ if (!hash_reader_->GetHashForBlock(block, &expected_hash) || |
*expected_hash != final) |
return false; |
- current_hash_.reset(); |
- current_hash_byte_count_ = 0; |
- current_block_++; |
return true; |
} |