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

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

Issue 8372034: Created an interface for DownloadFile, for use in unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed typo Created 9 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
Index: content/browser/download/save_file.h
diff --git a/content/browser/download/save_file.h b/content/browser/download/save_file.h
index e7faaeb607fea6a278653ae3f5bc3aecb4dbb5c0..baa863d3540bd8f9a62f7b10bee2eb31d8a42a3b 100644
--- a/content/browser/download/save_file.h
+++ b/content/browser/download/save_file.h
@@ -19,11 +19,25 @@
// the saving job is 'in progress': once the saving job has been completed or
// canceled, the SaveFile is destroyed. One SaveFile object represents one item
// in a save session.
-class SaveFile : public BaseFile {
+class SaveFile {
public:
explicit SaveFile(const SaveFileCreateInfo* info);
virtual ~SaveFile();
+ // BaseFile delegated functions.
+ net::Error Initialize(bool calculate_hash);
+ net::Error AppendDataToFile(const char* data, size_t data_len);
+ net::Error Rename(const FilePath& full_path);
+ void Detach();
+ void Cancel();
+ void Finish();
+ void AnnotateWithSourceInformation();
+ FilePath FullPath() const;
+ bool InProgress() const;
+ int64 BytesSoFar() const;
+ bool GetSha256Hash(std::string* hash);
+ std::string DebugString() const;
+
// Accessors.
int save_id() const { return info_->save_id; }
int render_process_id() const { return info_->render_process_id; }
@@ -34,6 +48,7 @@ class SaveFile : public BaseFile {
}
private:
+ BaseFile file_;
scoped_ptr<const SaveFileCreateInfo> info_;
DISALLOW_COPY_AND_ASSIGN(SaveFile);

Powered by Google App Engine
This is Rietveld 408576698