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

Unified Diff: chrome/browser/chromeos/gdata/gdata_uploader.h

Issue 10640006: gdata: Stop getting GDataUploader via GDataSystemService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add OVERRIDE Created 8 years, 6 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
Index: chrome/browser/chromeos/gdata/gdata_uploader.h
diff --git a/chrome/browser/chromeos/gdata/gdata_uploader.h b/chrome/browser/chromeos/gdata/gdata_uploader.h
index 6a6be7a59ecc4141843f4ad9321990e6b3594da5..7e9a47b7497edd5010330318429df1a38f248873 100644
--- a/chrome/browser/chromeos/gdata/gdata_uploader.h
+++ b/chrome/browser/chromeos/gdata/gdata_uploader.h
@@ -27,21 +27,46 @@ class GDataFileSystem;
class DocumentsServiceInterface;
struct UploadFileInfo;
-class GDataUploader {
+class GDataUploaderInterface {
public:
- explicit GDataUploader(GDataFileSystem* file_system,
- DocumentsServiceInterface* documents_service);
- virtual ~GDataUploader();
+ ~GDataUploaderInterface() {}
// Uploads a file specified by |upload_file_info|. Transfers ownership.
// Returns the upload_id.
- int UploadFile(scoped_ptr<UploadFileInfo> upload_file_info);
+ //
+ // WARNING: This is not mockable by gmock because it takes scoped_ptr<>.
+ // See "Announcing scoped_ptr<>::Pass(). The latest in pointer ownership
+ // technology!" thread on chromium-dev.
+ virtual int UploadFile(scoped_ptr<UploadFileInfo> upload_file_info) = 0;
// Updates attributes of streaming upload.
- void UpdateUpload(int upload_id, content::DownloadItem* download);
+ virtual void UpdateUpload(int upload_id,
+ content::DownloadItem* download) = 0;
// Returns the count of bytes confirmed as uploaded so far.
- int64 GetUploadedBytes(int upload_id) const;
+ virtual int64 GetUploadedBytes(int upload_id) const = 0;
+};
+
+class GDataUploader : public GDataUploaderInterface {
+ public:
+ explicit GDataUploader(DocumentsServiceInterface* documents_service);
+ virtual ~GDataUploader();
+
+ // Sets the file system. This must be called before calling other member
+ // functions.
+ //
+ // TODO(satorux): The dependency to GDataFileSystem should be
+ // eliminated. http://crbug.com/133860
+ void set_file_system(GDataFileSystem* file_system) {
+ file_system_ = file_system;
+ }
+
+ // GDataUploaderInterface overrides.
+ virtual int UploadFile(
+ scoped_ptr<UploadFileInfo> upload_file_info) OVERRIDE;
+ virtual void UpdateUpload(
+ int upload_id, content::DownloadItem* download) OVERRIDE;
+ virtual int64 GetUploadedBytes(int upload_id) const OVERRIDE;
private:
// Lookup UploadFileInfo* in pending_uploads_.
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_system_service.cc ('k') | chrome/browser/chromeos/gdata/gdata_uploader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698