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

Unified Diff: chromeos/network/onc/onc_utils.cc

Issue 2785883003: Use unique_ptr<DictionaryValue> in ProxyConfigDictionary (Closed)
Patch Set: one constructor Created 3 years, 9 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 | « chrome/browser/prefs/proxy_policy_unittest.cc ('k') | chromeos/network/proxy/proxy_config_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/onc/onc_utils.cc
diff --git a/chromeos/network/onc/onc_utils.cc b/chromeos/network/onc/onc_utils.cc
index a2c2d32545d483357cd0bebbabb310a5ac99cdc6..c6fe451c3716d13daa16601ad883fb55c829ada3 100644
--- a/chromeos/network/onc/onc_utils.cc
+++ b/chromeos/network/onc/onc_utils.cc
@@ -924,16 +924,16 @@ std::unique_ptr<base::DictionaryValue> ConvertOncProxySettingsToProxyConfig(
std::unique_ptr<base::DictionaryValue> proxy_dict;
if (type == ::onc::proxy::kDirect) {
- proxy_dict.reset(ProxyConfigDictionary::CreateDirect());
+ proxy_dict = ProxyConfigDictionary::CreateDirect();
} else if (type == ::onc::proxy::kWPAD) {
- proxy_dict.reset(ProxyConfigDictionary::CreateAutoDetect());
+ proxy_dict = ProxyConfigDictionary::CreateAutoDetect();
} else if (type == ::onc::proxy::kPAC) {
std::string pac_url;
onc_proxy_settings.GetStringWithoutPathExpansion(::onc::proxy::kPAC,
&pac_url);
GURL url(url_formatter::FixupURL(pac_url, std::string()));
- proxy_dict.reset(ProxyConfigDictionary::CreatePacScript(
- url.is_valid() ? url.spec() : std::string(), false));
+ proxy_dict = ProxyConfigDictionary::CreatePacScript(
+ url.is_valid() ? url.spec() : std::string(), false);
} else if (type == ::onc::proxy::kManual) {
const base::DictionaryValue* manual_dict = nullptr;
onc_proxy_settings.GetDictionaryWithoutPathExpansion(::onc::proxy::kManual,
@@ -953,8 +953,8 @@ std::unique_ptr<base::DictionaryValue> ConvertOncProxySettingsToProxyConfig(
bypass_rules.AssignFrom(
ConvertOncExcludeDomainsToBypassRules(*exclude_domains));
}
- proxy_dict.reset(ProxyConfigDictionary::CreateFixedServers(
- manual_spec, bypass_rules.ToString()));
+ proxy_dict = ProxyConfigDictionary::CreateFixedServers(
+ manual_spec, bypass_rules.ToString());
} else {
NOTREACHED();
}
@@ -964,8 +964,8 @@ std::unique_ptr<base::DictionaryValue> ConvertOncProxySettingsToProxyConfig(
std::unique_ptr<base::DictionaryValue> ConvertProxyConfigToOncProxySettings(
const base::DictionaryValue& proxy_config_value) {
// Create a ProxyConfigDictionary from the DictionaryValue.
- std::unique_ptr<ProxyConfigDictionary> proxy_config(
- new ProxyConfigDictionary(&proxy_config_value));
+ auto proxy_config =
+ base::MakeUnique<ProxyConfigDictionary>(&proxy_config_value);
stevenjb 2017/03/30 20:39:54 We should convert this to take a unique_ptr; takin
vabr (Chromium) 2017/03/30 20:55:06 Done.
// Create the result DictionaryValue and populate it.
std::unique_ptr<base::DictionaryValue> proxy_settings(
« no previous file with comments | « chrome/browser/prefs/proxy_policy_unittest.cc ('k') | chromeos/network/proxy/proxy_config_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698