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

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

Issue 11366121: Split DownloadFile::Rename into RenameAndUniquify and RenameAndAnnotate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync to LKGR. Created 8 years, 1 month 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_browsertest.cc ('k') | content/browser/download/download_file_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_file.h
diff --git a/content/browser/download/download_file.h b/content/browser/download/download_file.h
index 7e57d211d020abd60dc6835ffcfd028a4390169c..3ca9717b39557d3d094c2979b7f96e5f3aa1bb70 100644
--- a/content/browser/download/download_file.h
+++ b/content/browser/download/download_file.h
@@ -29,18 +29,13 @@ class CONTENT_EXPORT DownloadFile {
typedef base::Callback<void(DownloadInterruptReason reason)>
InitializeCallback;
- // Callback used with Rename(). On a successful rename |reason| will be
+ // Callback used with Rename*(). On a successful rename |reason| will be
// DOWNLOAD_INTERRUPT_REASON_NONE and |path| the path the rename
// was done to. On a failed rename, |reason| will contain the
// error.
typedef base::Callback<void(DownloadInterruptReason reason,
const FilePath& path)> RenameCompletionCallback;
- // Callback used with Detach(). On success, |reason| will be
- // DOWNLOAD_INTERRUPT_REASON_NONE.
- typedef base::Callback<void(DownloadInterruptReason reason)>
- DetachCompletionCallback;
-
virtual ~DownloadFile() {}
// Returns DOWNLOAD_INTERRUPT_REASON_NONE on success, or a network
@@ -48,18 +43,20 @@ class CONTENT_EXPORT DownloadFile {
// called on the UI thread as per the comment above.
virtual void Initialize(const InitializeCallback& callback) = 0;
- // Rename the download file to |full_path|. If that file exists and
- // |overwrite_existing_file| is false, |full_path| will be uniquified by
- // suffixing " (<number>)" to the file name before the extension.
- // Upon completion, |callback| will be called on the UI thread
- // as per the comment above.
- virtual void Rename(const FilePath& full_path,
- bool overwrite_existing_file,
- const RenameCompletionCallback& callback) = 0;
+ // Rename the download file to |full_path|. If that file exists
+ // |full_path| will be uniquified by suffixing " (<number>)" to the
+ // file name before the extension.
+ virtual void RenameAndUniquify(const FilePath& full_path,
+ const RenameCompletionCallback& callback) = 0;
+
+ // Rename the download file to |full_path| and annotate it with
+ // "Mark of the Web" information about its source. No uniquification
+ // will be performed.
+ virtual void RenameAndAnnotate(const FilePath& full_path,
+ const RenameCompletionCallback& callback) = 0;
// Detach the file so it is not deleted on destruction.
- // |callback| will be called on the UI thread after detach.
- virtual void Detach(const DetachCompletionCallback& callback) = 0;
+ virtual void Detach() = 0;
// Abort the download and automatically close the file.
virtual void Cancel() = 0;
« no previous file with comments | « content/browser/download/download_browsertest.cc ('k') | content/browser/download/download_file_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698