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

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

Issue 10540132: gdata: Convert GDataFileSystem::AddUploadFile() to asynchronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use scoped_ptr for cleaner ownership transfers and automatic deletion. 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_file_system.h
diff --git a/chrome/browser/chromeos/gdata/gdata_file_system.h b/chrome/browser/chromeos/gdata/gdata_file_system.h
index 65a05d32e40dea50ac763986530b344132cf68ba..08524fb9712fbfc523b9a5665c7aa72688ddd1c7 100644
--- a/chrome/browser/chromeos/gdata/gdata_file_system.h
+++ b/chrome/browser/chromeos/gdata/gdata_file_system.h
@@ -372,11 +372,13 @@ class GDataFileSystemInterface {
// Creates a new file from |entry| under |virtual_dir_path|. Stored its
// content from |file_content_path| into the cache.
- virtual void AddUploadedFile(
- const FilePath& virtual_dir_path,
- DocumentEntry* entry,
- const FilePath& file_content_path,
- GDataCache::FileOperationType cache_operation) = 0;
+ //
+ // |callback| will be called on the UI thread upon completion of operation.
+ virtual void AddUploadedFile(const FilePath& virtual_dir_path,
+ DocumentEntry* entry,
+ const FilePath& file_content_path,
+ GDataCache::FileOperationType cache_operation,
+ const base::Closure& callback) = 0;
// Returns true if hosted documents should be hidden.
virtual bool hide_hosted_documents() = 0;
@@ -458,11 +460,11 @@ class GDataFileSystem : public GDataFileSystemInterface,
// Calls private Pin or Unpin methods with |callback|.
virtual void SetPinState(const FilePath& file_path, bool pin,
const FileOperationCallback& callback) OVERRIDE;
- virtual void AddUploadedFile(
- const FilePath& virtual_dir_path,
- DocumentEntry* entry,
- const FilePath& file_content_path,
- GDataCache::FileOperationType cache_operation) OVERRIDE;
+ virtual void AddUploadedFile(const FilePath& virtual_dir_path,
+ DocumentEntry* entry,
+ const FilePath& file_content_path,
+ GDataCache::FileOperationType cache_operation,
+ const base::Closure& callback) OVERRIDE;
virtual bool hide_hosted_documents() OVERRIDE;
// content::NotificationObserver implementation.
@@ -995,7 +997,7 @@ class GDataFileSystem : public GDataFileSystemInterface,
void OnTransferCompleted(
const FileOperationCallback& callback,
base::PlatformFileError error,
- UploadFileInfo* upload_file_info);
+ scoped_ptr<UploadFileInfo> upload_file_info);
// Kicks off file upload once it receives |upload_file_info|.
void StartFileUploadOnUIThread(
@@ -1414,6 +1416,11 @@ class GDataFileSystem : public GDataFileSystemInterface,
void GetAvailableSpaceOnUIThread(const GetAvailableSpaceCallback& callback);
void SetPinStateOnUIThread(const FilePath& file_path, bool to_pin,
const FileOperationCallback& callback);
+ void AddUploadedFileOnUIThread(const FilePath& virtual_dir_path,
+ DocumentEntry* entry,
+ const FilePath& file_content_path,
+ GDataCache::FileOperationType cache_operation,
+ const base::Closure& callback);
scoped_ptr<GDataRootDirectory> root_;

Powered by Google App Engine
This is Rietveld 408576698