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

Unified Diff: chrome/browser/chromeos/proxy_cros_settings_parser.cc

Issue 2812953002: Stop passing raw pointers to base::Value API in c/b/ui (Closed)
Patch Set: No ListValue::SetDouble 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
Index: chrome/browser/chromeos/proxy_cros_settings_parser.cc
diff --git a/chrome/browser/chromeos/proxy_cros_settings_parser.cc b/chrome/browser/chromeos/proxy_cros_settings_parser.cc
index be6d08fefc4689a5ecc195d6971e3397b2498875..baee7de33fdebe64f249aadf68bdc88331eb86af 100644
--- a/chrome/browser/chromeos/proxy_cros_settings_parser.cc
+++ b/chrome/browser/chromeos/proxy_cros_settings_parser.cc
@@ -282,12 +282,10 @@ void SetProxyPrefValue(const std::string& network_guid,
config_service->SetProxyConfig(network_guid, config);
}
-// TODO(crbug.com/697817): Change |out_value| to be
-// std::unique_ptr<base::Value>*.
bool GetProxyPrefValue(const std::string& network_guid,
const std::string& path,
UIProxyConfigService* config_service,
- base::Value** out_value) {
+ std::unique_ptr<base::Value>* out_value) {
std::string controlled_by;
std::unique_ptr<base::Value> data;
UIProxyConfig config;
@@ -358,12 +356,12 @@ bool GetProxyPrefValue(const std::string& network_guid,
list->AppendString(rule->ToString());
data = std::move(list);
} else {
- *out_value = NULL;
+ out_value->reset();
return false;
}
// Decorate pref value as CoreOptionsHandler::CreateValueForPref() does.
- base::DictionaryValue* dict = new base::DictionaryValue;
+ auto dict = base::MakeUnique<base::DictionaryValue>();
if (!data)
data = base::MakeUnique<base::Value>(base::Value::Type::STRING);
dict->Set("value", std::move(data));
@@ -374,7 +372,7 @@ bool GetProxyPrefValue(const std::string& network_guid,
} else {
dict->SetBoolean("disabled", false);
}
- *out_value = dict;
+ *out_value = std::move(dict);
return true;
}
« no previous file with comments | « chrome/browser/chromeos/proxy_cros_settings_parser.h ('k') | chrome/browser/ui/app_list/search/common/webservice_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698