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

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

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.cc
diff --git a/content/browser/download/save_file.cc b/content/browser/download/save_file.cc
index 980f46e02b2e90d09f5d2296b946100b63f8be93..599ad760955be846db92beb768742dde9f372338 100644
--- a/content/browser/download/save_file.cc
+++ b/content/browser/download/save_file.cc
@@ -11,7 +11,7 @@
using content::BrowserThread;
SaveFile::SaveFile(const SaveFileCreateInfo* info)
- : BaseFile(FilePath(), info->url, GURL(), 0, linked_ptr<net::FileStream>()),
+ : file_(FilePath(), info->url, GURL(), 0, linked_ptr<net::FileStream>()),
info_(info) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
@@ -22,3 +22,51 @@ SaveFile::SaveFile(const SaveFileCreateInfo* info)
SaveFile::~SaveFile() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
}
+
+net::Error SaveFile::Initialize(bool calculate_hash) {
+ return file_.Initialize(calculate_hash);
+}
+
+net::Error SaveFile::AppendDataToFile(const char* data, size_t data_len) {
+ return file_.AppendDataToFile(data, data_len);
+}
+
+net::Error SaveFile::Rename(const FilePath& full_path) {
+ return file_.Rename(full_path);
+}
+
+void SaveFile::Detach() {
+ file_.Detach();
+}
+
+void SaveFile::Cancel() {
+ file_.Cancel();
+}
+
+void SaveFile::Finish() {
+ file_.Finish();
+}
+
+void SaveFile::AnnotateWithSourceInformation() {
+ file_.AnnotateWithSourceInformation();
+}
+
+FilePath SaveFile::FullPath() const {
+ return file_.full_path();
+}
+
+bool SaveFile::InProgress() const {
+ return file_.in_progress();
+}
+
+int64 SaveFile::BytesSoFar() const {
+ return file_.bytes_so_far();
+}
+
+bool SaveFile::GetSha256Hash(std::string* hash) {
+ return file_.GetSha256Hash(hash);
+}
+
+std::string SaveFile::DebugString() const {
+ return file_.DebugString();
+}

Powered by Google App Engine
This is Rietveld 408576698