|
|
Chromium Code Reviews|
Created:
4 years, 1 month ago by yamaguchi Modified:
4 years, 1 month ago CC:
chromium-reviews, extensions-reviews_chromium.org, yamaguchi+watch_chromium.org, oka+watch_chromium.org, rginda+watch_chromium.org, oshima+watch_chromium.org, fukino+watch_chromium.org, chromium-apps-reviews_chromium.org, davemoore+watch_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionPropagate the read_only_hardware flag of volumes to js.
Only for removable disk partitions.
The property will be used to distinguish between write-protect devices
and restricted write access by the policy. UI code will be able to
provide better messages based on that.
BUG=643693, 655003
TEST=manual test. Deploy to a device and set breakpoint in backgroun_script.js at the beginning of DeviceHandler.prototype.onMountCompleted(). See event.volumeMetadata has isReadoOnlyHardware value reflecting the attached device.
Committed: https://crrev.com/dd19a48cddc73cdfea90e644ad05084aeb75ffb0
Cr-Commit-Position: refs/heads/master@{#429223}
Patch Set 1 #Patch Set 2 : Update externs .js file manually. Fix browser_test. #Patch Set 3 : Fix test case to cover RO device by policy. Rename test data field to match the counterpart in Disk. #Patch Set 4 : Apply default value for others than removable disk volume. #
Total comments: 4
Patch Set 5 : Describe example situation where the two 'read_only' fields holds different values. #Patch Set 6 : Fix comment. #
Total comments: 6
Patch Set 7 : Rename fields. Fill the field explicitly only for storage patitions. #
Total comments: 2
Patch Set 8 : Rename the field name to is_read_only_removable_device, as it's only valid for removable devices. #
Messages
Total messages: 51 (35 generated)
The CQ bit was checked by yamaguchi@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by yamaguchi@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by yamaguchi@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by yamaguchi@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by yamaguchi@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
yamaguchi@chromium.org changed reviewers: + fukino@chromium.org
ptal
https://codereview.chromium.org/2451713002/diff/60001/chrome/browser/chromeos... File chrome/browser/chromeos/file_manager/volume_manager.cc (right): https://codereview.chromium.org/2451713002/diff/60001/chrome/browser/chromeos... chrome/browser/chromeos/file_manager/volume_manager.cc:157: watchable_(false) {} nit: looks unnecessary change (the style is not consistent with the dtor) https://codereview.chromium.org/2451713002/diff/60001/chrome/browser/chromeos... File chrome/browser/chromeos/file_manager/volume_manager.h (right): https://codereview.chromium.org/2451713002/diff/60001/chrome/browser/chromeos... chrome/browser/chromeos/file_manager/volume_manager.h:124: // When this value is true, is_read_only() is also true. Could you mention an example in which is_read_only_ is true but is_read_only_hardware_ is false. In CL description or code comment, could you explain why we need to have these two separated fields.
Description was changed from ========== Propagate the read_only_hardware flag of volumes to js. Only for removable disk partitions. BUG=643693,655003 TEST=manual test. Deploy to a device and set breakpoint in backgroun_script.js at the beginning of DeviceHandler.prototype.onMountCompleted(). See event.volumeMetadata has isReadoOnlyHardware value reflecting the attached device. ========== to ========== Propagate the read_only_hardware flag of volumes to js. Only for removable disk partitions. The property will be used to distinguish between write-protect devices and restricted write access by the policy. UI code will be allowed to provide better messaging using the field value. BUG=643693,655003 TEST=manual test. Deploy to a device and set breakpoint in backgroun_script.js at the beginning of DeviceHandler.prototype.onMountCompleted(). See event.volumeMetadata has isReadoOnlyHardware value reflecting the attached device. ==========
Description was changed from ========== Propagate the read_only_hardware flag of volumes to js. Only for removable disk partitions. The property will be used to distinguish between write-protect devices and restricted write access by the policy. UI code will be allowed to provide better messaging using the field value. BUG=643693,655003 TEST=manual test. Deploy to a device and set breakpoint in backgroun_script.js at the beginning of DeviceHandler.prototype.onMountCompleted(). See event.volumeMetadata has isReadoOnlyHardware value reflecting the attached device. ========== to ========== Propagate the read_only_hardware flag of volumes to js. Only for removable disk partitions. The property will be used to distinguish between write-protect devices and restricted write access by the policy. UI code will be able to provide better messages based on that. BUG=643693,655003 TEST=manual test. Deploy to a device and set breakpoint in backgroun_script.js at the beginning of DeviceHandler.prototype.onMountCompleted(). See event.volumeMetadata has isReadoOnlyHardware value reflecting the attached device. ==========
https://codereview.chromium.org/2451713002/diff/60001/chrome/browser/chromeos... File chrome/browser/chromeos/file_manager/volume_manager.cc (right): https://codereview.chromium.org/2451713002/diff/60001/chrome/browser/chromeos... chrome/browser/chromeos/file_manager/volume_manager.cc:157: watchable_(false) {} On 2016/10/26 07:23:31, fukino wrote: > nit: looks unnecessary change (the style is not consistent with the dtor) Done. https://codereview.chromium.org/2451713002/diff/60001/chrome/browser/chromeos... File chrome/browser/chromeos/file_manager/volume_manager.h (right): https://codereview.chromium.org/2451713002/diff/60001/chrome/browser/chromeos... chrome/browser/chromeos/file_manager/volume_manager.h:124: // When this value is true, is_read_only() is also true. On 2016/10/26 07:23:31, fukino wrote: > Could you mention an example in which is_read_only_ is true but > is_read_only_hardware_ is false. > > In CL description or code comment, could you explain why we need to have these > two separated fields. Done. Described for what this change is, in the CL description.
https://codereview.chromium.org/2451713002/diff/100001/chrome/browser/chromeo... File chrome/browser/chromeos/file_manager/volume_manager.cc (right): https://codereview.chromium.org/2451713002/diff/100001/chrome/browser/chromeo... chrome/browser/chromeos/file_manager/volume_manager.cc:215: volume->is_read_only_ = volume->is_read_only_hardware_ = Should is_read_only_hardware_ be true? The archive is not hardware so I'm a bit confused here. https://codereview.chromium.org/2451713002/diff/100001/chrome/browser/chromeo... chrome/browser/chromeos/file_manager/volume_manager.cc:249: volume->is_read_only_hardware_ = volume->is_read_only_; ditto. FPS volumes are not necessary haredware. https://codereview.chromium.org/2451713002/diff/100001/chrome/browser/chromeo... File chrome/browser/chromeos/file_manager/volume_manager.h (right): https://codereview.chromium.org/2451713002/diff/100001/chrome/browser/chromeo... chrome/browser/chromeos/file_manager/volume_manager.h:128: bool is_read_only_hardware() const { return is_read_only_hardware_; } optional nit: is_read_only_device might be more consistent naming with SOURCE_DEVICE?
The CQ bit was checked by yamaguchi@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2451713002/diff/100001/chrome/browser/chromeo... File chrome/browser/chromeos/file_manager/volume_manager.cc (right): https://codereview.chromium.org/2451713002/diff/100001/chrome/browser/chromeo... chrome/browser/chromeos/file_manager/volume_manager.cc:215: volume->is_read_only_ = volume->is_read_only_hardware_ = On 2016/10/27 05:27:34, fukino wrote: > Should is_read_only_hardware_ be true? > The archive is not hardware so I'm a bit confused here. Now that we state the is_read_only_device field is only valid for removable device partitions, I think it should leave the field in its default value for other cases. https://codereview.chromium.org/2451713002/diff/100001/chrome/browser/chromeo... chrome/browser/chromeos/file_manager/volume_manager.cc:249: volume->is_read_only_hardware_ = volume->is_read_only_; On 2016/10/27 05:27:34, fukino wrote: > ditto. > FPS volumes are not necessary haredware. Done. https://codereview.chromium.org/2451713002/diff/100001/chrome/browser/chromeo... File chrome/browser/chromeos/file_manager/volume_manager.h (right): https://codereview.chromium.org/2451713002/diff/100001/chrome/browser/chromeo... chrome/browser/chromeos/file_manager/volume_manager.h:128: bool is_read_only_hardware() const { return is_read_only_hardware_; } On 2016/10/27 05:27:34, fukino wrote: > optional nit: is_read_only_device might be more consistent naming with > SOURCE_DEVICE? In Disk class, "hardware" was adopted for the field name to emphasize the difference between mount option (given by software) and the device itself. Regarding the new fields in this change, I agree that it'd be better to have relevant name to either the VOLUME_TYPE_REMOVABLE_DISK_PARTITION or SOURCE_DEVICE.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2451713002/diff/120001/chrome/browser/chromeo... File chrome/browser/chromeos/file_manager/volume_manager.h (right): https://codereview.chromium.org/2451713002/diff/120001/chrome/browser/chromeo... chrome/browser/chromeos/file_manager/volume_manager.h:128: bool is_read_only_device() const { return is_read_only_device_; } This field is valid only when the volume type is removable disk AND the source is device. To avoid misuse of this field, how about use more descriptive(longer) name, like is_read_only_removable_device? When we add more meaning for this field, let's change the name.
The CQ bit was checked by yamaguchi@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2451713002/diff/120001/chrome/browser/chromeo... File chrome/browser/chromeos/file_manager/volume_manager.h (right): https://codereview.chromium.org/2451713002/diff/120001/chrome/browser/chromeo... chrome/browser/chromeos/file_manager/volume_manager.h:128: bool is_read_only_device() const { return is_read_only_device_; } On 2016/10/27 11:39:08, fukino wrote: > This field is valid only when the volume type is removable disk AND the source > is device. > To avoid misuse of this field, how about use more descriptive(longer) name, like > is_read_only_removable_device? > > When we add more meaning for this field, let's change the name. Agreed. Done.
lgtm
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by yamaguchi@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
yamaguchi@chromium.org changed reviewers: + mtomasz@chromium.org
+mtomasz Will you review and approve the change to chrome/common/extensions/api/file_manager_private.idl ?
lgtm. Sorry for late. Please always ping me if I don't respond in 24h.
lgtm. Sorry for late. Please always ping me if I don't respond in 24h.
The CQ bit was checked by yamaguchi@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Propagate the read_only_hardware flag of volumes to js. Only for removable disk partitions. The property will be used to distinguish between write-protect devices and restricted write access by the policy. UI code will be able to provide better messages based on that. BUG=643693,655003 TEST=manual test. Deploy to a device and set breakpoint in backgroun_script.js at the beginning of DeviceHandler.prototype.onMountCompleted(). See event.volumeMetadata has isReadoOnlyHardware value reflecting the attached device. ========== to ========== Propagate the read_only_hardware flag of volumes to js. Only for removable disk partitions. The property will be used to distinguish between write-protect devices and restricted write access by the policy. UI code will be able to provide better messages based on that. BUG=643693,655003 TEST=manual test. Deploy to a device and set breakpoint in backgroun_script.js at the beginning of DeviceHandler.prototype.onMountCompleted(). See event.volumeMetadata has isReadoOnlyHardware value reflecting the attached device. ==========
Message was sent while issue was closed.
Committed patchset #8 (id:140001)
Message was sent while issue was closed.
Description was changed from ========== Propagate the read_only_hardware flag of volumes to js. Only for removable disk partitions. The property will be used to distinguish between write-protect devices and restricted write access by the policy. UI code will be able to provide better messages based on that. BUG=643693,655003 TEST=manual test. Deploy to a device and set breakpoint in backgroun_script.js at the beginning of DeviceHandler.prototype.onMountCompleted(). See event.volumeMetadata has isReadoOnlyHardware value reflecting the attached device. ========== to ========== Propagate the read_only_hardware flag of volumes to js. Only for removable disk partitions. The property will be used to distinguish between write-protect devices and restricted write access by the policy. UI code will be able to provide better messages based on that. BUG=643693,655003 TEST=manual test. Deploy to a device and set breakpoint in backgroun_script.js at the beginning of DeviceHandler.prototype.onMountCompleted(). See event.volumeMetadata has isReadoOnlyHardware value reflecting the attached device. Committed: https://crrev.com/dd19a48cddc73cdfea90e644ad05084aeb75ffb0 Cr-Commit-Position: refs/heads/master@{#429223} ==========
Message was sent while issue was closed.
Patchset 8 (id:??) landed as https://crrev.com/dd19a48cddc73cdfea90e644ad05084aeb75ffb0 Cr-Commit-Position: refs/heads/master@{#429223} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
