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

Unified Diff: content/browser/download/download_file_impl.cc

Issue 2799333002: Clear the received slices in DownloadItemImpl when etag changed. (Closed)
Patch Set: Address the uma issue. 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
« no previous file with comments | « content/browser/download/download_file_impl.h ('k') | content/browser/download/download_file_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_file_impl.cc
diff --git a/content/browser/download/download_file_impl.cc b/content/browser/download/download_file_impl.cc
index aefe21e9a7b8b7b8a8f041b94d9bec784998e353..f65534b2c0783a97d5f587a70711d2d625077644 100644
--- a/content/browser/download/download_file_impl.cc
+++ b/content/browser/download/download_file_impl.cc
@@ -95,7 +95,6 @@ DownloadFileImpl::DownloadFileImpl(
std::unique_ptr<DownloadSaveInfo> save_info,
const base::FilePath& default_download_directory,
std::unique_ptr<ByteStreamReader> stream_reader,
- const std::vector<DownloadItem::ReceivedSlice>& received_slices,
const net::NetLogWithSource& download_item_net_log,
base::WeakPtr<DownloadDestinationObserver> observer)
: net_log_(
@@ -110,7 +109,6 @@ DownloadFileImpl::DownloadFileImpl(
record_stream_bandwidth_(true),
bytes_seen_with_parallel_streams_(0),
bytes_seen_without_parallel_streams_(0),
- received_slices_(received_slices),
observer_(observer),
weak_factory_(this) {
source_streams_[save_info_->offset] = base::MakeUnique<SourceStream>(
@@ -129,11 +127,14 @@ DownloadFileImpl::~DownloadFileImpl() {
net_log_.EndEvent(net::NetLogEventType::DOWNLOAD_FILE_ACTIVE);
}
-void DownloadFileImpl::Initialize(const InitializeCallback& callback) {
+void DownloadFileImpl::Initialize(
+ const InitializeCallback& callback,
+ const DownloadItem::ReceivedSlices& received_slices) {
DCHECK_CURRENTLY_ON(BrowserThread::FILE);
update_timer_.reset(new base::RepeatingTimer());
int64_t bytes_so_far = 0;
+ received_slices_ = received_slices;
if (IsSparseFile()) {
for (const auto& received_slice : received_slices_) {
bytes_so_far += received_slice.received_bytes;
« no previous file with comments | « content/browser/download/download_file_impl.h ('k') | content/browser/download/download_file_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698