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

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

Issue 10861002: Revert 152213 - Replace the DownloadFileManager with direct ownership of DownloadFile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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/base_file.cc ('k') | content/browser/download/download_file_factory.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
===================================================================
--- content/browser/download/download_file.h (revision 152281)
+++ content/browser/download/download_file.h (working copy)
@@ -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 @@
// 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 @@
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 @@
// 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;
- protected:
- static int number_active_objects_;
+ virtual int Id() const = 0;
+ virtual DownloadManager* GetDownloadManager() = 0;
+ virtual const DownloadId& GlobalId() const = 0;
+
+ virtual std::string DebugString() const = 0;
};
} // namespace content
« no previous file with comments | « content/browser/download/base_file.cc ('k') | content/browser/download/download_file_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698