diff options
author | rdsmith@chromium.org <rdsmith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-19 14:53:00 +0000 |
---|---|---|
committer | rdsmith@chromium.org <rdsmith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-19 14:53:00 +0000 |
commit | e2c1a644a1be1b3e0a99148ee3590b6da506d86e (patch) | |
tree | 59a8b98bf0cf48cb8229d00cd98021622b6700e7 /content/browser/download/download_file.h | |
parent | 34df2abd18b58f0a0b41fc67237a2f33c75e91b2 (diff) | |
download | chromium_src-e2c1a644a1be1b3e0a99148ee3590b6da506d86e.zip chromium_src-e2c1a644a1be1b3e0a99148ee3590b6da506d86e.tar.gz chromium_src-e2c1a644a1be1b3e0a99148ee3590b6da506d86e.tar.bz2 |
Revert 152213 - Replace the DownloadFileManager with direct ownership of DownloadFile.
This CL is a re-land of http://codereview.chromium.org/10799005, which
was reverted due to test flakiness.
BUG=123998
R=benjhayden@chromium.org
TBR=jam@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10836293
BUG=143600
TBR=rdsmith@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10861002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152282 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/download/download_file.h')
-rw-r--r-- | content/browser/download/download_file.h | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/content/browser/download/download_file.h b/content/browser/download/download_file.h index e53602d..e707a26 100644 --- a/content/browser/download/download_file.h +++ b/content/browser/download/download_file.h @@ -11,6 +11,7 @@ #include "base/callback_forward.h" #include "base/file_path.h" #include "content/common/content_export.h" +#include "content/public/browser/download_id.h" #include "content/public/browser/download_interrupt_reasons.h" namespace content { @@ -23,12 +24,6 @@ class DownloadManager; // cancelled, the DownloadFile is destroyed. class CONTENT_EXPORT DownloadFile { public: - // Callback used with Initialize. On a successful initialize, |reason| will - // be DOWNLOAD_INTERRUPT_REASON_NONE; on a failed initialize, it will be - // set to the reason for the failure. - typedef base::Callback<void(content::DownloadInterruptReason reason)> - InitializeCallback; - // 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 @@ -38,10 +33,10 @@ class CONTENT_EXPORT DownloadFile { virtual ~DownloadFile() {} + // If calculate_hash is true, sha256 hash will be calculated. // Returns DOWNLOAD_INTERRUPT_REASON_NONE on success, or a network - // error code on failure. Upon completion, |callback| will be - // called on the UI thread as per the comment above. - virtual void Initialize(const InitializeCallback& callback) = 0; + // error code on failure. + virtual DownloadInterruptReason Initialize() = 0; // Rename the download file to |full_path|. If that file exists and // |overwrite_existing_file| is false, |full_path| will be uniquified by @@ -73,11 +68,14 @@ class CONTENT_EXPORT DownloadFile { // Returns the current (intermediate) state of the hash as a byte string. virtual std::string GetHashState() = 0; - // For testing. Must be called on FILE thread. - static int GetNumberOfDownloadFiles(); + // Cancels the download request associated with this file. + virtual void CancelDownloadRequest() = 0; + + virtual int Id() const = 0; + virtual DownloadManager* GetDownloadManager() = 0; + virtual const DownloadId& GlobalId() const = 0; - protected: - static int number_active_objects_; + virtual std::string DebugString() const = 0; }; } // namespace content |