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

Unified Diff: chromeos/dbus/fake_shill_service_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_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..1aaa76e35cb7a14bddaa3209ad109b94cdc68899 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 = nullptr;
+ provider->SetWithoutPathExpansion(key, value.CreateDeepCopy());
+ new_properties.SetWithoutPathExpansion(
+ shill::kProviderProperty, base::MakeUnique<base::DictionaryValue>());
+ new_properties.GetDictionaryWithoutPathExpansion(shill::kProviderProperty,
+ &provider);
changed_property = shill::kProviderProperty;
} else if (value.GetType() == base::Value::Type::DICTIONARY) {
const base::DictionaryValue* new_dict = NULL;
@@ -426,13 +431,13 @@ 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, value.CreateDeepCopy());
}
changed_property = property;
} else {
- new_properties.SetWithoutPathExpansion(property, value.DeepCopy());
+ new_properties.SetWithoutPathExpansion(property, value.CreateDeepCopy());
changed_property = property;
}
@@ -567,8 +572,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