| 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 97015aef1e580ae28d3a6c40e003a97727967fc9..da99ffb92dd1d8b7689954df68b9c00a8199c2a4 100644
|
| --- a/chrome/browser/chromeos/gdata/gdata_file_system.h
|
| +++ b/chrome/browser/chromeos/gdata/gdata_file_system.h
|
| @@ -76,6 +76,11 @@ 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)>
|
| + SetMountedStateCallback;
|
| +
|
| // Used for file operations like removing files.
|
| typedef base::Callback<void(base::PlatformFileError error,
|
| base::ListValue* feed_list)>
|
| @@ -192,6 +197,7 @@ class GDataFileSystemInterface {
|
| enum CachedFileOrigin {
|
| CACHED_FILE_FROM_SERVER = 0,
|
| CACHED_FILE_LOCALLY_MODIFIED,
|
| + CACHED_FILE_MOUNTED,
|
| };
|
|
|
| // Enum defining type of file operation e.g. copy or move, etc.
|
| @@ -365,6 +371,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;
|
| @@ -400,6 +410,12 @@ class GDataFileSystemInterface {
|
| virtual void SetPinState(const FilePath& file_path, bool to_pin,
|
| const FileOperationCallback& callback) = 0;
|
|
|
| + // Marks or unmarks a file as locally mounted.
|
| + // When marked as mounted, the file is prevented from being modified
|
| + // or evicted from cache.
|
| + virtual void SetMountedState(const FilePath& file_path, bool to_mount,
|
| + const SetMountedStateCallback& 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,
|
| @@ -466,6 +482,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;
|
| @@ -481,6 +498,10 @@ 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,
|
| + bool to_mount,
|
| + const SetMountedStateCallback& callback) OVERRIDE;
|
| virtual void AddUploadedFile(const FilePath& virtual_dir_path,
|
| DocumentEntry* entry,
|
| const FilePath& file_content_path,
|
| @@ -1188,6 +1209,14 @@ class GDataFileSystem : public GDataFileSystemInterface,
|
| FileOperationType file_operation_type,
|
| base::PlatformFileError* error);
|
|
|
| + // Task posted from SetMountedState to modify cache state on the IO thread
|
| + // pool, which involves the following:
|
| + // - moves |source_path| to |dest_path|
|
| + void SetMountedStateOnIOThreadPool(const FilePath& file_path,
|
| + bool to_mount,
|
| + base::PlatformFileError* error,
|
| + FilePath* cache_file_path);
|
| +
|
| // Task posted from MarkDirtyInCache to modify cache state on the IO thread
|
| // pool, which involves the following:
|
| // - moves |source_path| to |dest_path| in persistent dir, where
|
|
|