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

Unified Diff: chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h

Issue 279213002: [fsp] Add support for closing files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 7 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/file_system_provider/provided_file_system_interface.h
diff --git a/chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h b/chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h
index 126d532d7a1dff64a8274ac15a8b2c2053168062..1da8059ae300722420ed450a2bc1867404e68410 100644
--- a/chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h
+++ b/chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h
@@ -24,6 +24,9 @@ class RequestManager;
// TODO(mtomasz): Add more methods once implemented.
class ProvidedFileSystemInterface {
public:
+ typedef base::Callback<void(int file_handle, base::File::Error result)>
+ OpenFileCallback;
+
// Mode of opening a file. Used by OpenFile().
enum OpenFileMode { OPEN_FILE_MODE_READ, OPEN_FILE_MODE_WRITE };
@@ -39,6 +42,7 @@ class ProvidedFileSystemInterface {
virtual void GetMetadata(
const base::FilePath& entry_path,
const fileapi::AsyncFileUtil::GetFileInfoCallback& callback) = 0;
+
// Requests enumerating entries from the passed |directory_path|. The callback
// can be called multiple times until either an error is returned or the
// has_more field is set to false.
@@ -47,11 +51,16 @@ class ProvidedFileSystemInterface {
const fileapi::AsyncFileUtil::ReadDirectoryCallback& callback) = 0;
// Requests opening a file at |file_path|. If |create| is set to true, it will
- // create a file and return succes in case it didn't exist.
- virtual void OpenFile(
- const base::FilePath& file_path,
- OpenFileMode mode,
- bool create,
+ // create a file and return success in case it didn't exist.
+ virtual void OpenFile(const base::FilePath& file_path,
+ OpenFileMode mode,
+ bool create,
+ const OpenFileCallback& callback) = 0;
+
+ // Requests closing a file, previously opened with OpenFile() as a file with
+ // |file_handle|. For either succes or error |callback| must be called.
+ virtual void CloseFile(
+ int file_handle,
const fileapi::AsyncFileUtil::StatusCallback& callback) = 0;
// Returns a provided file system info for this file system.
« no previous file with comments | « chrome/browser/chromeos/file_system_provider/provided_file_system.cc ('k') | chrome/chrome_browser_chromeos.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698