Chromium Code Reviews| Index: chromeos/dbus/shill_client_helper.cc |
| diff --git a/chromeos/dbus/shill_client_helper.cc b/chromeos/dbus/shill_client_helper.cc |
| index bd421bcfa453f26f02bd5b809d0dc0f2038d275a..dd1f79eae50764fa658fba724d6d9d194729e32a 100644 |
| --- a/chromeos/dbus/shill_client_helper.cc |
| +++ b/chromeos/dbus/shill_client_helper.cc |
| @@ -62,6 +62,21 @@ void ShillClientHelper::CallObjectPathMethod( |
| callback)); |
| } |
| +void ShillClientHelper::CallObjectPathMethodWithErrorCallback( |
| + dbus::MethodCall* method_call, |
| + const ObjectPathCallbackWithoutStatus& callback, |
| + const ErrorCallback& error_callback) { |
| + proxy_->CallMethodWithErrorCallback( |
| + method_call, |
| + dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
| + base::Bind(&ShillClientHelper::OnObjectPathMethodWithoutStatus, |
| + weak_ptr_factory_.GetWeakPtr(), |
| + callback), |
| + base::Bind(&ShillClientHelper::OnError, |
| + weak_ptr_factory_.GetWeakPtr(), |
| + error_callback)); |
| +} |
| + |
| void ShillClientHelper::CallDictionaryValueMethod( |
| dbus::MethodCall* method_call, |
| const DictionaryValueCallback& callback) { |
| @@ -230,6 +245,22 @@ void ShillClientHelper::OnObjectPathMethod( |
| callback.Run(DBUS_METHOD_CALL_SUCCESS, result); |
| } |
| +void ShillClientHelper::OnObjectPathMethodWithoutStatus( |
| + const ObjectPathCallbackWithoutStatus& callback, |
| + dbus::Response* response) { |
| + if (!response) { |
| + callback.Run(dbus::ObjectPath()); |
|
hashimoto
2012/09/24 02:28:56
Please run ErrorCallback on error cases. (see OnDi
Greg Spencer (Chromium)
2012/09/24 21:50:54
Done.
|
| + return; |
| + } |
| + dbus::MessageReader reader(response); |
| + dbus::ObjectPath result; |
| + if (!reader.PopObjectPath(&result)) { |
| + callback.Run(dbus::ObjectPath()); |
|
hashimoto
2012/09/24 02:28:56
ditto.
Greg Spencer (Chromium)
2012/09/24 21:50:54
Done.
|
| + return; |
| + } |
| + callback.Run(result); |
| +} |
| + |
| void ShillClientHelper::OnDictionaryValueMethod( |
| const DictionaryValueCallback& callback, |
| dbus::Response* response) { |