summaryrefslogtreecommitdiffstats
path: root/chromeos/disks
diff options
context:
space:
mode:
authorkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-16 07:57:52 +0000
committerkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-16 07:57:52 +0000
commitd77605925a3eda85175de6e06dd1eb363c919ed5 (patch)
treefed47dda5614c51d6bdfaa4adc212ed0bce035db /chromeos/disks
parent3e92ee1ab0d4493f6b8447e8542748df8960d7ee (diff)
downloadchromium_src-d77605925a3eda85175de6e06dd1eb363c919ed5.zip
chromium_src-d77605925a3eda85175de6e06dd1eb363c919ed5.tar.gz
chromium_src-d77605925a3eda85175de6e06dd1eb363c919ed5.tar.bz2
Add EnumerateMountEntries method in CrosDisksClient.
The corresponding dbus level method is already added in https://chromium-review.googlesource.com/#/c/195111/. This CL is for adding the method to the wrapper client class. BUG=356583 Review URL: https://codereview.chromium.org/281063002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270958 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/disks')
-rw-r--r--chromeos/disks/disk_mount_manager.cc31
1 files changed, 15 insertions, 16 deletions
diff --git a/chromeos/disks/disk_mount_manager.cc b/chromeos/disks/disk_mount_manager.cc
index 58f1608..c25cf15 100644
--- a/chromeos/disks/disk_mount_manager.cc
+++ b/chromeos/disks/disk_mount_manager.cc
@@ -65,7 +65,8 @@ class DiskMountManagerImpl : public DiskMountManager {
if (type == MOUNT_TYPE_DEVICE) {
DiskMap::const_iterator it = disks_.find(source_path);
if (it == disks_.end() || it->second->is_hidden()) {
- OnMountCompleted(MOUNT_ERROR_INTERNAL, source_path, type, "");
+ OnMountCompleted(MountEntry(MOUNT_ERROR_INTERNAL, source_path, type,
+ ""));
return;
}
}
@@ -78,10 +79,7 @@ class DiskMountManagerImpl : public DiskMountManager {
base::Bind(&base::DoNothing),
base::Bind(&DiskMountManagerImpl::OnMountCompleted,
weak_ptr_factory_.GetWeakPtr(),
- MOUNT_ERROR_INTERNAL,
- source_path,
- type,
- ""));
+ MountEntry(MOUNT_ERROR_INTERNAL, source_path, type, "")));
}
// DiskMountManager override.
@@ -300,32 +298,33 @@ class DiskMountManagerImpl : public DiskMountManager {
}
// Callback to handle MountCompleted signal and Mount method call failure.
- void OnMountCompleted(MountError error_code,
- const std::string& source_path,
- MountType mount_type,
- const std::string& mount_path) {
+ void OnMountCompleted(const MountEntry& entry) {
MountCondition mount_condition = MOUNT_CONDITION_NONE;
- if (mount_type == MOUNT_TYPE_DEVICE) {
- if (error_code == MOUNT_ERROR_UNKNOWN_FILESYSTEM) {
+ if (entry.mount_type() == MOUNT_TYPE_DEVICE) {
+ if (entry.error_code() == MOUNT_ERROR_UNKNOWN_FILESYSTEM) {
mount_condition = MOUNT_CONDITION_UNKNOWN_FILESYSTEM;
}
- if (error_code == MOUNT_ERROR_UNSUPPORTED_FILESYSTEM) {
+ if (entry.error_code() == MOUNT_ERROR_UNSUPPORTED_FILESYSTEM) {
mount_condition = MOUNT_CONDITION_UNSUPPORTED_FILESYSTEM;
}
}
- const MountPointInfo mount_info(source_path, mount_path, mount_type,
+ const MountPointInfo mount_info(entry.source_path(),
+ entry.mount_path(),
+ entry.mount_type(),
mount_condition);
- NotifyMountStatusUpdate(MOUNTING, error_code, mount_info);
+ NotifyMountStatusUpdate(MOUNTING, entry.error_code(), mount_info);
// If the device is corrupted but it's still possible to format it, it will
// be fake mounted.
- if ((error_code == MOUNT_ERROR_NONE || mount_info.mount_condition) &&
+ if ((entry.error_code() == MOUNT_ERROR_NONE ||
+ mount_info.mount_condition) &&
mount_points_.find(mount_info.mount_path) == mount_points_.end()) {
mount_points_.insert(MountPointMap::value_type(mount_info.mount_path,
mount_info));
}
- if ((error_code == MOUNT_ERROR_NONE || mount_info.mount_condition) &&
+ if ((entry.error_code() == MOUNT_ERROR_NONE ||
+ mount_info.mount_condition) &&
mount_info.mount_type == MOUNT_TYPE_DEVICE &&
!mount_info.source_path.empty() &&
!mount_info.mount_path.empty()) {