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

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

Issue 9844006: GData downloads cleanup (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: asanka review feedback Created 8 years, 9 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
===================================================================
--- chrome/browser/chromeos/gdata/gdata_uploader.h (revision 129387)
+++ chrome/browser/chromeos/gdata/gdata_uploader.h (working copy)
@@ -22,7 +22,6 @@
namespace gdata {
-class DocumentsService;
class GDataFileSystem;
struct UploadFileInfo;
@@ -32,7 +31,8 @@
virtual ~GDataUploader();
// Uploads a file specified by |upload_file_info|. Transfers ownership.
- void UploadFile(UploadFileInfo* upload_file_info);
+ // Returns the upload_id.
+ int UploadFile(scoped_ptr<UploadFileInfo> upload_file_info);
// Updates attributes of streaming upload.
void UpdateUpload(int upload_id, content::DownloadItem* download);
@@ -40,13 +40,14 @@
// Returns the count of bytes confirmed as uploaded so far.
int64 GetUploadedBytes(int upload_id) const;
+ // TODO(achuith): Make this private.
+ // Destroys |upload_file_info|.
+ void DeleteUpload(UploadFileInfo* upload_file_info);
+
private:
// Lookup UploadFileInfo* in pending_uploads_.
UploadFileInfo* GetUploadFileInfo(int upload_id) const;
- // Destroys |upload_file_info|.
- void RemovePendingUpload(UploadFileInfo* upload_file_info);
-
// Open the file.
void OpenFile(UploadFileInfo* upload_file_info);
@@ -73,12 +74,16 @@
scoped_ptr<DocumentEntry> entry);
// When upload completes, move the file into the gdata cache.
- void UploadComplete(UploadFileInfo* upload_file_info);
+ void MoveFileToCache(UploadFileInfo* upload_file_info);
+ // Handle failed uploads.
+ void UploadFailed(UploadFileInfo* upload_file_info);
+
// Private data.
GDataFileSystem* file_system_;
int next_upload_id_; // id counter.
+
typedef std::map<int, UploadFileInfo*> UploadFileInfoMap;
UploadFileInfoMap pending_uploads_;
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_upload_file_info.h ('k') | chrome/browser/chromeos/gdata/gdata_uploader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698