diff --git a/components/download/internal/common/download_item_impl.cc b/components/download/internal/common/download_item_impl.cc index 2c2d4e8f098ff..b702b9e78a58c 100644 --- a/components/download/internal/common/download_item_impl.cc +++ b/components/download/internal/common/download_item_impl.cc @@ -37,6 +37,7 @@ #include "base/logging.h" #include "base/metrics/histogram_functions.h" #include "base/observer_list.h" +#include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/strings/to_string.h" @@ -1454,6 +1455,11 @@ void DownloadItemImpl::OnAllDataSaved( hash_state_.reset(); // No need to retain hash_state_ since we are done with // the download and don't expect to receive any more // data. + // POC INSTRUMENTATION: emit the final hash so it can be compared against + // the actual sha256sum of the file on disk. + LOG(ERROR) << "POC-HASH-FINAL url=" << GetURL().spec() + << " bytes=" << total_bytes + << " GetHash()=" << base::HexEncode(destination_info_.hash); if (received_bytes_at_length_mismatch_ > 0) { if (total_bytes > received_bytes_at_length_mismatch_) { @@ -2618,6 +2624,9 @@ void DownloadItemImpl::ResumeInterruptedDownload( } else { // There is not enough data for validation, simply overwrites the // existing data from the beginning. + LOG(ERROR) << "POC-CLAMP-OFFSET-ZERO received_bytes=" + << GetReceivedBytes() + << " (stale hash_state already moved into params at :2604)"; download_params->set_offset(0); } }