OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chromeos/dbus/shill_ipconfig_client_stub.h" | 5 #include "chromeos/dbus/shill_ipconfig_client_stub.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 const VoidDBusMethodCallback& callback) { | 66 const VoidDBusMethodCallback& callback) { |
67 if (callback.is_null()) | 67 if (callback.is_null()) |
68 return; | 68 return; |
69 base::DictionaryValue* dict = NULL; | 69 base::DictionaryValue* dict = NULL; |
70 if (ipconfigs_.GetDictionaryWithoutPathExpansion(ipconfig_path.value(), | 70 if (ipconfigs_.GetDictionaryWithoutPathExpansion(ipconfig_path.value(), |
71 &dict)) { | 71 &dict)) { |
72 // Update existing ip config stub object's properties. | 72 // Update existing ip config stub object's properties. |
73 dict->SetWithoutPathExpansion(name, value.DeepCopy()); | 73 dict->SetWithoutPathExpansion(name, value.DeepCopy()); |
74 } else { | 74 } else { |
75 // Create a new stub ipconfig object, and update its properties. | 75 // Create a new stub ipconfig object, and update its properties. |
76 DictionaryValue* dvalue = new DictionaryValue; | 76 base::DictionaryValue* dvalue = new base::DictionaryValue; |
77 dvalue->SetWithoutPathExpansion(name, value.DeepCopy()); | 77 dvalue->SetWithoutPathExpansion(name, value.DeepCopy()); |
78 ipconfigs_.SetWithoutPathExpansion(ipconfig_path.value(), | 78 ipconfigs_.SetWithoutPathExpansion(ipconfig_path.value(), |
79 dvalue); | 79 dvalue); |
80 } | 80 } |
81 base::MessageLoop::current()->PostTask( | 81 base::MessageLoop::current()->PostTask( |
82 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS)); | 82 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS)); |
83 } | 83 } |
84 | 84 |
85 void ShillIPConfigClientStub::ClearProperty( | 85 void ShillIPConfigClientStub::ClearProperty( |
86 const dbus::ObjectPath& ipconfig_path, | 86 const dbus::ObjectPath& ipconfig_path, |
(...skipping 13 matching lines...) Expand all Loading... |
100 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS)); | 100 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS)); |
101 } | 101 } |
102 | 102 |
103 void ShillIPConfigClientStub::PassProperties( | 103 void ShillIPConfigClientStub::PassProperties( |
104 const base::DictionaryValue* values, | 104 const base::DictionaryValue* values, |
105 const DictionaryValueCallback& callback) const { | 105 const DictionaryValueCallback& callback) const { |
106 callback.Run(DBUS_METHOD_CALL_SUCCESS, *values); | 106 callback.Run(DBUS_METHOD_CALL_SUCCESS, *values); |
107 } | 107 } |
108 | 108 |
109 } // namespace chromeos | 109 } // namespace chromeos |
OLD | NEW |