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

Unified Diff: chrome/browser/chromeos/file_system_provider/operations/open_file.cc

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/operations/open_file.cc
diff --git a/chrome/browser/chromeos/file_system_provider/operations/open_file.cc b/chrome/browser/chromeos/file_system_provider/operations/open_file.cc
index a1a6e16cd026eb6390589249163c0ac79642afdc..8029c58772b2dcdca2283491c7eed44f3d65df74 100644
--- a/chrome/browser/chromeos/file_system_provider/operations/open_file.cc
+++ b/chrome/browser/chromeos/file_system_provider/operations/open_file.cc
@@ -13,12 +13,13 @@ namespace chromeos {
namespace file_system_provider {
namespace operations {
-OpenFile::OpenFile(extensions::EventRouter* event_router,
- const ProvidedFileSystemInfo& file_system_info,
- const base::FilePath& file_path,
- ProvidedFileSystemInterface::OpenFileMode mode,
- bool create,
- const fileapi::AsyncFileUtil::StatusCallback& callback)
+OpenFile::OpenFile(
+ extensions::EventRouter* event_router,
+ const ProvidedFileSystemInfo& file_system_info,
+ const base::FilePath& file_path,
+ ProvidedFileSystemInterface::OpenFileMode mode,
+ bool create,
+ const ProvidedFileSystemInterface::OpenFileCallback& callback)
: Operation(event_router, file_system_info),
file_path_(file_path),
mode_(mode),
@@ -52,14 +53,15 @@ bool OpenFile::Execute(int request_id) {
values.Pass());
}
-void OpenFile::OnSuccess(int /* request_id */,
+void OpenFile::OnSuccess(int request_id,
scoped_ptr<RequestValue> result,
bool has_next) {
- callback_.Run(base::File::FILE_OK);
+ // File handle is the same as request id of the OpenFile operation.
+ callback_.Run(request_id, base::File::FILE_OK);
}
void OpenFile::OnError(int /* request_id */, base::File::Error error) {
- callback_.Run(error);
+ callback_.Run(0 /* file_handle */, error);
}
} // namespace operations

Powered by Google App Engine
This is Rietveld 408576698