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

Unified Diff: chromeos/dbus/shill_client_helper.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_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) {

Powered by Google App Engine
This is Rietveld 408576698