OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INFO_H
_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INFO_H
_ |
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INFO_H
_ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INFO_H
_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 | 11 |
12 namespace chromeos { | 12 namespace chromeos { |
13 namespace file_system_provider { | 13 namespace file_system_provider { |
14 | 14 |
15 // Options for creating the provided file system info. | 15 // Options for creating the provided file system info. |
16 struct MountOptions { | 16 struct MountOptions { |
17 MountOptions(); | 17 MountOptions(); |
18 | 18 |
19 // Only mandatory fields. | 19 // Only mandatory fields. |
20 MountOptions(const std::string& file_system_id, | 20 MountOptions(const std::string& file_system_id, |
21 const std::string& display_name); | 21 const std::string& display_name); |
22 | 22 |
23 std::string file_system_id; | 23 std::string file_system_id; |
24 std::string display_name; | 24 std::string display_name; |
25 bool writable; | 25 bool writable; |
26 bool supports_notify_tag; | 26 bool supports_notify_tag; |
| 27 int opened_files_limit; |
27 }; | 28 }; |
28 | 29 |
29 // Contains information about the provided file system instance. | 30 // Contains information about the provided file system instance. |
30 class ProvidedFileSystemInfo { | 31 class ProvidedFileSystemInfo { |
31 public: | 32 public: |
32 ProvidedFileSystemInfo(); | 33 ProvidedFileSystemInfo(); |
33 | 34 |
34 ProvidedFileSystemInfo(const std::string& extension_id, | 35 ProvidedFileSystemInfo(const std::string& extension_id, |
35 const MountOptions& mount_options, | 36 const MountOptions& mount_options, |
36 const base::FilePath& mount_path); | 37 const base::FilePath& mount_path); |
37 | 38 |
38 ~ProvidedFileSystemInfo(); | 39 ~ProvidedFileSystemInfo(); |
39 | 40 |
40 const std::string& extension_id() const { return extension_id_; } | 41 const std::string& extension_id() const { return extension_id_; } |
41 const std::string& file_system_id() const { return file_system_id_; } | 42 const std::string& file_system_id() const { return file_system_id_; } |
42 const std::string& display_name() const { return display_name_; } | 43 const std::string& display_name() const { return display_name_; } |
43 bool writable() const { return writable_; } | 44 bool writable() const { return writable_; } |
44 bool supports_notify_tag() const { return supports_notify_tag_; } | 45 bool supports_notify_tag() const { return supports_notify_tag_; } |
| 46 int opened_files_limit() const { return opened_files_limit_; } |
45 const base::FilePath& mount_path() const { return mount_path_; } | 47 const base::FilePath& mount_path() const { return mount_path_; } |
46 | 48 |
47 private: | 49 private: |
48 // ID of the extension providing this file system. | 50 // ID of the extension providing this file system. |
49 std::string extension_id_; | 51 std::string extension_id_; |
50 | 52 |
51 // ID of the file system. | 53 // ID of the file system. |
52 std::string file_system_id_; | 54 std::string file_system_id_; |
53 | 55 |
54 // Name of the file system, can be rendered in the UI. | 56 // Name of the file system, can be rendered in the UI. |
55 std::string display_name_; | 57 std::string display_name_; |
56 | 58 |
57 // Whether the file system is writable or just read-only. | 59 // Whether the file system is writable or just read-only. |
58 bool writable_; | 60 bool writable_; |
59 | 61 |
60 // Supports tags for file/directory change notifications. | 62 // Supports tags for file/directory change notifications. |
61 bool supports_notify_tag_; | 63 bool supports_notify_tag_; |
62 | 64 |
| 65 // Limit of opened files in parallel. If unlimited, then 0. |
| 66 int opened_files_limit_; |
| 67 |
63 // Mount path of the underlying file system. | 68 // Mount path of the underlying file system. |
64 base::FilePath mount_path_; | 69 base::FilePath mount_path_; |
65 }; | 70 }; |
66 | 71 |
67 } // namespace file_system_provider | 72 } // namespace file_system_provider |
68 } // namespace chromeos | 73 } // namespace chromeos |
69 | 74 |
70 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INF
O_H_ | 75 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_PROVIDED_FILE_SYSTEM_INF
O_H_ |
OLD | NEW |