DescriptionClear the received slices in DownloadItemImpl when etag changed.
For parallel download, the received slices are currently passed in the
constructor of DownloadFileImpl, which is earlier than the etag check
logic in DownloadItemImpl. This raises an issue that the
DownloadFileImpl will use the out-dated received slices data. It will
block the download to refresh the data with new strong validators, and
download won't complete.
This CL cleared the received slices in DownloadItemImpl, and pass the
received slices to DownloadFileImpl via Initialize call instead of the
ctor.
Alternatively we may do it in DownloadManagerImpl, but it's probably
better to do this kind of clean up in DownloadItemImpl.
When etag changes, currently for a normal download, we update the etag
in DownloadItemImpl::UpdateValidatorsOnResumption, and
DownloadSaveInfo::offset is set to 0 in
DownloadRequestCore::HandleSuccessfulServerResponse, where we pass this
0 offset to BaseFile::Initialize to truncate the file size to 0.
BUG=706182, 644352
Review-Url: https://codereview.chromium.org/2799333002
Cr-Commit-Position: refs/heads/master@{#463417}
Committed: https://chromium.googlesource.com/chromium/src/+/583a61ad6d736c81b9f82c9e24676af19ce868e9
Patch Set 1 #
Total comments: 3
Patch Set 2 : Work on feedback. #Patch Set 3 : Work on feedback. #
Total comments: 2
Patch Set 4 : Address the uma issue. #Messages
Total messages: 27 (14 generated)
|