diff options
author | benchan@chromium.org <benchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-06 21:52:35 +0000 |
---|---|---|
committer | benchan@chromium.org <benchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-06 21:52:35 +0000 |
commit | f026c0f4d68d9f16626605a763db421d3dbc3079 (patch) | |
tree | 8245b8c9a4f7b1ad66967e22409539db3cc8462a /chromeos/dbus/fake_cros_disks_client.cc | |
parent | a594ad9e249e91780a6a80a209b358d743b2c85d (diff) | |
download | chromium_src-f026c0f4d68d9f16626605a763db421d3dbc3079.zip chromium_src-f026c0f4d68d9f16626605a763db421d3dbc3079.tar.gz chromium_src-f026c0f4d68d9f16626605a763db421d3dbc3079.tar.bz2 |
Use cros-disks Format DBus call instead of deprecated FormatDevice.
The cros-disks FormatDevice DBus call has been long deprecated (back in 2011).
This CL modifies CrosDisksClient and DiskMountManager to use the Format DBus
call instead.
BUG=369877
TEST=Tested the following:
1. Run chromeos_unittests.
2. Insert a USB drive and format the mounted partition via Files.app.
Verify that Files.app notifies the successful completion of the
format operation.
3. Insert a write-protected SD card and format the mounted partition via
Files.app. Verify that Files.app reports an error.
R=stevenjb@chromium.org, tbarzic@chromium.org
Review URL: https://codereview.chromium.org/262393002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268623 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/dbus/fake_cros_disks_client.cc')
-rw-r--r-- | chromeos/dbus/fake_cros_disks_client.cc | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/chromeos/dbus/fake_cros_disks_client.cc b/chromeos/dbus/fake_cros_disks_client.cc index 8e96bf2..344a98e 100644 --- a/chromeos/dbus/fake_cros_disks_client.cc +++ b/chromeos/dbus/fake_cros_disks_client.cc @@ -13,8 +13,8 @@ namespace chromeos { FakeCrosDisksClient::FakeCrosDisksClient() : unmount_call_count_(0), unmount_success_(true), - format_device_call_count_(0), - format_device_success_(true) { + format_call_count_(0), + format_success_(true) { } FakeCrosDisksClient::~FakeCrosDisksClient() { @@ -51,19 +51,18 @@ void FakeCrosDisksClient::EnumerateAutoMountableDevices( const base::Closure& error_callback) { } -void FakeCrosDisksClient::FormatDevice(const std::string& device_path, - const std::string& filesystem, - const FormatDeviceCallback& callback, - const base::Closure& error_callback) { +void FakeCrosDisksClient::Format(const std::string& device_path, + const std::string& filesystem, + const base::Closure& callback, + const base::Closure& error_callback) { DCHECK(!callback.is_null()); DCHECK(!error_callback.is_null()); - format_device_call_count_++; - last_format_device_device_path_ = device_path; - last_format_device_filesystem_ = filesystem; - if (format_device_success_) { - base::MessageLoopProxy::current()->PostTask(FROM_HERE, - base::Bind(callback, true)); + format_call_count_++; + last_format_device_path_ = device_path; + last_format_filesystem_ = filesystem; + if (format_success_) { + base::MessageLoopProxy::current()->PostTask(FROM_HERE, callback); } else { base::MessageLoopProxy::current()->PostTask(FROM_HERE, error_callback); } |