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

Unified Diff: content/public/test/test_file_error_injector.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/mock_download_file.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/test_file_error_injector.cc
diff --git a/content/public/test/test_file_error_injector.cc b/content/public/test/test_file_error_injector.cc
index 7d90a5dec2a53fd9c3097c0b949cd8fee334cc2b..867d1a00d3cff345101ed4bc288c190c9f9a4eb6 100644
--- a/content/public/test/test_file_error_injector.cc
+++ b/content/public/test/test_file_error_injector.cc
@@ -34,7 +34,6 @@ class DownloadFileWithError: public DownloadFileImpl {
std::unique_ptr<DownloadSaveInfo> save_info,
const base::FilePath& default_download_directory,
std::unique_ptr<ByteStreamReader> byte_stream,
- const std::vector<DownloadItem::ReceivedSlice>& received_slices,
const net::NetLogWithSource& net_log,
base::WeakPtr<DownloadDestinationObserver> observer,
const TestFileErrorInjector::FileErrorInfo& error_info,
@@ -43,7 +42,8 @@ class DownloadFileWithError: public DownloadFileImpl {
~DownloadFileWithError() override;
- void Initialize(const InitializeCallback& callback) override;
+ void Initialize(const InitializeCallback& callback,
+ const DownloadItem::ReceivedSlices& received_slices) override;
// DownloadFile interface.
DownloadInterruptReason WriteDataToFile(int64_t offset,
@@ -106,7 +106,6 @@ DownloadFileWithError::DownloadFileWithError(
std::unique_ptr<DownloadSaveInfo> save_info,
const base::FilePath& default_download_directory,
std::unique_ptr<ByteStreamReader> byte_stream,
- const std::vector<DownloadItem::ReceivedSlice>& received_slices,
const net::NetLogWithSource& net_log,
base::WeakPtr<DownloadDestinationObserver> observer,
const TestFileErrorInjector::FileErrorInfo& error_info,
@@ -115,7 +114,6 @@ DownloadFileWithError::DownloadFileWithError(
: DownloadFileImpl(std::move(save_info),
default_download_directory,
std::move(byte_stream),
- received_slices,
net_log,
observer),
error_info_(error_info),
@@ -135,7 +133,8 @@ DownloadFileWithError::~DownloadFileWithError() {
}
void DownloadFileWithError::Initialize(
- const InitializeCallback& callback) {
+ const InitializeCallback& callback,
+ const DownloadItem::ReceivedSlices& received_slices) {
DownloadInterruptReason error_to_return = DOWNLOAD_INTERRUPT_REASON_NONE;
InitializeCallback callback_to_use = callback;
@@ -157,7 +156,7 @@ void DownloadFileWithError::Initialize(
error_to_return);
}
- DownloadFileImpl::Initialize(callback_to_use);
+ DownloadFileImpl::Initialize(callback_to_use, received_slices);
}
DownloadInterruptReason DownloadFileWithError::WriteDataToFile(
@@ -264,7 +263,6 @@ class DownloadFileWithErrorFactory : public DownloadFileFactory {
std::unique_ptr<DownloadSaveInfo> save_info,
const base::FilePath& default_download_directory,
std::unique_ptr<ByteStreamReader> byte_stream,
- const std::vector<DownloadItem::ReceivedSlice>& received_slices,
const net::NetLogWithSource& net_log,
base::WeakPtr<DownloadDestinationObserver> observer) override;
@@ -295,13 +293,11 @@ DownloadFile* DownloadFileWithErrorFactory::CreateFile(
std::unique_ptr<DownloadSaveInfo> save_info,
const base::FilePath& default_download_directory,
std::unique_ptr<ByteStreamReader> byte_stream,
- const std::vector<DownloadItem::ReceivedSlice>& received_slices,
const net::NetLogWithSource& net_log,
base::WeakPtr<DownloadDestinationObserver> observer) {
return new DownloadFileWithError(std::move(save_info),
default_download_directory,
std::move(byte_stream),
- received_slices,
net_log,
observer,
injected_error_,
« no previous file with comments | « content/browser/download/mock_download_file.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698