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

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

Issue 10759007: gdata: Move GDataFileSystem::AddUploadedFile() call out of uploader and into GDataDownloadObserver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments for Patch #10. Created 8 years, 5 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_download_observer.h
diff --git a/chrome/browser/chromeos/gdata/gdata_download_observer.h b/chrome/browser/chromeos/gdata/gdata_download_observer.h
index 576cbc93a69781cbe534edf65f225f4b1acbec86..a794cea70e54f8a32e362e178475213f1a94e2fb 100644
--- a/chrome/browser/chromeos/gdata/gdata_download_observer.h
+++ b/chrome/browser/chromeos/gdata/gdata_download_observer.h
@@ -19,6 +19,7 @@ class Profile;
namespace gdata {
class DocumentEntry;
+class GDataFileSystem;
class GDataUploader;
struct UploadFileInfo;
@@ -27,12 +28,11 @@ struct UploadFileInfo;
class GDataDownloadObserver : public content::DownloadManager::Observer,
public content::DownloadItem::Observer {
public:
- GDataDownloadObserver();
+ GDataDownloadObserver(GDataUploader* uploader, GDataFileSystem* file_system);
virtual ~GDataDownloadObserver();
// Become an observer of DownloadManager.
- void Initialize(GDataUploader* gdata_uploader,
- content::DownloadManager* download_manager,
+ void Initialize(content::DownloadManager* download_manager,
const FilePath& gdata_tmp_download_path);
typedef base::Callback<void(const FilePath&)>
@@ -114,15 +114,22 @@ class GDataDownloadObserver : public content::DownloadManager::Observer,
// Callback invoked by GDataUploader when the upload associated with
// |download_id| has completed. |error| indicated whether the
- // call was successful. This function invokes the MaybeCompleteDownload()
- // method on the DownloadItem to allow it to complete.
+ // call was successful. This function takes ownership of DocumentEntry from
+ // |upload_file_info| for use by MoveFileToGDataCache(). It also invokes the
+ // MaybeCompleteDownload() method on the DownloadItem to allow it to complete.
asanka 2012/07/11 15:56:52 Nit: This doesn't call MaybeCompleteDownload() any
void OnUploadComplete(int32 download_id,
base::PlatformFileError error,
scoped_ptr<UploadFileInfo> upload_file_info);
+ // Moves the downloaded file to gdata cache.
+ // Must be called after GDataDownloadObserver receives COMPLETE notification.
+ void MoveFileToGDataCache(content::DownloadItem* download);
+
// Private data.
- // Use GDataUploader to trigger file uploads.
+ // The uploader owned by GDataSystemService. Used to trigger file uploads.
GDataUploader* gdata_uploader_;
+ // The file system owned by GDataSystemService.
+ GDataFileSystem* file_system_;
// Observe the DownloadManager for new downloads.
content::DownloadManager* download_manager_;

Powered by Google App Engine
This is Rietveld 408576698