Index: content/browser/download/download_item_impl.cc |
diff --git a/content/browser/download/download_item_impl.cc b/content/browser/download/download_item_impl.cc |
index 5c2286bb11e6e38aafc0ea569ea1ea3040947b3a..68a29641a20793b79af074c1acb22be3ff6e333e 100644 |
--- a/content/browser/download/download_item_impl.cc |
+++ b/content/browser/download/download_item_impl.cc |
@@ -1028,8 +1028,10 @@ void DownloadItemImpl::UpdateValidatorsOnResumption( |
if (chain_iter != new_create_info.url_chain.end()) |
origin_state |= ORIGIN_STATE_ON_RESUMPTION_ADDITIONAL_REDIRECTS; |
if (etag_ != new_create_info.etag || |
- last_modified_time_ != new_create_info.last_modified) |
+ last_modified_time_ != new_create_info.last_modified) { |
+ received_slices_.clear(); |
qinmin
2017/04/07 18:03:49
should we also clear the received_bytes_ after the
xingliu
2017/04/07 20:50:08
Done.
Make sense, it's good to clear received sli
xingliu
2017/04/07 22:18:03
Done,
Sorry that I somehow misunderstood the comm
|
origin_state |= ORIGIN_STATE_ON_RESUMPTION_VALIDATORS_CHANGED; |
+ } |
if (content_disposition_ != new_create_info.content_disposition) |
origin_state |= ORIGIN_STATE_ON_RESUMPTION_CONTENT_DISPOSITION_CHANGED; |
RecordOriginStateOnResumption(received_bytes_ != 0, origin_state); |
@@ -1289,7 +1291,8 @@ void DownloadItemImpl::StartDownload() { |
// Safe because we control download file lifetime. |
base::Unretained(download_file_.get()), |
base::Bind(&DownloadItemImpl::OnDownloadFileInitialized, |
- weak_ptr_factory_.GetWeakPtr()))); |
+ weak_ptr_factory_.GetWeakPtr()), |
+ received_slices_)); |
} |
void DownloadItemImpl::OnDownloadFileInitialized( |