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

Unified Diff: content/browser/download/parallel_download_job.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/parallel_download_job.cc
diff --git a/content/browser/download/parallel_download_job.cc b/content/browser/download/parallel_download_job.cc
index 5a3af37402aec99f0743fa73cbc5b583f4a12cb0..d66775469c5993daf16f01659cc2ee477ed1fc04 100644
--- a/content/browser/download/parallel_download_job.cc
+++ b/content/browser/download/parallel_download_job.cc
@@ -97,6 +97,15 @@ bool ParallelDownloadJob::UsesParallelRequests() const {
return true;
}
+void ParallelDownloadJob::CancelRequestWithOffset(int64_t offset) {
+ if (initial_request_offset_ == offset)
+ DownloadJobImpl::Cancel(false);
qinmin 2017/04/17 21:39:59 early return?
xingliu 2017/04/17 23:41:51 Done, make sense.
+
+ auto it = workers_.find(offset);
+ if (it != workers_.end())
+ it->second->Cancel();
+}
+
void ParallelDownloadJob::BuildParallelRequestAfterDelay() {
DCHECK(workers_.empty());
DCHECK(!requests_sent_);
« content/browser/download/download_file.h ('K') | « content/browser/download/parallel_download_job.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698