Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(395)

Unified Diff: content/browser/download/download_item_impl.cc

Issue 2811293004: Fix an issue that we didn't clean url request properly. (Closed)
Patch Set: Work on feedback. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 966bbae3807574f5ff580ccdaecb4a680d5046b7..a46a353b990606cd2bd2888f212249733dab61cf 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);
+}
+
void DownloadItemImpl::NotifyRemoved() {
for (auto& observer : observers_)
observer.OnDownloadRemoved(this);
@@ -1303,6 +1309,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_));
}

Powered by Google App Engine
This is Rietveld 408576698