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

Unified Diff: content/public/test/test_file_error_injector.cc

Issue 2734493003: Pass slice info to DownloadFileImpl (Closed)
Patch Set: rebase Created 3 years, 9 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_manager_impl_unittest.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 55e11b8e5dae0466e0b0307ad7e8dfc1cf72e1ec..00e7e0b6dc71bf7971e3155b99a524fc2348d85e 100644
--- a/content/public/test/test_file_error_injector.cc
+++ b/content/public/test/test_file_error_injector.cc
@@ -30,14 +30,16 @@ namespace {
// A class that performs file operations and injects errors.
class DownloadFileWithError: public DownloadFileImpl {
public:
- DownloadFileWithError(std::unique_ptr<DownloadSaveInfo> save_info,
- const base::FilePath& default_download_directory,
- std::unique_ptr<ByteStreamReader> byte_stream,
- const net::NetLogWithSource& net_log,
- base::WeakPtr<DownloadDestinationObserver> observer,
- const TestFileErrorInjector::FileErrorInfo& error_info,
- const base::Closure& ctor_callback,
- const base::Closure& dtor_callback);
+ 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,
+ const base::Closure& ctor_callback,
+ const base::Closure& dtor_callback);
~DownloadFileWithError() override;
@@ -104,6 +106,7 @@ 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,
@@ -112,6 +115,7 @@ DownloadFileWithError::DownloadFileWithError(
: DownloadFileImpl(std::move(save_info),
default_download_directory,
std::move(byte_stream),
+ received_slices,
net_log,
false, /* is_sparse_file */
observer),
@@ -261,6 +265,7 @@ 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;
@@ -291,11 +296,13 @@ 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/download_manager_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698