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

Unified Diff: chrome/browser/chromeos/file_system_provider/operations/create_directory.h

Issue 366263002: [fsp] Add support for creating directories. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 5 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/create_directory.h
diff --git a/chrome/browser/chromeos/file_system_provider/operations/open_file.h b/chrome/browser/chromeos/file_system_provider/operations/create_directory.h
similarity index 64%
copy from chrome/browser/chromeos/file_system_provider/operations/open_file.h
copy to chrome/browser/chromeos/file_system_provider/operations/create_directory.h
index d8494d822cc29dd5a61d66751ae84247d4356f9d..0de12055840fdb50a02792d84f145ee2d0dbb7bc 100644
--- a/chrome/browser/chromeos/file_system_provider/operations/open_file.h
+++ b/chrome/browser/chromeos/file_system_provider/operations/create_directory.h
@@ -2,8 +2,8 @@
// 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_OPEN_FILE_H_
-#define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_OPEN_FILE_H_
+#ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_CREATE_DIRECTORY_H_
+#define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_CREATE_DIRECTORY_H_
#include "base/files/file.h"
#include "base/memory/scoped_ptr.h"
@@ -25,16 +25,18 @@ namespace chromeos {
namespace file_system_provider {
namespace operations {
-// Opens a file for either read or write. The file must exist, otherwise the
-// operation will fail. Created per request.
-class OpenFile : public Operation {
+// Creates a directory. If |recursive| is set to true, then creates also all
+// non-existing directories on the path. If |exclusive| is true, then the
+// operation will fail if the directory already exists. Created per request.
+class CreateDirectory : public Operation {
public:
- OpenFile(extensions::EventRouter* event_router,
- const ProvidedFileSystemInfo& file_system_info,
- const base::FilePath& file_path,
- ProvidedFileSystemInterface::OpenFileMode mode,
- const ProvidedFileSystemInterface::OpenFileCallback& callback);
- virtual ~OpenFile();
+ CreateDirectory(extensions::EventRouter* event_router,
+ const ProvidedFileSystemInfo& file_system_info,
+ const base::FilePath& directory_path,
+ bool exclusive,
+ bool recursive,
+ const fileapi::AsyncFileUtil::StatusCallback& callback);
+ virtual ~CreateDirectory();
// Operation overrides.
virtual bool Execute(int request_id) OVERRIDE;
@@ -46,15 +48,17 @@ class OpenFile : public Operation {
base::File::Error error) OVERRIDE;
private:
- base::FilePath file_path_;
+ base::FilePath directory_path_;
ProvidedFileSystemInterface::OpenFileMode mode_;
- const ProvidedFileSystemInterface::OpenFileCallback callback_;
+ bool exclusive_;
+ bool recursive_;
+ const fileapi::AsyncFileUtil::StatusCallback callback_;
- DISALLOW_COPY_AND_ASSIGN(OpenFile);
+ DISALLOW_COPY_AND_ASSIGN(CreateDirectory);
};
} // namespace operations
} // namespace file_system_provider
} // namespace chromeos
-#endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_OPEN_FILE_H_
+#endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_CREATE_DIRECTORY_H_

Powered by Google App Engine
This is Rietveld 408576698