Chromium Code Reviews| Index: chrome/browser/chromeos/drive/file_system_interface.h |
| diff --git a/chrome/browser/chromeos/drive/file_system_interface.h b/chrome/browser/chromeos/drive/file_system_interface.h |
| index 0c2b40b48c5a33b829735a11f5d89c821d943b17..21b6095eb5f1a4c3117e02834b456cb040036a1b 100644 |
| --- a/chrome/browser/chromeos/drive/file_system_interface.h |
| +++ b/chrome/browser/chromeos/drive/file_system_interface.h |
| @@ -99,7 +99,9 @@ typedef base::Callback<void( |
| // Used to open files from the file system. |file_path| is the path on the local |
| // file system for the opened file. |
| typedef base::Callback<void(FileError error, |
| - const base::FilePath& file_path)> OpenFileCallback; |
| + const base::FilePath& file_path, |
| + const base::Closure& on_close_callback)> |
| + OpenFileCallback; |
| // Used to get available space for the account from Drive. |
| typedef base::Callback<void(FileError error, |
| @@ -110,6 +112,11 @@ typedef base::Callback<void(FileError error, |
| typedef base::Callback<void(const FileSystemMetadata&)> |
| GetFilesystemMetadataCallback; |
| +// Used to mark cached files mounted. |
| +typedef base::Callback<void(FileError error, |
| + const base::FilePath& file_path)> |
| + MarkMountedCallback; |
| + |
| // The mode of opening a file. |
| enum OpenMode { |
| // Open the file if exists. If not, failed. |
| @@ -193,21 +200,15 @@ class FileSystemInterface { |
| // returned to |callback|. After opening the file, both read and write |
| // on the file can be done with normal local file operations. |
| // |
| - // |CloseFile| must be called when the modification to the cache is done. |
| - // Otherwise, Drive file system does not pick up the file for uploading. |
| + // If |on_close_callback| is not null, it must be called when the |
| + // modification to the cache is done. Otherwise, Drive file system does not |
| + // pick up the file for uploading. |
|
hashimoto
2013/07/23 11:24:58
nit: This sentence should better be moved near the
hidehiko
2013/07/23 14:32:24
Done.
|
| // |
| // |callback| must not be null. |
| virtual void OpenFile(const base::FilePath& file_path, |
| OpenMode open_mode, |
| const OpenFileCallback& callback) = 0; |
| - // Closes a file at the virtual path |file_path| on the Drive file system, |
| - // which is opened via OpenFile(). It commits the dirty flag on the cache. |
| - // |
| - // |callback| must not be null. |
| - virtual void CloseFile(const base::FilePath& file_path, |
| - const FileOperationCallback& callback) = 0; |
| - |
| // Copies |src_file_path| to |dest_file_path| on the file system. |
| // |src_file_path| can be a hosted document (see limitations below). |
| // |dest_file_path| is expected to be of the same type of |src_file_path| |
| @@ -390,7 +391,7 @@ class FileSystemInterface { |
| // If succeeded, the cached file path will be passed to the |callback|. |
| // |callback| must not be null. |
| virtual void MarkCacheFileAsMounted(const base::FilePath& drive_file_path, |
| - const OpenFileCallback& callback) = 0; |
| + const MarkMountedCallback& callback) = 0; |
| // Marks the cached file as unmounted, and runs |callback| upon completion. |
| // Note that this method expects that the |cached_file_path| is the path |