Chromium Code Reviews| 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 34571f5990cb2b72854feeeef99104b3017c7b33..99539a3a9ae527aef7f7e39135f355465a326663 100644 |
| --- a/content/browser/download/download_item_impl.cc |
| +++ b/content/browser/download/download_item_impl.cc |
| @@ -45,6 +45,7 @@ |
| #include "content/browser/download/download_net_log_parameters.h" |
| #include "content/browser/download/download_request_handle.h" |
| #include "content/browser/download/download_stats.h" |
| +#include "content/browser/download/parallel_download_utils.h" |
| #include "content/browser/renderer_host/render_view_host_impl.h" |
| #include "content/browser/web_contents/web_contents_impl.h" |
| #include "content/public/browser/browser_context.h" |
| @@ -1944,7 +1945,13 @@ void DownloadItemImpl::ResumeInterruptedDownload( |
| new DownloadUrlParameters(GetURL(), |
| storage_partition->GetURLRequestContext())); |
| download_params->set_file_path(GetFullPath()); |
| - download_params->set_offset(GetReceivedBytes()); |
| + if (received_slices_.size() > 1) { |
|
xingliu
2017/03/01 23:03:59
Does FindNextSliceToDownload assume the slices are
qinmin
2017/03/01 23:25:27
No,there is no such assumptions. For download resu
xingliu
2017/03/02 00:23:51
Following up the size of received_slices, if the s
xingliu
2017/03/02 00:23:51
So this function mainly serves for sending the fir
qinmin
2017/03/02 01:00:39
The case you described(main request returns no sli
|
| + ReceivedSlice next_slice = FindNextSliceToDownload(received_slices_); |
| + download_params->set_offset(next_slice.offset); |
| + download_params->set_length(next_slice.received_bytes); |
| + } else { |
| + download_params->set_offset(GetReceivedBytes()); |
| + } |
| download_params->set_last_modified(GetLastModifiedTime()); |
| download_params->set_etag(GetETag()); |
| download_params->set_hash_of_partial_file(hash_); |