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

Unified Diff: chromeos/network/onc/onc_translator_onc_to_shill.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/network/onc/onc_merger.cc ('k') | chromeos/network/onc/onc_translator_shill_to_onc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/onc/onc_translator_onc_to_shill.cc
diff --git a/chromeos/network/onc/onc_translator_onc_to_shill.cc b/chromeos/network/onc/onc_translator_onc_to_shill.cc
index 39e75c9a8ff00c81ab1bb75cfcd3929e4020c973..446fa47d28a2828cb16eeedd1c256e2a20f7c366 100644
--- a/chromeos/network/onc/onc_translator_onc_to_shill.cc
+++ b/chromeos/network/onc/onc_translator_onc_to_shill.cc
@@ -288,8 +288,9 @@ void LocalTranslator::TranslateNetworkConfiguration() {
// If either type is set to DHCP, provide an empty dictionary to ensure
// that any unset properties are cleared. Note: if either type is specified,
// the other type defaults to DHCP if not specified.
- shill_dictionary_->SetWithoutPathExpansion(shill::kStaticIPConfigProperty,
- new base::DictionaryValue);
+ shill_dictionary_->SetWithoutPathExpansion(
+ shill::kStaticIPConfigProperty,
+ base::MakeUnique<base::DictionaryValue>());
}
const base::DictionaryValue* proxy_settings = nullptr;
@@ -337,7 +338,7 @@ void LocalTranslator::CopyFieldFromONCToShill(
return;
}
shill_dictionary_->SetWithoutPathExpansion(shill_property_name,
- value->DeepCopy());
+ value->CreateDeepCopy());
}
void LocalTranslator::AddValueAccordingToSignature(
@@ -352,7 +353,7 @@ void LocalTranslator::AddValueAccordingToSignature(
}
shill_dictionary_->SetWithoutPathExpansion(shill_property_name,
- value.release());
+ std::move(value));
}
void LocalTranslator::TranslateWithTableAndSet(
@@ -389,8 +390,10 @@ void TranslateONCHierarchy(const OncValueSignature& signature,
target_shill_dictionary->GetDictionaryWithoutPathExpansion(
*it, &nested_shill_dict);
if (!nested_shill_dict) {
- nested_shill_dict = new base::DictionaryValue;
- target_shill_dictionary->SetWithoutPathExpansion(*it, nested_shill_dict);
+ target_shill_dictionary->SetWithoutPathExpansion(
+ *it, base::MakeUnique<base::DictionaryValue>());
+ target_shill_dictionary->GetDictionaryWithoutPathExpansion(
+ *it, &nested_shill_dict);
}
target_shill_dictionary = nested_shill_dict;
}
« no previous file with comments | « chromeos/network/onc/onc_merger.cc ('k') | chromeos/network/onc/onc_translator_shill_to_onc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698