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

Unified Diff: chromeos/disks/disk_mount_manager.h

Issue 12537016: Add callback to DiskMountManager::UnmountPath (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 9 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: chromeos/disks/disk_mount_manager.h
diff --git a/chromeos/disks/disk_mount_manager.h b/chromeos/disks/disk_mount_manager.h
index 842b6f57c46cc0c5ce540dd4820edcd6ae9ca8af..36389a0ca98374e36913a772392084c557ab5079 100644
--- a/chromeos/disks/disk_mount_manager.h
+++ b/chromeos/disks/disk_mount_manager.h
@@ -195,6 +195,9 @@ class CHROMEOS_EXPORT DiskMountManager {
// finishes.
typedef base::Callback<void(bool)> UnmountDeviceRecursivelyCallbackType;
+ // A callback type for UnmountPath method.
+ typedef base::Callback<void(MountError error_code)> UnmountPathCallback;
+
// Implement this interface to be notified about disk/mount related events.
class Observer {
public:
@@ -237,6 +240,9 @@ class CHROMEOS_EXPORT DiskMountManager {
virtual void RequestMountInfoRefresh() = 0;
// Mounts a device.
+ // Note that the mount operation may fail. To find out the result, one should
+ // observe DiskMountManager for |Observer::OnMountEvent| event, which will be
+ // raised upon the mount operation completion.
virtual void MountPath(const std::string& source_path,
const std::string& source_format,
const std::string& mount_label,
@@ -244,8 +250,13 @@ class CHROMEOS_EXPORT DiskMountManager {
// Unmounts a mounted disk.
// |UnmountOptions| enum defined in chromeos/dbus/cros_disks_client.h.
+ // When the method is complete, |callback| will be called and observers'
+ // |OnMountEvent| will be raised.
+ //
+ // |callback| may be empty, in which case it gets ignored.
virtual void UnmountPath(const std::string& mount_path,
- UnmountOptions options) = 0;
+ UnmountOptions options,
+ const UnmountPathCallback& callback) = 0;
// Formats Device given its mount path. Unmounts the device.
// Example: mount_path: /media/VOLUME_LABEL
« no previous file with comments | « chrome/browser/chromeos/imageburner/burn_device_handler_unittest.cc ('k') | chromeos/disks/disk_mount_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698