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

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: Fix bad merge 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
« no previous file with comments | « chromeos/dbus/shill_device_client.h ('k') | chromeos/dbus/shill_device_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/shill_device_client.cc
diff --git a/chromeos/dbus/shill_device_client.cc b/chromeos/dbus/shill_device_client.cc
index 9e291019439f984b2264f28f5bf21f1149c20c63..b2cc011991a85b2cb2db28ca95cbadbf47f7c8b6 100644
--- a/chromeos/dbus/shill_device_client.cc
+++ b/chromeos/dbus/shill_device_client.cc
@@ -67,13 +67,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,
@@ -281,14 +284,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);
}
virtual void ClearProperty(const dbus::ObjectPath& device_path,
« no previous file with comments | « chromeos/dbus/shill_device_client.h ('k') | chromeos/dbus/shill_device_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698