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

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: AddServiceWithIPConfig 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
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..2bb8712613ef67d603a72fe7b4c488cbe132fa5b 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 (!stub_ipconfig_.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 (!stub_ipconfig_.GetDictionaryWithoutPathExpansion(ipconfig_path.value(),
pneubeck (no reviews) 2013/03/28 10:37:54 swap cases.
gauravsh 2013/03/28 18:48:54 Curious, Why?
stevenjb 2013/03/28 19:27:13 Usually the positive test should proceed the negat
gauravsh 2013/03/28 19:54:23 Done.
+ &dict)) {
+ // Create a new stub ipconfig object, and update its properties.
+ DictionaryValue* dvalue = new DictionaryValue;
+ dvalue->SetWithoutPathExpansion(name, value.DeepCopy());
+ stub_ipconfig_.SetWithoutPathExpansion(ipconfig_path.value(),
+ dvalue);
+ } else {
+ // Update existing ip config stub object's properties.
+ dict->SetWithoutPathExpansion(name, value.DeepCopy());
+ }
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

Powered by Google App Engine
This is Rietveld 408576698