Commit d2e457f5 authored by Jérémie Boulic's avatar Jérémie Boulic Committed by Commit Bot

ZIP mount: Fix unhandled MOUNT_TYPE_INVALID error

When trying to mount a ZIP archive with an invalid path, cros_disks
sends back a signal to the browser with source_type=MOUNT_TYPE_INVALID.
The observing VolumeManager doesn't handle this source/mount_type, and
the archive mounting request initiated from the UI is never resolved.

Fix this by removing the distinction between MOUNT_TYPE_INVALID and the
other mount error types.

Bug: 1136329
Change-Id: If807a854ef7a13635ded29a38e76ee54e057bfc8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2560443Reviewed-by: default avatarSergei Datsenko <dats@chromium.org>
Reviewed-by: default avatarFrançois Degros <fdegros@chromium.org>
Commit-Queue: Jeremie Boulic <jboulic@chromium.org>
Commit-Queue: François Degros <fdegros@chromium.org>
Cr-Commit-Position: refs/heads/master@{#831221}
parent d98d2aca
......@@ -901,36 +901,24 @@ void VolumeManager::OnMountEvent(
chromeos::MountError error_code,
const chromeos::disks::DiskMountManager::MountPointInfo& mount_info) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
switch (mount_info.mount_type) {
case chromeos::MOUNT_TYPE_ARCHIVE:
case chromeos::MOUNT_TYPE_DEVICE: {
// Notify a mounting/unmounting event to observers.
const chromeos::disks::Disk* const disk =
disk_mount_manager_->FindDiskBySourcePath(mount_info.source_path);
std::unique_ptr<Volume> volume =
Volume::CreateForRemovable(mount_info, disk);
switch (event) {
case chromeos::disks::DiskMountManager::MOUNTING: {
DoMountEvent(error_code, std::move(volume));
return;
}
case chromeos::disks::DiskMountManager::UNMOUNTING:
DoUnmountEvent(error_code, *volume);
return;
}
NOTREACHED();
}
// Network storage is responsible for doing its own mounting.
case chromeos::MOUNT_TYPE_NETWORK_STORAGE: {
break;
}
// Network storage is responsible for doing its own mounting.
if (mount_info.mount_type == chromeos::MOUNT_TYPE_NETWORK_STORAGE)
return;
case chromeos::MOUNT_TYPE_INVALID: {
NOTREACHED();
break;
// Notify a mounting/unmounting event to observers.
const chromeos::disks::Disk* const disk =
disk_mount_manager_->FindDiskBySourcePath(mount_info.source_path);
std::unique_ptr<Volume> volume = Volume::CreateForRemovable(mount_info, disk);
switch (event) {
case chromeos::disks::DiskMountManager::MOUNTING: {
DoMountEvent(error_code, std::move(volume));
return;
}
case chromeos::disks::DiskMountManager::UNMOUNTING:
DoUnmountEvent(error_code, *volume);
return;
}
NOTREACHED();
}
void VolumeManager::OnFormatEvent(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment