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

Unified Diff: chromeos/dbus/fake_shill_ipconfig_client.cc

Issue 2843813002: Remove SetWithoutPathExpansion (Closed)
Patch Set: Fix CrOS Error Created 3 years, 8 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/fake_shill_device_client.cc ('k') | chromeos/dbus/fake_shill_manager_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chromeos/dbus/fake_shill_device_client.cc ('k') | chromeos/dbus/fake_shill_manager_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698