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

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: Removed a DCHECK for unit test. 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..539f29be4d0b1a9d4d1d28f4dd5a267329e315ab 100644
--- a/content/browser/download/parallel_download_job.cc
+++ b/content/browser/download/parallel_download_job.cc
@@ -97,6 +97,17 @@ bool ParallelDownloadJob::UsesParallelRequests() const {
return true;
}
+void ParallelDownloadJob::CancelRequestWithOffset(int64_t offset) {
+ if (initial_request_offset_ == offset) {
+ DownloadJobImpl::Cancel(false);
asanka 2017/04/21 15:09:28 I guess the expectation is that this will go throu
xingliu 2017/04/21 18:07:00 ParallelDownloadComplete browser test covers this
xingliu 2017/04/22 00:07:24 The flow is DownloadFileImpl ==> DownloadItemImpl
+ return;
+ }
+
+ auto it = workers_.find(offset);
+ if (it != workers_.end())
+ it->second->Cancel();
asanka 2017/04/21 15:09:28 Is there a reason to consider the |it == workers_.
xingliu 2017/04/22 00:07:24 Done, added a DCHECK. In the long term, after the
+}
+
void ParallelDownloadJob::BuildParallelRequestAfterDelay() {
DCHECK(workers_.empty());
DCHECK(!requests_sent_);

Powered by Google App Engine
This is Rietveld 408576698