Chromium Code Reviews| 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_); |