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

Unified Diff: chromeos/dbus/shill_service_client.cc

Issue 11367048: This is the first pass at making GetIPConfigs asynchronous. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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_service_client.cc
diff --git a/chromeos/dbus/shill_service_client.cc b/chromeos/dbus/shill_service_client.cc
index f208966ab3b6b690177fa801e720597a898cb630..cea7b78960f98675e55a431768df02de3ba843bb 100644
--- a/chromeos/dbus/shill_service_client.cc
+++ b/chromeos/dbus/shill_service_client.cc
@@ -36,8 +36,8 @@ void OnGetPropertiesError(
else
LOG(ERROR) << log_string;
- base::DictionaryValue empty_dictionary;
- callback.Run(DBUS_METHOD_CALL_FAILURE, empty_dictionary);
+ scoped_ptr<base::DictionaryValue> empty_dictionary(new base::DictionaryValue);
+ callback.Run(DBUS_METHOD_CALL_FAILURE, empty_dictionary.Pass());
}
// The ShillServiceClient implementation.
@@ -356,11 +356,12 @@ class ShillServiceClientStubImpl : public ShillServiceClient,
base::DictionaryValue* dict = NULL;
if (!stub_services_.GetDictionaryWithoutPathExpansion(
service_path.value(), &dict)) {
- base::DictionaryValue empty_dictionary;
- callback.Run(DBUS_METHOD_CALL_FAILURE, empty_dictionary);
+ scoped_ptr<base::DictionaryValue> empty(new base::DictionaryValue);
+ callback.Run(DBUS_METHOD_CALL_FAILURE, empty.Pass());
return;
}
- callback.Run(DBUS_METHOD_CALL_SUCCESS, *dict);
+ scoped_ptr<base::DictionaryValue> result_copy(dict->DeepCopy());
+ callback.Run(DBUS_METHOD_CALL_SUCCESS, result_copy.Pass());
}
void NotifyObserversPropertyChanged(const dbus::ObjectPath& service_path,

Powered by Google App Engine
This is Rietveld 408576698