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

Unified Diff: chromeos/dbus/shill_profile_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_profile_client.h ('k') | chromeos/dbus/shill_profile_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/shill_profile_client.cc
diff --git a/chromeos/dbus/shill_profile_client.cc b/chromeos/dbus/shill_profile_client.cc
index 70e5b2048fbaff1efddd0ec5734318652fdac690..6b2544c4b7005a8e5c41ee598e78fe1b1c59777d 100644
--- a/chromeos/dbus/shill_profile_client.cc
+++ b/chromeos/dbus/shill_profile_client.cc
@@ -37,14 +37,18 @@ class ShillProfileClientImpl : public ShillProfileClient {
ShillPropertyChangedObserver* observer) OVERRIDE {
GetHelper(profile_path)->RemovePropertyChangedObserver(observer);
}
- virtual void GetProperties(const dbus::ObjectPath& profile_path,
- const DictionaryValueCallback& callback) OVERRIDE;
+ virtual void GetProperties(
+ const dbus::ObjectPath& profile_path,
+ const DictionaryValueCallbackWithoutStatus& callback,
+ const ErrorCallback& error_callback) OVERRIDE;
virtual void GetEntry(const dbus::ObjectPath& profile_path,
const std::string& entry_path,
- const DictionaryValueCallback& callback) OVERRIDE;
+ const DictionaryValueCallbackWithoutStatus& callback,
+ const ErrorCallback& error_callback) OVERRIDE;
virtual void DeleteEntry(const dbus::ObjectPath& profile_path,
const std::string& entry_path,
- const VoidDBusMethodCallback& callback) OVERRIDE;
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE;
private:
typedef std::map<std::string, ShillClientHelper*> HelperMap;
@@ -81,32 +85,38 @@ ShillClientHelper* ShillProfileClientImpl::GetHelper(
void ShillProfileClientImpl::GetProperties(
const dbus::ObjectPath& profile_path,
- const DictionaryValueCallback& callback) {
+ const DictionaryValueCallbackWithoutStatus& callback,
+ const ErrorCallback& error_callback) {
dbus::MethodCall method_call(flimflam::kFlimflamProfileInterface,
flimflam::kGetPropertiesFunction);
- GetHelper(profile_path)->CallDictionaryValueMethod(&method_call, callback);
+ GetHelper(profile_path)->CallDictionaryValueMethodWithErrorCallback(
+ &method_call, callback, error_callback);
}
void ShillProfileClientImpl::GetEntry(
const dbus::ObjectPath& profile_path,
const std::string& entry_path,
- const DictionaryValueCallback& callback) {
+ const DictionaryValueCallbackWithoutStatus& callback,
+ const ErrorCallback& error_callback) {
dbus::MethodCall method_call(flimflam::kFlimflamProfileInterface,
flimflam::kGetEntryFunction);
dbus::MessageWriter writer(&method_call);
writer.AppendString(entry_path);
- GetHelper(profile_path)->CallDictionaryValueMethod(&method_call, callback);
+ GetHelper(profile_path)->CallDictionaryValueMethodWithErrorCallback(
+ &method_call, callback, error_callback);
}
void ShillProfileClientImpl::DeleteEntry(
const dbus::ObjectPath& profile_path,
const std::string& entry_path,
- const VoidDBusMethodCallback& callback) {
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) {
dbus::MethodCall method_call(flimflam::kFlimflamProfileInterface,
flimflam::kDeleteEntryFunction);
dbus::MessageWriter writer(&method_call);
writer.AppendString(entry_path);
- GetHelper(profile_path)->CallVoidMethod(&method_call, callback);
+ GetHelper(profile_path)->CallVoidMethodWithErrorCallback(
+ &method_call, callback, error_callback);
}
// A stub implementation of ShillProfileClient.
@@ -126,9 +136,10 @@ class ShillProfileClientStubImpl : public ShillProfileClient {
const dbus::ObjectPath& profile_path,
ShillPropertyChangedObserver* observer) OVERRIDE {}
- // ShillProfileClient override.
- virtual void GetProperties(const dbus::ObjectPath& profile_path,
- const DictionaryValueCallback& callback) OVERRIDE {
+ virtual void GetProperties(
+ const dbus::ObjectPath& profile_path,
+ const DictionaryValueCallbackWithoutStatus& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(&ShillProfileClientStubImpl::PassEmptyDictionaryValue,
@@ -138,7 +149,8 @@ class ShillProfileClientStubImpl : public ShillProfileClient {
virtual void GetEntry(const dbus::ObjectPath& profile_path,
const std::string& entry_path,
- const DictionaryValueCallback& callback) OVERRIDE {
+ const DictionaryValueCallbackWithoutStatus& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(&ShillProfileClientStubImpl::PassEmptyDictionaryValue,
@@ -148,16 +160,16 @@ class ShillProfileClientStubImpl : public ShillProfileClient {
virtual void DeleteEntry(const dbus::ObjectPath& profile_path,
const std::string& entry_path,
- 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);
}
private:
- void PassEmptyDictionaryValue(const DictionaryValueCallback& callback) const {
+ void PassEmptyDictionaryValue(
+ const DictionaryValueCallbackWithoutStatus& callback) const {
base::DictionaryValue dictionary;
- callback.Run(DBUS_METHOD_CALL_SUCCESS, dictionary);
+ callback.Run(dictionary);
}
// Note: This should remain the last member so it'll be destroyed and
« no previous file with comments | « chromeos/dbus/shill_profile_client.h ('k') | chromeos/dbus/shill_profile_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698