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_service_client.cc

Issue 2871653002: Remove raw base::DictionaryValue::SetWithoutPathExpansion in //chromeos (Closed)
Patch Set: Minor Fix Created 3 years, 7 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_profile_client.cc ('k') | chromeos/dbus/gsm_sms_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/fake_shill_service_client.cc
diff --git a/chromeos/dbus/fake_shill_service_client.cc b/chromeos/dbus/fake_shill_service_client.cc
index c3b6aa3c64d7e6f673a73eb10baf0a8f5bf60454..7075c383f3ed7e5c86ca4ea2d168067b3690cfea 100644
--- a/chromeos/dbus/fake_shill_service_client.cc
+++ b/chromeos/dbus/fake_shill_service_client.cc
@@ -4,6 +4,8 @@
#include "chromeos/dbus/fake_shill_service_client.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/location.h"
@@ -320,8 +322,8 @@ void FakeShillServiceClient::AddServiceWithIPConfig(
}
if (!ipconfig_path.empty()) {
- properties->SetWithoutPathExpansion(shill::kIPConfigProperty,
- new base::Value(ipconfig_path));
+ properties->SetStringWithoutPathExpansion(shill::kIPConfigProperty,
+ ipconfig_path);
}
DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()->
@@ -412,9 +414,12 @@ bool FakeShillServiceClient::SetServiceProperty(const std::string& service_path,
std::string key = property;
if (base::StartsWith(property, "Provider.", case_sensitive))
key = property.substr(strlen("Provider."));
- base::DictionaryValue* provider = new base::DictionaryValue;
- provider->SetWithoutPathExpansion(key, value.DeepCopy());
- new_properties.SetWithoutPathExpansion(shill::kProviderProperty, provider);
+ base::DictionaryValue* provider =
+ new_properties.SetDictionaryWithoutPathExpansion(
+ shill::kProviderProperty,
+ base::MakeUnique<base::DictionaryValue>());
+ provider->SetWithoutPathExpansion(key,
+ base::MakeUnique<base::Value>(value));
changed_property = shill::kProviderProperty;
} else if (value.GetType() == base::Value::Type::DICTIONARY) {
const base::DictionaryValue* new_dict = NULL;
@@ -426,13 +431,15 @@ bool FakeShillServiceClient::SetServiceProperty(const std::string& service_path,
cur_value->GetAsDictionary(&cur_dict)) {
cur_dict->Clear();
cur_dict->MergeDictionary(new_dict);
- new_properties.SetWithoutPathExpansion(property, cur_value.release());
+ new_properties.SetWithoutPathExpansion(property, std::move(cur_value));
} else {
- new_properties.SetWithoutPathExpansion(property, value.DeepCopy());
+ new_properties.SetWithoutPathExpansion(
+ property, base::MakeUnique<base::Value>(value));
}
changed_property = property;
} else {
- new_properties.SetWithoutPathExpansion(property, value.DeepCopy());
+ new_properties.SetWithoutPathExpansion(
+ property, base::MakeUnique<base::Value>(value));
changed_property = property;
}
@@ -567,8 +574,8 @@ void FakeShillServiceClient::SetOtherServicesOffline(
properties->GetString(shill::kTypeProperty, &type);
if (type != service_type)
continue;
- properties->SetWithoutPathExpansion(shill::kStateProperty,
- new base::Value(shill::kStateIdle));
+ properties->SetStringWithoutPathExpansion(shill::kStateProperty,
+ shill::kStateIdle);
}
}
« no previous file with comments | « chromeos/dbus/fake_shill_profile_client.cc ('k') | chromeos/dbus/gsm_sms_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698