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

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

Issue 2812263004: Properly handle the case when a parallel download becomes non-parallel (Closed)
Patch Set: rebase 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
« no previous file with comments | « no previous file | content/browser/download/parallel_download_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2d0a2c4a7489b3298a2e9eb0e73697350c036d9d..b4a1d46dfd2b3f407c0fab0a68a94bf8d7f7bcd5 100644
--- a/content/browser/download/download_item_impl.cc
+++ b/content/browser/download/download_item_impl.cc
@@ -1292,6 +1292,14 @@ void DownloadItemImpl::Start(
if (state_ == RESUMING_INTERNAL)
UpdateValidatorsOnResumption(new_create_info);
+ // If the download uses parallel requests, and choose not to create parallel
+ // request during resumption, clear the received_slices_ vector.
+ if (!job_->UsesParallelRequests() && !received_slices_.empty()) {
+ received_bytes_ =
+ GetMaxContiguousDataBlockSizeFromBeginning(received_slices_);
+ received_slices_.clear();
+ }
+
TransitionTo(TARGET_PENDING_INTERNAL);
job_->Start();
« no previous file with comments | « no previous file | content/browser/download/parallel_download_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698