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

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

Issue 10008100: gdata: Support mouting archive file in GData cache (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: gdata: Support mounting archive files under GData cache 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 86fa02f082af1870719911bde1811c108e51db4f..af46003320a0b8101dc76e802acf84f5f39be24b 100644
--- a/chrome/browser/chromeos/gdata/gdata_file_system.h
+++ b/chrome/browser/chromeos/gdata/gdata_file_system.h
@@ -71,6 +71,13 @@ typedef base::Callback<void(base::PlatformFileError error,
GDataFileType file_type)>
GetFileCallback;
+// Callback for SetMountedState.
+typedef base::Callback<void(base::PlatformFileError error,
+ const FilePath& file_path,
+ const std::string& file_name,
+ const std::string& mount_type)>
+ SetMountedStateCallback;
+
// Used for file operations like removing files.
typedef base::Callback<void(base::PlatformFileError error,
base::ListValue* feed_list)>
@@ -183,6 +190,7 @@ class GDataFileSystemInterface {
enum CachedFileOrigin {
CACHED_FILE_FROM_SERVER = 0,
CACHED_FILE_LOCALLY_MODIFIED,
+ CACHED_FILE_MOUNTED_ARCHIVE,
Ben Chan 2012/04/17 20:57:53 nit: prefer CACHED_FILE_IN_USE or CACHED_FILE_MOUN
tbarzic 2012/04/17 21:33:13 We should probably add CACHED_FILE_MOUNTED_ARCHIVE
hshi 2012/04/17 22:10:39 I am not sure that this applies to the case of mou
};
// Enum defining type of file operation e.g. copy or move, etc.
@@ -356,6 +364,10 @@ class GDataFileSystemInterface {
virtual bool GetFileInfoFromPath(const FilePath& gdata_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;
+
// Returns the tmp sub-directory under gdata cache directory, i.e.
// <user_profile_dir>/GCache/v1/tmp
virtual FilePath GetGDataCacheTmpDirectory() const = 0;
@@ -391,6 +403,16 @@ class GDataFileSystemInterface {
virtual void SetPinState(const FilePath& file_path, bool to_pin,
const FileOperationCallback& callback) = 0;
+ // Set mounted state of an archive
Ben Chan 2012/04/17 20:57:53 Prefer a more elaborated comment, e.g. Marks a fi
tbarzic 2012/04/17 21:33:13 Also, comments must end with .
+ virtual void SetMountedState(const FilePath& file_path,
+ const std::string& file_name,
Ben Chan 2012/04/17 20:57:53 const FilePath::StringType&
+ const std::string& mount_type,
+ const SetMountedStateCallback& callback) = 0;
+
+ // Clear mounted state of an archive
Ben Chan 2012/04/17 20:57:53 ditto
+ virtual void ClearMountedState(const FilePath& file_path,
+ const FileOperationCallback& callback) = 0;
+
// 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,
@@ -457,6 +479,7 @@ class GDataFileSystem : public GDataFileSystemInterface,
const GetCacheStateCallback& callback) OVERRIDE;
virtual bool GetFileInfoFromPath(const FilePath& gdata_file_path,
GDataFileProperties* properties) OVERRIDE;
+ virtual bool IsUnderGDataCacheDirectory(const FilePath& path) const OVERRIDE;
virtual FilePath GetGDataCacheTmpDirectory() const OVERRIDE;
virtual FilePath GetGDataTempDownloadFolderPath() const OVERRIDE;
virtual FilePath GetGDataTempDocumentFolderPath() const OVERRIDE;
@@ -472,6 +495,12 @@ 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 SetMountedState(const FilePath& file_path,
+ const std::string& file_name,
tbarzic 2012/04/17 21:33:13 fix indent
+ const std::string& mount_type,
+ const SetMountedStateCallback& callback) OVERRIDE;
+ virtual void ClearMountedState(const FilePath& file_path,
+ const FileOperationCallback& callback) OVERRIDE;
virtual void AddUploadedFile(const FilePath& virtual_dir_path,
DocumentEntry* entry,
const FilePath& file_content_path,

Powered by Google App Engine
This is Rietveld 408576698