Index: chromeos/dbus/flimflam_client_helper.h |
diff --git a/chromeos/dbus/flimflam_client_helper.h b/chromeos/dbus/flimflam_client_helper.h |
index dd2a261b3262707466217839030d349cf16db3fa..859d95e9c4061d9ed0ddfa3082f12767f5eb21f9 100644 |
--- a/chromeos/dbus/flimflam_client_helper.h |
+++ b/chromeos/dbus/flimflam_client_helper.h |
@@ -23,6 +23,7 @@ class DictionaryValue; |
namespace dbus { |
class Bus; |
+class ErrorResponse; |
class MessageWriter; |
class MethodCall; |
class ObjectPath; |
@@ -54,6 +55,10 @@ class FlimflamClientHelper { |
DBusMethodCallStatus call_status, |
const base::DictionaryValue& result)> DictionaryValueCallback; |
+ // A callback to handle erros for method call. |
+ typedef base::Callback<void(const std::string& error_name, |
+ const std::string& error_message)> ErrorCallback; |
+ |
FlimflamClientHelper(dbus::Bus* bus, dbus::ObjectProxy* proxy); |
virtual ~FlimflamClientHelper(); |
@@ -79,6 +84,11 @@ class FlimflamClientHelper { |
void CallDictionaryValueMethod(dbus::MethodCall* method_call, |
const DictionaryValueCallback& callback); |
+ // Calls a method without results with error callback. |
+ void CallVoidMethodWithErrorCallback(dbus::MethodCall* method_call, |
+ const base::Closure& callback, |
+ const ErrorCallback& error_callback); |
+ |
// DEPRECATED DO NOT USE: Calls a method without results. |
bool CallVoidMethodAndBlock(dbus::MethodCall* method_call); |
@@ -116,6 +126,15 @@ class FlimflamClientHelper { |
void OnDictionaryValueMethod(const DictionaryValueCallback& callback, |
dbus::Response* response); |
+ // Handles responses for methods without results. |
+ // Used by CallVoidMethodWithErrorCallback(). |
+ void OnVoidMethodWithErrorCallback(const base::Closure& callback, |
+ dbus::Response* response); |
+ |
+ // Handles errors for method calls. |
+ void OnError(const ErrorCallback& error_callback, |
+ dbus::ErrorResponse* response); |
+ |
base::WeakPtrFactory<FlimflamClientHelper> weak_ptr_factory_; |
// TODO(hashimoto): Remove this when we no longer need to make blocking calls. |
BlockingMethodCaller blocking_method_caller_; |