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

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

Issue 10540132: gdata: Convert GDataFileSystem::AddUploadFile() to asynchronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Get rid of the lock as suggested by Satoru. 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 b3bb8da3c5b1fa3770e030a813f1ed40febb7444..e737ee63dbdd4b600cdeff1ea2c3c82b33d27dec 100644
--- a/chrome/browser/chromeos/gdata/gdata_uploader.h
+++ b/chrome/browser/chromeos/gdata/gdata_uploader.h
@@ -43,10 +43,6 @@ class GDataUploader {
// 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;
@@ -83,6 +79,15 @@ class GDataUploader {
void UploadFailed(UploadFileInfo* upload_file_info,
achuithb 2012/06/14 22:27:18 Can we use a scoped_ptr here too?
hshi1 2012/06/15 00:16:28 Done.
base::PlatformFileError error);
+ // Removes |upload_id| from UploadFileInfoMap |pending_uploads_|.
+ // Note that this does not delete the UploadFileInfo object itself,
+ // because it may still be in use by an asynchronous function.
+ void RemoveUpload(int upload_id);
+
+ // Helper function to delete the UploadFileInfo object after completion
+ // of AddUploadedFile.
+ void OnAddUploadFileComplete(UploadFileInfo* upload_file_info);
achuithb 2012/06/14 22:27:18 Why does this need to be a member function? I thin
hshi1 2012/06/15 00:16:28 Done.
+
// Pointers to GDataFileSystem and DocumentsServiceInterface objects owned by
// GDataSystemService. The lifetime of these two objects is guaranteed to
// exceed that of the GDataUploader instance.

Powered by Google App Engine
This is Rietveld 408576698