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

Unified Diff: chromeos/dbus/shill_manager_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_manager_client.h ('k') | chromeos/dbus/shill_manager_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/shill_manager_client.cc
diff --git a/chromeos/dbus/shill_manager_client.cc b/chromeos/dbus/shill_manager_client.cc
index deb560b67152dd956b445b0399a68dfa4747348e..08f163b9f962bdb33823934a4768f8f74642e5b7 100644
--- a/chromeos/dbus/shill_manager_client.cc
+++ b/chromeos/dbus/shill_manager_client.cc
@@ -84,63 +84,81 @@ class ShillManagerClientImpl : public ShillManagerClient {
virtual void SetProperty(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::kFlimflamManagerInterface,
flimflam::kSetPropertyFunction);
dbus::MessageWriter writer(&method_call);
writer.AppendString(name);
ShillClientHelper::AppendValueDataAsVariant(&writer, value);
- helper_.CallVoidMethod(&method_call, callback);
+ helper_.CallVoidMethodWithErrorCallback(&method_call,
+ callback,
+ error_callback);
}
virtual void RequestScan(const std::string& type,
- const VoidDBusMethodCallback& callback) OVERRIDE {
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
dbus::MethodCall method_call(flimflam::kFlimflamManagerInterface,
flimflam::kRequestScanFunction);
dbus::MessageWriter writer(&method_call);
writer.AppendString(type);
- helper_.CallVoidMethod(&method_call, callback);
+ helper_.CallVoidMethodWithErrorCallback(&method_call,
+ callback,
+ error_callback);
}
virtual void EnableTechnology(
const std::string& type,
- const VoidDBusMethodCallback& callback) OVERRIDE {
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
dbus::MethodCall method_call(flimflam::kFlimflamManagerInterface,
flimflam::kEnableTechnologyFunction);
dbus::MessageWriter writer(&method_call);
writer.AppendString(type);
- helper_.CallVoidMethod(&method_call, callback);
+ helper_.CallVoidMethodWithErrorCallback(&method_call,
+ callback,
+ error_callback);
}
virtual void DisableTechnology(
const std::string& type,
- const VoidDBusMethodCallback& callback) OVERRIDE {
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
dbus::MethodCall method_call(flimflam::kFlimflamManagerInterface,
flimflam::kDisableTechnologyFunction);
dbus::MessageWriter writer(&method_call);
writer.AppendString(type);
- helper_.CallVoidMethod(&method_call, callback);
+ helper_.CallVoidMethodWithErrorCallback(&method_call,
+ callback,
+ error_callback);
}
virtual void ConfigureService(
const base::DictionaryValue& properties,
- const VoidDBusMethodCallback& callback) OVERRIDE {
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
DCHECK(AreServicePropertiesValid(properties));
dbus::MethodCall method_call(flimflam::kFlimflamManagerInterface,
flimflam::kConfigureServiceFunction);
dbus::MessageWriter writer(&method_call);
AppendServicePropertiesDictionary(&writer, properties);
- helper_.CallVoidMethod(&method_call, callback);
+ helper_.CallVoidMethodWithErrorCallback(&method_call,
+ callback,
+ error_callback);
}
virtual void GetService(
const base::DictionaryValue& properties,
- const ObjectPathDBusMethodCallback& callback) OVERRIDE {
+ const ObjectPathCallback& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
dbus::MethodCall method_call(flimflam::kFlimflamManagerInterface,
flimflam::kGetServiceFunction);
dbus::MessageWriter writer(&method_call);
AppendServicePropertiesDictionary(&writer, properties);
- helper_.CallObjectPathMethod(&method_call, callback);
+ helper_.CallObjectPathMethodWithErrorCallback(&method_call,
+ callback,
+ error_callback);
}
private:
@@ -191,55 +209,50 @@ class ShillManagerClientStubImpl : public ShillManagerClient {
// ShillManagerClient override.
virtual void SetProperty(const std::string& name,
const base::Value& value,
- const VoidDBusMethodCallback& callback) OVERRIDE {
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
stub_properties_.Set(name, value.DeepCopy());
- MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback,
- DBUS_METHOD_CALL_SUCCESS));
+ MessageLoop::current()->PostTask(FROM_HERE, callback);
}
// ShillManagerClient override.
virtual void RequestScan(const std::string& type,
- const VoidDBusMethodCallback& callback) OVERRIDE {
- MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback,
- DBUS_METHOD_CALL_SUCCESS));
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
+ MessageLoop::current()->PostTask(FROM_HERE, callback);
}
// ShillManagerClient override.
virtual void EnableTechnology(
const std::string& type,
- const VoidDBusMethodCallback& callback) OVERRIDE {
- MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback,
- DBUS_METHOD_CALL_SUCCESS));
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
+ MessageLoop::current()->PostTask(FROM_HERE, callback);
}
// ShillManagerClient override.
virtual void DisableTechnology(
const std::string& type,
- const VoidDBusMethodCallback& callback) OVERRIDE {
- MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback,
- DBUS_METHOD_CALL_SUCCESS));
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
+ MessageLoop::current()->PostTask(FROM_HERE, callback);
}
// ShillManagerClient override.
virtual void ConfigureService(
const base::DictionaryValue& properties,
- const VoidDBusMethodCallback& callback) OVERRIDE {
- MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback,
- DBUS_METHOD_CALL_SUCCESS));
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
+ MessageLoop::current()->PostTask(FROM_HERE, callback);
}
// ShillManagerClient override.
virtual void GetService(
const base::DictionaryValue& properties,
- const ObjectPathDBusMethodCallback& callback) OVERRIDE {
+ const ObjectPathCallback& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
MessageLoop::current()->PostTask(FROM_HERE,
base::Bind(callback,
- DBUS_METHOD_CALL_SUCCESS,
dbus::ObjectPath()));
}
« no previous file with comments | « chromeos/dbus/shill_manager_client.h ('k') | chromeos/dbus/shill_manager_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698