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

Unified Diff: extensions/browser/content_verify_job.cc

Issue 2928693002: [Content verification] Fix a bug for files that are multiple of 4k bytes. (Closed)
Patch Set: address comments Created 3 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 | « no previous file | extensions/browser/content_verify_job_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/content_verify_job.cc
diff --git a/extensions/browser/content_verify_job.cc b/extensions/browser/content_verify_job.cc
index 3bd086b3aa6143c3f22c6a76be9a24c3ac11a205..60e1faacae335883ca5b9e392597be58f3d4cbba 100644
--- a/extensions/browser/content_verify_job.cc
+++ b/extensions/browser/content_verify_job.cc
@@ -142,8 +142,13 @@ void ContentVerifyJob::DoneReading() {
}
bool ContentVerifyJob::FinishBlock() {
- if (!done_reading_ && current_hash_byte_count_ == 0)
- return true;
+ if (current_hash_byte_count_ == 0) {
+ if (!done_reading_ ||
+ // If we have checked all blocks already, then nothing else to do here.
+ current_block_ == hash_reader_->block_count()) {
+ return true;
+ }
+ }
if (!current_hash_) {
// This happens when we fail to read the resource. Compute empty content's
// hash in this case.
« no previous file with comments | « no previous file | extensions/browser/content_verify_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698