Index: chrome/browser/chromeos/file_system_provider/operations/open_file.h |
diff --git a/chrome/browser/chromeos/file_system_provider/operations/read_directory.h b/chrome/browser/chromeos/file_system_provider/operations/open_file.h |
similarity index 59% |
copy from chrome/browser/chromeos/file_system_provider/operations/read_directory.h |
copy to chrome/browser/chromeos/file_system_provider/operations/open_file.h |
index 68176d978c22579c4a3761ec5434df978d168a5a..efe0a53d1a8c5821cc49fedf90263c7f4d154a59 100644 |
--- a/chrome/browser/chromeos/file_system_provider/operations/read_directory.h |
+++ b/chrome/browser/chromeos/file_system_provider/operations/open_file.h |
@@ -2,13 +2,14 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_READ_DIRECTORY_H_ |
-#define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_READ_DIRECTORY_H_ |
+#ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_OPEN_FILE_H_ |
+#define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_OPEN_FILE_H_ |
#include "base/files/file.h" |
#include "base/memory/scoped_ptr.h" |
#include "chrome/browser/chromeos/file_system_provider/operations/operation.h" |
#include "chrome/browser/chromeos/file_system_provider/provided_file_system_info.h" |
+#include "chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h" |
#include "chrome/browser/chromeos/file_system_provider/request_value.h" |
#include "webkit/browser/fileapi/async_file_util.h" |
@@ -24,15 +25,18 @@ namespace chromeos { |
namespace file_system_provider { |
namespace operations { |
-// Bridge between fileapi read directory operation and providing extension's |
-// read directory request. Created per request. |
-class ReadDirectory : public Operation { |
+// Opens a file for either read or write, with optionally creating the file |
+// first. Note, that this is part of fileapi::CreateOrOpen file, but it does |
+// not download the file locally. Created per request. |
+class OpenFile : public Operation { |
public: |
- ReadDirectory(extensions::EventRouter* event_router, |
- const ProvidedFileSystemInfo& file_system_info, |
- const base::FilePath& directory_path, |
- const fileapi::AsyncFileUtil::ReadDirectoryCallback& callback); |
- virtual ~ReadDirectory(); |
+ 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); |
+ virtual ~OpenFile(); |
// Operation overrides. |
virtual bool Execute(int request_id) OVERRIDE; |
@@ -42,14 +46,16 @@ class ReadDirectory : public Operation { |
virtual void OnError(int request_id, base::File::Error error) OVERRIDE; |
private: |
- base::FilePath directory_path_; |
- const fileapi::AsyncFileUtil::ReadDirectoryCallback callback_; |
+ base::FilePath file_path_; |
+ ProvidedFileSystemInterface::OpenFileMode mode_; |
+ bool create_; |
+ const fileapi::AsyncFileUtil::StatusCallback callback_; |
- DISALLOW_COPY_AND_ASSIGN(ReadDirectory); |
+ DISALLOW_COPY_AND_ASSIGN(OpenFile); |
}; |
} // namespace operations |
} // namespace file_system_provider |
} // namespace chromeos |
-#endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_READ_DIRECTORY_H_ |
+#endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_OPEN_FILE_H_ |