Chromium Code Reviews| 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..991d31c8dcc0767f3da740f65a5b2b70644b2645 100644 |
| --- a/content/browser/download/download_item_impl.cc |
| +++ b/content/browser/download/download_item_impl.cc |
| @@ -1028,8 +1028,11 @@ 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(); |
| + received_bytes_ = 0; |
|
qinmin
2017/04/07 23:37:43
you either need to do this after RecordOriginState
xingliu
2017/04/08 02:29:13
Oh, I see, thanks for the suggestion, didn't notic
|
| 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 +1292,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( |