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

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: Fixed compiling for unit tests. 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..a50f7d477b6f131cf89276a3842834ffd281198f 100644
--- a/content/browser/download/download_item_impl.cc
+++ b/content/browser/download/download_item_impl.cc
@@ -1115,7 +1115,8 @@ void DownloadItemImpl::MarkAsComplete() {
void DownloadItemImpl::DestinationUpdate(
int64_t bytes_so_far,
int64_t bytes_per_sec,
- const std::vector<DownloadItem::ReceivedSlice>& received_slices) {
+ const std::vector<DownloadItem::ReceivedSlice>& received_slices,
+ const std::unordered_set<int64_t>& stream_to_close) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
// If the download is in any other state we don't expect any
// DownloadDestinationObserver callbacks. An interruption or a cancellation
@@ -1133,6 +1134,12 @@ void DownloadItemImpl::DestinationUpdate(
UpdateProgress(bytes_so_far, bytes_per_sec);
received_slices_ = received_slices;
+
+ if (job_) {
+ for (int64_t offset : stream_to_close)
+ job_->CancelRequest(offset);
+ }
+
if (net_log_.IsCapturing()) {
net_log_.AddEvent(
net::NetLogEventType::DOWNLOAD_ITEM_UPDATED,

Powered by Google App Engine
This is Rietveld 408576698