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

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

Issue 10270018: gdata: Add GDataFileSystem::GetFileInfoByPathAsync(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 ef45c8905c16a94837b1c9ea2736e431e5acd56a..263074a2fe06742c6ee4da0103bd9f348702077b 100644
--- a/chrome/browser/chromeos/gdata/gdata_file_system.h
+++ b/chrome/browser/chromeos/gdata/gdata_file_system.h
@@ -39,6 +39,7 @@ class WaitableEvent;
namespace gdata {
class DocumentsServiceInterface;
+class GDataFileProto;
struct UploadFileInfo;
namespace {
@@ -68,6 +69,12 @@ typedef base::Callback<void(base::PlatformFileError error,
GDataFileType file_type)>
GetFileCallback;
+// Used to get file info from the file system.
+// if |error| is not PLATFORM_FILE_OK, |file_info| is NULL.
Ben Chan 2012/04/30 18:00:42 nit: if -> If |file_info| is NULL -> |file_info|
satorux1 2012/04/30 19:47:25 Done.
+typedef base::Callback<void(base::PlatformFileError error,
+ scoped_ptr<GDataFileProto> file_info)>
Ben Chan 2012/04/30 18:00:42 nit: GDataFileProto and file_info seem mismatch.
satorux1 2012/04/30 19:47:25 Done.
+ GetFileInfoCallback;
+
// Callback for SetMountedState.
typedef base::Callback<void(base::PlatformFileError error,
const FilePath& file_path)>
@@ -99,6 +106,7 @@ 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();
@@ -307,7 +315,13 @@ class GDataFileSystemInterface {
// Finds a file (not a directory) by |file_path| and returns its key
// |properties|. Returns true if file was found.
- virtual bool GetFileInfoByPath(const FilePath& gdata_file_path,
+ virtual void GetFileInfoByPathAsync(const FilePath& file_path,
+ const GetFileInfoCallback& 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.
@@ -396,7 +410,10 @@ class GDataFileSystem : public GDataFileSystemInterface,
virtual void GetCacheState(const std::string& resource_id,
const std::string& md5,
const GetCacheStateCallback& callback) OVERRIDE;
- virtual bool GetFileInfoByPath(const FilePath& gdata_file_path,
+ virtual void GetFileInfoByPathAsync(
+ const FilePath& file_path,
+ const GetFileInfoCallback& callback) OVERRIDE;
+ virtual bool GetFileInfoByPath(const FilePath& file_path,
GDataFileProperties* properties) OVERRIDE;
virtual bool IsUnderGDataCacheDirectory(const FilePath& path) const OVERRIDE;
virtual FilePath GetCacheDirectoryPath(
@@ -1194,6 +1211,12 @@ class GDataFileSystem : public GDataFileSystemInterface,
// Initializes preference change observer.
void InitializePreferenceObserver();
+ // Called when an entry is found for GetFileInfoByPath().
+ void OnEntryFound(const GetFileInfoCallback& callback,
+ base::PlatformFileError error,
+ const FilePath& directory_path,
+ GDataEntry* entry);
+
// The following functions are used to forward calls to asynchronous public
// member functions to UI thread.
void FindEntryByPathAsyncOnUIThread(const FilePath& search_file_path,
@@ -1219,6 +1242,9 @@ class GDataFileSystem : public GDataFileSystemInterface,
const std::string& resource_id,
const GetFileCallback& get_file_callback,
const GetDownloadDataCallback& get_download_data_callback);
+ void GetFileInfoByPathAsyncOnUIThread(
+ const FilePath& file_path,
+ const GetFileInfoCallback& callback);
void GetCacheStateOnUIThread(const std::string& resource_id,
const std::string& md5,
const GetCacheStateCallback& callback);
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_file_system.cc » ('j') | chrome/browser/chromeos/gdata/gdata_file_system.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698