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

Unified Diff: chromeos/disks/disk_mount_manager.cc

Issue 2440443003: Preserve the hardware read-only flag in Disk object. (Closed)
Patch Set: Fix build error in file_manager_private_api test. Created 4 years, 2 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.cc
diff --git a/chromeos/disks/disk_mount_manager.cc b/chromeos/disks/disk_mount_manager.cc
index c5d373743f87a8321a9ddde9fd01bf3da4978b98..b96bef6d035fabe3a535b3bd319b7ddc096861c9 100644
--- a/chromeos/disks/disk_mount_manager.cc
+++ b/chromeos/disks/disk_mount_manager.cc
@@ -368,7 +368,7 @@ class DiskMountManagerImpl : public DiskMountManager {
AccessModeMap::iterator it = access_modes_.find(entry.source_path());
if (it != access_modes_.end() &&
it->second == chromeos::MOUNT_ACCESS_MODE_READ_ONLY) {
- disk->set_read_only(true);
+ disk->set_write_disabled_by_policy(true);
}
disk->set_mount_path(mount_info.mount_path);
}
@@ -471,6 +471,7 @@ class DiskMountManagerImpl : public DiskMountManager {
}
Disk* disk = new Disk(disk_info.device_path(),
disk_info.mount_path(),
+ false,
hashimoto 2016/10/21 07:28:04 Please make it easy to figure out what this "false
yamaguchi 2016/10/21 08:27:03 Done.
disk_info.system_path(),
disk_info.file_path(),
disk_info.label(),
@@ -495,7 +496,7 @@ class DiskMountManagerImpl : public DiskMountManager {
AccessModeMap::iterator access_mode =
access_modes_.find(disk->device_path());
if (access_mode != access_modes_.end()) {
- disk->set_read_only(access_mode->second ==
+ disk->set_write_disabled_by_policy(access_mode->second ==
chromeos::MOUNT_ACCESS_MODE_READ_ONLY);
hashimoto 2016/10/21 07:28:04 nit: indent You can run "git cl format" to correct
yamaguchi 2016/10/21 08:27:03 Thanks. It looks the existing code differs in the
}
disks_.insert(
@@ -680,6 +681,7 @@ class DiskMountManagerImpl : public DiskMountManager {
DiskMountManager::Disk::Disk(const std::string& device_path,
const std::string& mount_path,
+ bool write_disabled_by_policy,
const std::string& system_path,
const std::string& file_path,
const std::string& device_label,
@@ -693,13 +695,14 @@ DiskMountManager::Disk::Disk(const std::string& device_path,
DeviceType device_type,
uint64_t total_size_in_bytes,
bool is_parent,
- bool is_read_only,
+ bool is_read_only_hardware,
bool has_media,
bool on_boot_device,
bool on_removable_device,
bool is_hidden)
: device_path_(device_path),
mount_path_(mount_path),
+ write_disabled_by_policy_(write_disabled_by_policy),
system_path_(system_path),
file_path_(file_path),
device_label_(device_label),
@@ -713,7 +716,7 @@ DiskMountManager::Disk::Disk(const std::string& device_path,
device_type_(device_type),
total_size_in_bytes_(total_size_in_bytes),
is_parent_(is_parent),
- is_read_only_(is_read_only),
+ is_read_only_hardware_(is_read_only_hardware),
has_media_(has_media),
on_boot_device_(on_boot_device),
on_removable_device_(on_removable_device),

Powered by Google App Engine
This is Rietveld 408576698