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

Unified Diff: chromeos/dbus/flimflam_device_client.cc

Issue 10170020: Rework chromeos::FlimflamDevice/ServiceClient with CallMethodWithErrorCallback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 8 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/flimflam_device_client.h ('k') | chromeos/dbus/flimflam_device_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/flimflam_device_client.cc
diff --git a/chromeos/dbus/flimflam_device_client.cc b/chromeos/dbus/flimflam_device_client.cc
index bc5747548c7bc5fb6fbe665d6892a8905015c9bf..eccc7efc5615d5b88384b1ed8181b888beb51e0a 100644
--- a/chromeos/dbus/flimflam_device_client.cc
+++ b/chromeos/dbus/flimflam_device_client.cc
@@ -115,61 +115,71 @@ class FlimflamDeviceClientImpl : public FlimflamDeviceClient {
virtual void RequirePin(const dbus::ObjectPath& device_path,
const std::string& pin,
bool require,
- const VoidCallback& callback) OVERRIDE {
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
dbus::MethodCall method_call(flimflam::kFlimflamDeviceInterface,
flimflam::kRequirePinFunction);
dbus::MessageWriter writer(&method_call);
writer.AppendString(pin);
writer.AppendBool(require);
- GetHelper(device_path)->CallVoidMethod(&method_call, callback);
+ GetHelper(device_path)->CallVoidMethodWithErrorCallback(
+ &method_call, callback, error_callback);
}
// FlimflamProfileClient override.
virtual void EnterPin(const dbus::ObjectPath& device_path,
const std::string& pin,
- const VoidCallback& callback) OVERRIDE {
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
dbus::MethodCall method_call(flimflam::kFlimflamDeviceInterface,
flimflam::kEnterPinFunction);
dbus::MessageWriter writer(&method_call);
writer.AppendString(pin);
- GetHelper(device_path)->CallVoidMethod(&method_call, callback);
+ GetHelper(device_path)->CallVoidMethodWithErrorCallback(
+ &method_call, callback, error_callback);
}
// FlimflamProfileClient override.
virtual void UnblockPin(const dbus::ObjectPath& device_path,
const std::string& puk,
const std::string& pin,
- const VoidCallback& callback) OVERRIDE {
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
dbus::MethodCall method_call(flimflam::kFlimflamDeviceInterface,
flimflam::kUnblockPinFunction);
dbus::MessageWriter writer(&method_call);
writer.AppendString(puk);
writer.AppendString(pin);
- GetHelper(device_path)->CallVoidMethod(&method_call, callback);
+ GetHelper(device_path)->CallVoidMethodWithErrorCallback(
+ &method_call, callback, error_callback);
}
// FlimflamProfileClient override.
virtual void ChangePin(const dbus::ObjectPath& device_path,
const std::string& old_pin,
const std::string& new_pin,
- const VoidCallback& callback) OVERRIDE {
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
dbus::MethodCall method_call(flimflam::kFlimflamDeviceInterface,
flimflam::kChangePinFunction);
dbus::MessageWriter writer(&method_call);
writer.AppendString(old_pin);
writer.AppendString(new_pin);
- GetHelper(device_path)->CallVoidMethod(&method_call, callback);
+ GetHelper(device_path)->CallVoidMethodWithErrorCallback(
+ &method_call, callback, error_callback);
}
// FlimflamProfileClient override.
virtual void Register(const dbus::ObjectPath& device_path,
const std::string& network_id,
- const VoidCallback& callback) OVERRIDE {
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
dbus::MethodCall method_call(flimflam::kFlimflamDeviceInterface,
flimflam::kRegisterFunction);
dbus::MessageWriter writer(&method_call);
writer.AppendString(network_id);
- GetHelper(device_path)->CallVoidMethod(&method_call, callback);
+ GetHelper(device_path)->CallVoidMethodWithErrorCallback(
+ &method_call, callback, error_callback);
}
private:
@@ -271,38 +281,43 @@ class FlimflamDeviceClientStubImpl : public FlimflamDeviceClient {
virtual void RequirePin(const dbus::ObjectPath& device_path,
const std::string& pin,
bool require,
- const VoidCallback& callback) OVERRIDE {
- PostSuccessVoidCallback(callback);
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
+ MessageLoop::current()->PostTask(FROM_HERE, callback);
}
// FlimflamDeviceClient override.
virtual void EnterPin(const dbus::ObjectPath& device_path,
const std::string& pin,
- const VoidCallback& callback) OVERRIDE {
- PostSuccessVoidCallback(callback);
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
+ MessageLoop::current()->PostTask(FROM_HERE, callback);
}
// FlimflamDeviceClient override.
virtual void UnblockPin(const dbus::ObjectPath& device_path,
const std::string& puk,
const std::string& pin,
- const VoidCallback& callback) OVERRIDE {
- PostSuccessVoidCallback(callback);
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
+ MessageLoop::current()->PostTask(FROM_HERE, callback);
}
// FlimflamDeviceClient override.
virtual void ChangePin(const dbus::ObjectPath& device_path,
const std::string& old_pin,
const std::string& new_pin,
- const VoidCallback& callback) OVERRIDE {
- PostSuccessVoidCallback(callback);
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
+ MessageLoop::current()->PostTask(FROM_HERE, callback);
}
// FlimflamDeviceClient override.
virtual void Register(const dbus::ObjectPath& device_path,
const std::string& network_id,
- const VoidCallback& callback) OVERRIDE {
- PostSuccessVoidCallback(callback);
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
+ MessageLoop::current()->PostTask(FROM_HERE, callback);
}
private:
« no previous file with comments | « chromeos/dbus/flimflam_device_client.h ('k') | chromeos/dbus/flimflam_device_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698