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 b4a1d46dfd2b3f407c0fab0a68a94bf8d7f7bcd5..e46aca2272e6115fa09e8341e83d95172d80d205 100644 |
| --- a/content/browser/download/download_item_impl.cc |
| +++ b/content/browser/download/download_item_impl.cc |
| @@ -1061,6 +1061,12 @@ void DownloadItemImpl::UpdateValidatorsOnResumption( |
| // notified when the download transitions to the IN_PROGRESS state. |
| } |
| +void DownloadItemImpl::CancelRequestWithOffset(int64_t offset) { |
| + DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| + if (job_) |
| + job_->CancelRequestWithOffset(offset); |
|
asanka
2017/04/21 15:09:28
It is possible that this will cancel the only requ
xingliu
2017/04/22 00:07:24
If this call cancelled the only request, the downl
|
| +} |
| + |
| void DownloadItemImpl::NotifyRemoved() { |
| for (auto& observer : observers_) |
| observer.OnDownloadRemoved(this); |
| @@ -1313,6 +1319,8 @@ void DownloadItemImpl::StartDownload() { |
| base::Unretained(download_file_.get()), |
| base::Bind(&DownloadItemImpl::OnDownloadFileInitialized, |
| weak_ptr_factory_.GetWeakPtr()), |
| + base::Bind(&DownloadItemImpl::CancelRequestWithOffset, |
| + weak_ptr_factory_.GetWeakPtr()), |
| received_slices_)); |
| } |