Index: chromeos/dbus/fake_shill_ipconfig_client.cc |
diff --git a/chromeos/dbus/fake_shill_ipconfig_client.cc b/chromeos/dbus/fake_shill_ipconfig_client.cc |
index 47ae343eb532c305cc63ec1b922219ed7c40c797..553a850809f3ab55979d67a6e4ee11a95d82500c 100644 |
--- a/chromeos/dbus/fake_shill_ipconfig_client.cc |
+++ b/chromeos/dbus/fake_shill_ipconfig_client.cc |
@@ -6,6 +6,7 @@ |
#include "base/bind.h" |
#include "base/location.h" |
+#include "base/memory/ptr_util.h" |
#include "base/single_thread_task_runner.h" |
#include "base/stl_util.h" |
#include "base/threading/thread_task_runner_handle.h" |
@@ -64,13 +65,13 @@ void FakeShillIPConfigClient::SetProperty( |
if (ipconfigs_.GetDictionaryWithoutPathExpansion(ipconfig_path.value(), |
&dict)) { |
// Update existing ip config stub object's properties. |
- dict->SetWithoutPathExpansion(name, value.DeepCopy()); |
+ dict->SetWithoutPathExpansion(name, value.CreateDeepCopy()); |
} else { |
// Create a new stub ipconfig object, and update its properties. |
- base::DictionaryValue* dvalue = new base::DictionaryValue; |
- dvalue->SetWithoutPathExpansion(name, value.DeepCopy()); |
+ auto dvalue = base::MakeUnique<base::DictionaryValue>(); |
+ dvalue->SetWithoutPathExpansion(name, value.CreateDeepCopy()); |
ipconfigs_.SetWithoutPathExpansion(ipconfig_path.value(), |
- dvalue); |
+ std::move(dvalue)); |
} |
base::ThreadTaskRunnerHandle::Get()->PostTask( |
FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS)); |
@@ -100,7 +101,8 @@ FakeShillIPConfigClient::GetTestInterface() { |
void FakeShillIPConfigClient::AddIPConfig( |
const std::string& ip_config_path, |
const base::DictionaryValue& properties) { |
- ipconfigs_.SetWithoutPathExpansion(ip_config_path, properties.DeepCopy()); |
+ ipconfigs_.SetWithoutPathExpansion(ip_config_path, |
+ properties.CreateDeepCopy()); |
} |
// Private methods |