| Index: chromeos/network/onc/onc_translator_shill_to_onc.cc
|
| diff --git a/chromeos/network/onc/onc_translator_shill_to_onc.cc b/chromeos/network/onc/onc_translator_shill_to_onc.cc
|
| index 7796c2afcbd8b6844e21718cede425c699a1dcd9..c26425a35a1e2debe96d067f232d218c69de66d1 100644
|
| --- a/chromeos/network/onc/onc_translator_shill_to_onc.cc
|
| +++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc
|
| @@ -9,6 +9,7 @@
|
| #include "base/json/json_writer.h"
|
| #include "base/logging.h"
|
| #include "base/macros.h"
|
| +#include "base/memory/ptr_util.h"
|
| #include "base/strings/string_util.h"
|
| #include "base/values.h"
|
| #include "chromeos/network/network_profile_handler.h"
|
| @@ -209,7 +210,7 @@ void ShillToONCTranslator::TranslateOpenVPN() {
|
| std::unique_ptr<base::ListValue> certKUs(new base::ListValue);
|
| certKUs->AppendString(certKU);
|
| onc_object_->SetWithoutPathExpansion(::onc::openvpn::kRemoteCertKU,
|
| - certKUs.release());
|
| + std::move(certKUs));
|
| }
|
|
|
| for (const OncFieldSignature* field_signature = onc_signature_->fields;
|
| @@ -247,7 +248,7 @@ void ShillToONCTranslator::TranslateOpenVPN() {
|
| << GetName();
|
| } else {
|
| onc_object_->SetWithoutPathExpansion(onc_field_name,
|
| - translated.release());
|
| + std::move(translated));
|
| }
|
| } else {
|
| LOG(ERROR) << "Shill property '" << shill_property_name << "' has value "
|
| @@ -586,7 +587,7 @@ void ShillToONCTranslator::TranslateNetworkWithState() {
|
| ConvertProxyConfigToOncProxySettings(std::move(proxy_config_value));
|
| if (proxy_settings) {
|
| onc_object_->SetWithoutPathExpansion(
|
| - ::onc::network_config::kProxySettings, proxy_settings.release());
|
| + ::onc::network_config::kProxySettings, std::move(proxy_settings));
|
| }
|
| }
|
| }
|
| @@ -651,7 +652,8 @@ void ShillToONCTranslator::TranslateAndAddNestedObject(
|
| nested_translator.CreateTranslatedONCObject();
|
| if (nested_object->empty())
|
| return;
|
| - onc_object_->SetWithoutPathExpansion(onc_field_name, nested_object.release());
|
| + onc_object_->SetWithoutPathExpansion(onc_field_name,
|
| + std::move(nested_object));
|
| }
|
|
|
| void ShillToONCTranslator::SetNestedOncValue(
|
| @@ -661,10 +663,12 @@ void ShillToONCTranslator::SetNestedOncValue(
|
| base::DictionaryValue* nested;
|
| if (!onc_object_->GetDictionaryWithoutPathExpansion(onc_dictionary_name,
|
| &nested)) {
|
| - nested = new base::DictionaryValue;
|
| - onc_object_->SetWithoutPathExpansion(onc_dictionary_name, nested);
|
| + onc_object_->SetWithoutPathExpansion(
|
| + onc_dictionary_name, base::MakeUnique<base::DictionaryValue>());
|
| + onc_object_->GetDictionaryWithoutPathExpansion(onc_dictionary_name,
|
| + &nested);
|
| }
|
| - nested->SetWithoutPathExpansion(onc_field_name, value.DeepCopy());
|
| + nested->SetWithoutPathExpansion(onc_field_name, value.CreateDeepCopy());
|
| }
|
|
|
| void ShillToONCTranslator::TranslateAndAddListOfObjects(
|
| @@ -699,7 +703,7 @@ void ShillToONCTranslator::TranslateAndAddListOfObjects(
|
| // If there are no entries in the list, there is no need to expose this field.
|
| if (result->empty())
|
| return;
|
| - onc_object_->SetWithoutPathExpansion(onc_field_name, result.release());
|
| + onc_object_->SetWithoutPathExpansion(onc_field_name, std::move(result));
|
| }
|
|
|
| void ShillToONCTranslator::CopyPropertiesAccordingToSignature() {
|
| @@ -741,7 +745,7 @@ void ShillToONCTranslator::CopyProperty(
|
| }
|
|
|
| onc_object_->SetWithoutPathExpansion(field_signature->onc_field_name,
|
| - shill_value->DeepCopy());
|
| + shill_value->CreateDeepCopy());
|
| }
|
|
|
| void ShillToONCTranslator::TranslateWithTableAndSet(
|
|
|