OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ |
6 #define CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ | 6 #define CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
101 UNMOUNT_OPTIONS_NONE, | 101 UNMOUNT_OPTIONS_NONE, |
102 UNMOUNT_OPTIONS_LAZY, // Do lazy unmount. | 102 UNMOUNT_OPTIONS_LAZY, // Do lazy unmount. |
103 }; | 103 }; |
104 | 104 |
105 // Mount option to control write permission to a device. | 105 // Mount option to control write permission to a device. |
106 enum MountAccessMode { | 106 enum MountAccessMode { |
107 MOUNT_ACCESS_MODE_READ_WRITE, | 107 MOUNT_ACCESS_MODE_READ_WRITE, |
108 MOUNT_ACCESS_MODE_READ_ONLY, | 108 MOUNT_ACCESS_MODE_READ_ONLY, |
109 }; | 109 }; |
110 | 110 |
111 // Whether to mount to a new path or remount an existing one. | |
hashimoto
2016/10/19 08:46:23
What does "remount an existing one" mean?
Please c
yamaguchi1
2016/10/19 10:34:10
Revised the comments.
I made it this way to minimi
| |
112 enum RemountOption { | |
113 REMOUNT_OPTION_DISABLED, | |
114 REMOUNT_OPTION_ENABLED, | |
115 }; | |
116 | |
111 // A class to represent information about a disk sent from cros-disks. | 117 // A class to represent information about a disk sent from cros-disks. |
112 class CHROMEOS_EXPORT DiskInfo { | 118 class CHROMEOS_EXPORT DiskInfo { |
113 public: | 119 public: |
114 DiskInfo(const std::string& device_path, dbus::Response* response); | 120 DiskInfo(const std::string& device_path, dbus::Response* response); |
115 ~DiskInfo(); | 121 ~DiskInfo(); |
116 | 122 |
117 // Device path. (e.g. /sys/devices/pci0000:00/.../8:0:0:0/block/sdb/sdb1) | 123 // Device path. (e.g. /sys/devices/pci0000:00/.../8:0:0:0/block/sdb/sdb1) |
118 const std::string& device_path() const { return device_path_; } | 124 const std::string& device_path() const { return device_path_; } |
119 | 125 |
120 // Disk mount path. (e.g. /media/removable/VOLUME) | 126 // Disk mount path. (e.g. /media/removable/VOLUME) |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
271 // - The |source_format| argument passes the file extension (with the leading | 277 // - The |source_format| argument passes the file extension (with the leading |
272 // dot, for example ".zip"). If |source_format| is empty then the source | 278 // dot, for example ".zip"). If |source_format| is empty then the source |
273 // format is auto-detected. | 279 // format is auto-detected. |
274 // - The |mount_label| argument passes an optional mount label to be used as | 280 // - The |mount_label| argument passes an optional mount label to be used as |
275 // the directory name of the mount point. If |mount_label| is empty, the | 281 // the directory name of the mount point. If |mount_label| is empty, the |
276 // mount label will be based on the |source_path|. | 282 // mount label will be based on the |source_path|. |
277 virtual void Mount(const std::string& source_path, | 283 virtual void Mount(const std::string& source_path, |
278 const std::string& source_format, | 284 const std::string& source_format, |
279 const std::string& mount_label, | 285 const std::string& mount_label, |
280 MountAccessMode access_mode, | 286 MountAccessMode access_mode, |
287 RemountOption remount, | |
281 const base::Closure& callback, | 288 const base::Closure& callback, |
282 const base::Closure& error_callback) = 0; | 289 const base::Closure& error_callback) = 0; |
283 | 290 |
284 // Calls Unmount method. |callback| is called after the method call succeeds, | 291 // Calls Unmount method. |callback| is called after the method call succeeds, |
285 // otherwise, |error_callback| is called. | 292 // otherwise, |error_callback| is called. |
286 virtual void Unmount(const std::string& device_path, | 293 virtual void Unmount(const std::string& device_path, |
287 UnmountOptions options, | 294 UnmountOptions options, |
288 const base::Closure& callback, | 295 const base::Closure& callback, |
289 const base::Closure& error_callback) = 0; | 296 const base::Closure& error_callback) = 0; |
290 | 297 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
334 | 341 |
335 // Returns the path of the mount point for archive files. | 342 // Returns the path of the mount point for archive files. |
336 static base::FilePath GetArchiveMountPoint(); | 343 static base::FilePath GetArchiveMountPoint(); |
337 | 344 |
338 // Returns the path of the mount point for removable disks. | 345 // Returns the path of the mount point for removable disks. |
339 static base::FilePath GetRemovableDiskMountPoint(); | 346 static base::FilePath GetRemovableDiskMountPoint(); |
340 | 347 |
341 // Composes a list of mount options. | 348 // Composes a list of mount options. |
342 static std::vector<std::string> ComposeMountOptions( | 349 static std::vector<std::string> ComposeMountOptions( |
343 const std::string& mount_label, | 350 const std::string& mount_label, |
344 MountAccessMode access_mode); | 351 MountAccessMode access_mode, |
352 RemountOption remount); | |
345 | 353 |
346 protected: | 354 protected: |
347 // Create() should be used instead. | 355 // Create() should be used instead. |
348 CrosDisksClient(); | 356 CrosDisksClient(); |
349 | 357 |
350 private: | 358 private: |
351 DISALLOW_COPY_AND_ASSIGN(CrosDisksClient); | 359 DISALLOW_COPY_AND_ASSIGN(CrosDisksClient); |
352 }; | 360 }; |
353 | 361 |
354 } // namespace chromeos | 362 } // namespace chromeos |
355 | 363 |
356 #endif // CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ | 364 #endif // CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ |
OLD | NEW |