Chromium Code Reviews| 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 |