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

Unified Diff: content/test/test_file_error_injector.cc

Issue 10702151: Revert 146162 - Move Rename functionality from DownloadFileManager to DownloadFileImple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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/public/test/mock_download_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/test_file_error_injector.cc
===================================================================
--- content/test/test_file_error_injector.cc (revision 146176)
+++ content/test/test_file_error_injector.cc (working copy)
@@ -55,9 +55,8 @@
virtual content::DownloadInterruptReason Initialize() OVERRIDE;
virtual content::DownloadInterruptReason AppendDataToFile(
const char* data, size_t data_len) OVERRIDE;
- virtual void Rename(const FilePath& full_path,
- bool overwrite_existing_file,
- const RenameCompletionCallback& callback) OVERRIDE;
+ virtual content::DownloadInterruptReason Rename(
+ const FilePath& full_path) OVERRIDE;
private:
// Error generating helper.
@@ -65,13 +64,6 @@
content::TestFileErrorInjector::FileOperationCode code,
content::DownloadInterruptReason original_error);
- // Used in place of original rename callback to intercept with
- // ShouldReturnError.
- void RenameErrorCallback(
- const RenameCompletionCallback& original_callback,
- content::DownloadInterruptReason original_error,
- const FilePath& path_result);
-
// Source URL for the file being downloaded.
GURL source_url_;
@@ -126,16 +118,11 @@
DownloadFileImpl::AppendDataToFile(data, data_len));
}
-void DownloadFileWithErrors::Rename(
- const FilePath& full_path,
- bool overwrite_existing_file,
- const RenameCompletionCallback& callback) {
- DownloadFileImpl::Rename(
- full_path, overwrite_existing_file,
- base::Bind(&DownloadFileWithErrors::RenameErrorCallback,
- // Unretained since this'll only be called from
- // the DownloadFileImpl slice of the same object.
- base::Unretained(this), callback));
+content::DownloadInterruptReason DownloadFileWithErrors::Rename(
+ const FilePath& full_path) {
+ return ShouldReturnError(
+ content::TestFileErrorInjector::FILE_OPERATION_RENAME,
+ DownloadFileImpl::Rename(full_path));
}
content::DownloadInterruptReason DownloadFileWithErrors::ShouldReturnError(
@@ -165,15 +152,6 @@
return error_info_.error;
}
-void DownloadFileWithErrors::RenameErrorCallback(
- const RenameCompletionCallback& original_callback,
- content::DownloadInterruptReason original_error,
- const FilePath& path_result) {
- original_callback.Run(ShouldReturnError(
- content::TestFileErrorInjector::FILE_OPERATION_RENAME,
- original_error), path_result);
-}
-
} // namespace
namespace content {
@@ -189,7 +167,7 @@
virtual ~DownloadFileWithErrorsFactory();
// DownloadFileFactory interface.
- virtual DownloadFile* CreateFile(
+ virtual content::DownloadFile* CreateFile(
DownloadCreateInfo* info,
scoped_ptr<content::ByteStreamReader> stream,
content::DownloadManager* download_manager,
« no previous file with comments | « content/public/test/mock_download_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698