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

Unified Diff: chromeos/dbus/shill_ipconfig_client_stub.cc

Issue 12634019: NetworkChangeNotifierChromeos: Handle IPConfig property changes on the default network (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 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_ipconfig_client_stub.h ('k') | chromeos/dbus/shill_manager_client_stub.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/shill_ipconfig_client_stub.cc
diff --git a/chromeos/dbus/shill_ipconfig_client_stub.cc b/chromeos/dbus/shill_ipconfig_client_stub.cc
index c78605de25de92e9b11802a15b5beb33885ba578..cac80b469ebf07c47894eea113d5faa887946a8b 100644
--- a/chromeos/dbus/shill_ipconfig_client_stub.cc
+++ b/chromeos/dbus/shill_ipconfig_client_stub.cc
@@ -43,10 +43,15 @@ void ShillIPConfigClientStub::GetProperties(
const DictionaryValueCallback& callback) {
if (callback.is_null())
return;
+ const base::DictionaryValue* dict = NULL;
+ if (!ipconfigs_.GetDictionaryWithoutPathExpansion(ipconfig_path.value(),
+ &dict))
+ return;
MessageLoop::current()->PostTask(
- FROM_HERE, base::Bind(&ShillIPConfigClientStub::PassProperties,
- weak_ptr_factory_.GetWeakPtr(),
- callback));
+ FROM_HERE, base::Bind(&ShillIPConfigClientStub::PassProperties,
+ weak_ptr_factory_.GetWeakPtr(),
+ dict,
+ callback));
}
base::DictionaryValue* ShillIPConfigClientStub::CallGetPropertiesAndBlock(
@@ -61,6 +66,18 @@ void ShillIPConfigClientStub::SetProperty(
const VoidDBusMethodCallback& callback) {
if (callback.is_null())
return;
+ base::DictionaryValue* dict = NULL;
+ if (ipconfigs_.GetDictionaryWithoutPathExpansion(ipconfig_path.value(),
+ &dict)) {
+ // Update existing ip config stub object's properties.
+ dict->SetWithoutPathExpansion(name, value.DeepCopy());
+ } else {
+ // Create a new stub ipconfig object, and update its properties.
+ DictionaryValue* dvalue = new DictionaryValue;
+ dvalue->SetWithoutPathExpansion(name, value.DeepCopy());
+ ipconfigs_.SetWithoutPathExpansion(ipconfig_path.value(),
+ dvalue);
+ }
MessageLoop::current()->PostTask(
FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS));
}
@@ -84,8 +101,9 @@ void ShillIPConfigClientStub::Remove(const dbus::ObjectPath& ipconfig_path,
}
void ShillIPConfigClientStub::PassProperties(
+ const base::DictionaryValue* values,
const DictionaryValueCallback& callback) const {
- callback.Run(DBUS_METHOD_CALL_SUCCESS, properties_);
+ callback.Run(DBUS_METHOD_CALL_SUCCESS, *values);
}
} // namespace chromeos
« no previous file with comments | « chromeos/dbus/shill_ipconfig_client_stub.h ('k') | chromeos/dbus/shill_manager_client_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698