Index: content/browser/download/base_file.cc |
diff --git a/content/browser/download/base_file.cc b/content/browser/download/base_file.cc |
index b95ef97ed98c372ddddcb82f12144b11418735ee..7c05f8deac393f8141a7006a039a758341635663 100644 |
--- a/content/browser/download/base_file.cc |
+++ b/content/browser/download/base_file.cc |
@@ -109,6 +109,13 @@ DownloadInterruptReason BaseFile::WriteDataToFile(int64_t offset, |
return LogSystemError("Write", logging::GetLastSystemErrorCode()); |
DCHECK_EQ(static_cast<size_t>(write_result), data_len); |
+ |
+ if (bytes_so_far_ != offset) { |
+ // A hole is created in the file. |
+ is_sparse_file_ = true; |
+ secure_hash_.reset(); |
+ } |
+ |
bytes_so_far_ += data_len; |
net_log_.EndEvent(net::NetLogEventType::DOWNLOAD_FILE_WRITTEN, |
net::NetLog::Int64Callback("bytes", data_len)); |