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

Unified Diff: content/browser/download/download_file.h

Issue 10689093: Move Rename functionality from DownloadFileManager to DownloadFileImple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd to TOT to avoid showing already committed changes in Rietveld. Created 8 years, 6 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
Index: content/browser/download/download_file.h
diff --git a/content/browser/download/download_file.h b/content/browser/download/download_file.h
index c0b4d5aaf7280e6fe40cc729e3e5b841e6b38cec..3820d900a21f889bc52db1eae014e4c0eed3d935 100644
--- a/content/browser/download/download_file.h
+++ b/content/browser/download/download_file.h
@@ -9,6 +9,7 @@
#include <string>
#include "base/basictypes.h"
+#include "base/callback_forward.h"
#include "base/file_path.h"
#include "content/common/content_export.h"
#include "content/public/browser/download_id.h"
@@ -24,6 +25,11 @@ class DownloadManager;
// cancelled, the DownloadFile is destroyed.
class CONTENT_EXPORT DownloadFile {
public:
+ // Callback used with Rename(). |reason| will be
+ // DOWNLOAD_INTERRUPT_REASON_NONE on a successful rename.
+ typedef base::Callback<void(content::DownloadInterruptReason reason,
+ const FilePath&)> RenameCompletionCallback;
+
virtual ~DownloadFile() {}
// If calculate_hash is true, sha256 hash will be calculated.
@@ -33,7 +39,9 @@ class CONTENT_EXPORT DownloadFile {
// Rename the download file.
// Returns net::OK on success, or a network error code on failure.
asanka 2012/07/05 18:47:21 Mention new arguments. In particular also mention
Randy Smith (Not in Mondays) 2012/07/09 20:35:51 Good point--thanks for catching this. Done.
- virtual DownloadInterruptReason Rename(const FilePath& full_path) = 0;
+ virtual void Rename(const FilePath& full_path,
+ bool overwrite_existing_file,
+ const RenameCompletionCallback& callback) = 0;
// Detach the file so it is not deleted on destruction.
virtual void Detach() = 0;

Powered by Google App Engine
This is Rietveld 408576698