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

Unified Diff: chromeos/dbus/fake_shill_manager_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_manager_client.h ('k') | chromeos/dbus/fake_shill_profile_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/fake_shill_manager_client.cc
diff --git a/chromeos/dbus/fake_shill_manager_client.cc b/chromeos/dbus/fake_shill_manager_client.cc
index 9a1029b8906468bd77472f4013d21b81707d62d8..bbea7ead205dcb31ac0cca072bb8c316a138e8ad 100644
--- a/chromeos/dbus/fake_shill_manager_client.cc
+++ b/chromeos/dbus/fake_shill_manager_client.cc
@@ -185,7 +185,7 @@ void FakeShillManagerClient::SetProperty(const std::string& name,
const base::Closure& callback,
const ErrorCallback& error_callback) {
VLOG(2) << "SetProperty: " << name;
- stub_properties_.SetWithoutPathExpansion(name, value.DeepCopy());
+ stub_properties_.SetWithoutPathExpansion(name, value.CreateDeepCopy());
CallNotifyObserversPropertyChanged(name);
base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, callback);
}
@@ -454,8 +454,9 @@ void FakeShillManagerClient::AddGeoNetwork(
base::ListValue* list_value = NULL;
if (!stub_geo_networks_.GetListWithoutPathExpansion(technology,
&list_value)) {
- list_value = new base::ListValue;
- stub_geo_networks_.SetWithoutPathExpansion(technology, list_value);
+ stub_geo_networks_.SetWithoutPathExpansion(
+ technology, base::MakeUnique<base::ListValue>());
+ stub_geo_networks_.GetListWithoutPathExpansion(technology, &list_value);
}
list_value->Append(network.CreateDeepCopy());
}
@@ -976,10 +977,10 @@ void FakeShillManagerClient::NotifyObserversPropertyChanged(
base::ListValue* FakeShillManagerClient::GetListProperty(
const std::string& property) {
base::ListValue* list_property = NULL;
- if (!stub_properties_.GetListWithoutPathExpansion(
- property, &list_property)) {
- list_property = new base::ListValue;
- stub_properties_.SetWithoutPathExpansion(property, list_property);
+ if (!stub_properties_.GetListWithoutPathExpansion(property, &list_property)) {
+ stub_properties_.SetWithoutPathExpansion(
+ property, base::MakeUnique<base::ListValue>());
+ stub_properties_.GetListWithoutPathExpansion(property, &list_property);
}
return list_property;
}
@@ -1017,9 +1018,9 @@ void FakeShillManagerClient::SetTechnologyEnabled(
SortManagerServices(true);
}
-base::ListValue* FakeShillManagerClient::GetEnabledServiceList(
+std::unique_ptr<base::ListValue> FakeShillManagerClient::GetEnabledServiceList(
const std::string& property) const {
- base::ListValue* new_service_list = new base::ListValue;
+ auto new_service_list = base::MakeUnique<base::ListValue>();
const base::ListValue* service_list;
if (stub_properties_.GetListWithoutPathExpansion(property, &service_list)) {
ShillServiceClient::TestInterface* service_client =
« no previous file with comments | « chromeos/dbus/fake_shill_manager_client.h ('k') | chromeos/dbus/fake_shill_profile_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698