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

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

Issue 10543037: gdata: Convert public synchronous functions in GDataFileSystem to asynchronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 a34fa3ed40ae68f297bd5fb3d21ff1a5b1000179..902436b66dd163fbde7f45d75b89310ae6eef1a4 100644
--- a/chrome/browser/chromeos/gdata/gdata_file_system.h
+++ b/chrome/browser/chromeos/gdata/gdata_file_system.h
@@ -125,21 +125,6 @@ typedef base::Callback<void(const std::string& resource_id)>
typedef base::Callback<void(base::PlatformFileError error,
int cache_state)> GetCacheStateCallback;
-// Helper structure used for extracting key properties from GDataFile object.
-// TODO(satorux): Remove this as part of crosbug.com/30066
-struct GDataFileProperties {
- GDataFileProperties();
- ~GDataFileProperties();
-
- base::PlatformFileInfo file_info;
- std::string resource_id;
- std::string file_md5;
- std::string mime_type;
- GURL content_url;
- GURL alternate_url;
- bool is_hosted_document;
-};
-
// GData file system abstraction layer.
// The interface is defined to make GDataFileSystem mockable.
class GDataFileSystemInterface {
@@ -414,13 +399,6 @@ class GDataFileSystemInterface {
virtual void SearchAsync(const std::string& search_query,
const ReadDirectoryCallback& callback) = 0;
-
- // Finds a file (not a directory) by |file_path| and returns its key
- // |properties|. Returns true if file was found.
- // TODO(satorux): Remove this: crosbug.com/30066.
- virtual bool GetFileInfoByPath(const FilePath& file_path,
- GDataFileProperties* properties) = 0;
-
// Returns true if the given path is under gdata cache directory, i.e.
// <user_profile_dir>/GCache/v1
virtual bool IsUnderGDataCacheDirectory(const FilePath& path) const = 0;
@@ -531,8 +509,6 @@ class GDataFileSystem : public GDataFileSystemInterface,
const ReadDirectoryCallback& callback) OVERRIDE;
virtual void RequestDirectoryRefresh(
const FilePath& file_path) OVERRIDE;
- virtual bool GetFileInfoByPath(const FilePath& file_path,
- GDataFileProperties* properties) OVERRIDE;
virtual bool IsUnderGDataCacheDirectory(const FilePath& path) const OVERRIDE;
virtual FilePath GetCacheDirectoryPath(
GDataCache::CacheSubDirectoryType sub_dir_type) const OVERRIDE;
@@ -719,16 +695,24 @@ class GDataFileSystem : public GDataFileSystemInterface,
const FilePath& remote_dest_file_path,
const FileOperationCallback& callback);
+ // Invoked upon completion of GetFileInfoByPathAsync initiated by
+ // GetFileByPath. It then continues to invoke GetFileByPathOnUIThread.
+ void OnGetFileInfoCompleteForGetFileByPath(
+ const FilePath& file_path,
+ const GetFileCallback& get_file_callback,
+ const GetDownloadDataCallback& get_download_data_callback,
+ base::PlatformFileError error,
+ scoped_ptr<GDataFileProto> file_info);
// Invoked upon completion of GetFileInfoByPathAsync initiated by OpenFile.
- // It then continues to invoke GetFileByPath and processed to
+ // It then continues to invoke GetFileByPathOnUIThread and proceeds to
// OnGetFileCompleteForOpenFile.
void OnGetFileInfoCompleteForOpenFile(const FilePath& file_path,
const OpenFileCallback& callback,
base::PlatformFileError error,
scoped_ptr<GDataFileProto> file_info);
// Invoked upon completion of GetFileInfoByPathAsync initiated by CloseFile.
- // It then continues to invoke GetFileByPath and processed to
- // OnGetFileCompleteForCloseFile.
+ // It then continues to invoke CommitDirtyInCache and proceeds to
+ // OnCommitDirtyInCacheCompleteForCloseFile.
void OnGetFileInfoCompleteForCloseFile(const FilePath& file_path,
const CloseFileCallback& callback,
base::PlatformFileError error,
@@ -1470,7 +1454,9 @@ class GDataFileSystem : public GDataFileSystemInterface,
void GetFileByPathOnUIThread(
const FilePath& file_path,
const GetFileCallback& get_file_callback,
- const GetDownloadDataCallback& get_download_data_callback);
+ const GetDownloadDataCallback& get_download_data_callback,
+ base::PlatformFileError error,
+ const GDataFileProto* file_proto);
void GetFileByResourceIdOnUIThread(
const std::string& resource_id,
const GetFileCallback& get_file_callback,

Powered by Google App Engine
This is Rietveld 408576698