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

Unified Diff: content/browser/download/download_browsertest.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 | « no previous file | content/browser/download/download_file.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_browsertest.cc
diff --git a/content/browser/download/download_browsertest.cc b/content/browser/download/download_browsertest.cc
index a5a78253e13c17af7b786b9a34fced6ce5cd3440..38ad2db686ab49f286c0b6e78b3aedbf7695cb2b 100644
--- a/content/browser/download/download_browsertest.cc
+++ b/content/browser/download/download_browsertest.cc
@@ -135,7 +135,6 @@ class DownloadFileWithDelay : public DownloadFileImpl {
std::unique_ptr<DownloadSaveInfo> save_info,
const base::FilePath& default_download_directory,
std::unique_ptr<ByteStreamReader> stream,
- const std::vector<DownloadItem::ReceivedSlice>& received_slices,
const net::NetLogWithSource& net_log,
std::unique_ptr<device::PowerSaveBlocker> power_save_blocker,
base::WeakPtr<DownloadDestinationObserver> observer,
@@ -182,7 +181,6 @@ class DownloadFileWithDelayFactory : public DownloadFileFactory {
std::unique_ptr<DownloadSaveInfo> save_info,
const base::FilePath& default_download_directory,
std::unique_ptr<ByteStreamReader> stream,
- const std::vector<DownloadItem::ReceivedSlice>& received_slices,
const net::NetLogWithSource& net_log,
base::WeakPtr<DownloadDestinationObserver> observer) override;
@@ -204,7 +202,6 @@ DownloadFileWithDelay::DownloadFileWithDelay(
std::unique_ptr<DownloadSaveInfo> save_info,
const base::FilePath& default_download_directory,
std::unique_ptr<ByteStreamReader> stream,
- const std::vector<DownloadItem::ReceivedSlice>& received_slices,
const net::NetLogWithSource& net_log,
std::unique_ptr<device::PowerSaveBlocker> power_save_blocker,
base::WeakPtr<DownloadDestinationObserver> observer,
@@ -212,7 +209,6 @@ DownloadFileWithDelay::DownloadFileWithDelay(
: DownloadFileImpl(std::move(save_info),
default_download_directory,
std::move(stream),
- received_slices,
net_log,
observer),
owner_(owner) {}
@@ -266,7 +262,6 @@ DownloadFile* DownloadFileWithDelayFactory::CreateFile(
std::unique_ptr<DownloadSaveInfo> save_info,
const base::FilePath& default_download_directory,
std::unique_ptr<ByteStreamReader> stream,
- const std::vector<DownloadItem::ReceivedSlice>& received_slices,
const net::NetLogWithSource& net_log,
base::WeakPtr<DownloadDestinationObserver> observer) {
std::unique_ptr<device::PowerSaveBlocker> psb(new device::PowerSaveBlocker(
@@ -277,7 +272,6 @@ DownloadFile* DownloadFileWithDelayFactory::CreateFile(
return new DownloadFileWithDelay(std::move(save_info),
default_download_directory,
std::move(stream),
- received_slices,
net_log,
std::move(psb),
observer,
@@ -313,14 +307,12 @@ class CountingDownloadFile : public DownloadFileImpl {
std::unique_ptr<DownloadSaveInfo> save_info,
const base::FilePath& default_downloads_directory,
std::unique_ptr<ByteStreamReader> stream,
- const std::vector<DownloadItem::ReceivedSlice>& received_slices,
const net::NetLogWithSource& net_log,
std::unique_ptr<device::PowerSaveBlocker> power_save_blocker,
base::WeakPtr<DownloadDestinationObserver> observer)
: DownloadFileImpl(std::move(save_info),
default_downloads_directory,
std::move(stream),
- received_slices,
net_log,
observer) {}
@@ -329,10 +321,12 @@ class CountingDownloadFile : public DownloadFileImpl {
active_files_--;
}
- void Initialize(const InitializeCallback& callback) override {
+ void Initialize(
+ const InitializeCallback& callback,
+ const DownloadItem::ReceivedSlices& received_slices) override {
DCHECK_CURRENTLY_ON(BrowserThread::FILE);
active_files_++;
- return DownloadFileImpl::Initialize(callback);
+ DownloadFileImpl::Initialize(callback, received_slices);
}
static void GetNumberActiveFiles(int* result) {
@@ -369,7 +363,6 @@ class CountingDownloadFileFactory : public DownloadFileFactory {
std::unique_ptr<DownloadSaveInfo> save_info,
const base::FilePath& default_downloads_directory,
std::unique_ptr<ByteStreamReader> stream,
- const std::vector<DownloadItem::ReceivedSlice>& received_slices,
const net::NetLogWithSource& net_log,
base::WeakPtr<DownloadDestinationObserver> observer) override {
std::unique_ptr<device::PowerSaveBlocker> psb(new device::PowerSaveBlocker(
@@ -380,7 +373,6 @@ class CountingDownloadFileFactory : public DownloadFileFactory {
return new CountingDownloadFile(std::move(save_info),
default_downloads_directory,
std::move(stream),
- received_slices,
net_log,
std::move(psb),
observer);
« no previous file with comments | « no previous file | content/browser/download/download_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698