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

Unified Diff: chromeos/dbus/shill_device_client.cc

Issue 10949030: This converts the Shill clients to allow propagation of shill errors (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: review changes Created 8 years, 3 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/dbus/shill_device_client.cc
diff --git a/chromeos/dbus/shill_device_client.cc b/chromeos/dbus/shill_device_client.cc
index eda7c41ac05451ee38c74579a4cd449fbcc48c06..5db87d729e7f243846b12f2874156a9f78cd4f76 100644
--- a/chromeos/dbus/shill_device_client.cc
+++ b/chromeos/dbus/shill_device_client.cc
@@ -65,13 +65,16 @@ class ShillDeviceClientImpl : public ShillDeviceClient {
virtual void SetProperty(const dbus::ObjectPath& device_path,
const std::string& name,
const base::Value& value,
- const VoidDBusMethodCallback& callback) OVERRIDE {
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
dbus::MethodCall method_call(flimflam::kFlimflamDeviceInterface,
flimflam::kSetPropertyFunction);
dbus::MessageWriter writer(&method_call);
writer.AppendString(name);
ShillClientHelper::AppendValueDataAsVariant(&writer, value);
- GetHelper(device_path)->CallVoidMethod(&method_call, callback);
+ GetHelper(device_path)->CallVoidMethodWithErrorCallback(&method_call,
+ callback,
+ error_callback);
}
virtual void ClearProperty(const dbus::ObjectPath& device_path,
@@ -282,14 +285,20 @@ class ShillDeviceClientStubImpl : public ShillDeviceClient {
virtual void SetProperty(const dbus::ObjectPath& device_path,
const std::string& name,
const base::Value& value,
- const VoidDBusMethodCallback& callback) OVERRIDE {
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
base::DictionaryValue* device_properties = NULL;
if (!stub_devices_.GetDictionary(device_path.value(), &device_properties)) {
- PostVoidCallback(callback, DBUS_METHOD_CALL_FAILURE);
+ std::string error_name("org.chromium.flimflam.Error.Failure");
+ std::string error_message("Failed");
+ MessageLoop::current()->PostTask(FROM_HERE,
+ base::Bind(error_callback,
+ error_name,
+ error_message));
return;
}
device_properties->Set(name, value.DeepCopy());
- PostVoidCallback(callback, DBUS_METHOD_CALL_SUCCESS);
+ MessageLoop::current()->PostTask(FROM_HERE, callback);
}
// ShillDeviceClient override.

Powered by Google App Engine
This is Rietveld 408576698