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

Unified Diff: chrome/browser/extensions/extension_web_ui.cc

Issue 2000803003: Use std::unique_ptr for base::DictionaryValue and base::ListValue's internal store. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix various builds. Created 4 years, 7 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/extensions/extension_web_ui.cc
diff --git a/chrome/browser/extensions/extension_web_ui.cc b/chrome/browser/extensions/extension_web_ui.cc
index c447ed2ff7a56a704c7294e899cef05d8a4e02fc..06dae536319e928b0756de4657c4c339b9638456 100644
--- a/chrome/browser/extensions/extension_web_ui.cc
+++ b/chrome/browser/extensions/extension_web_ui.cc
@@ -65,7 +65,7 @@ const char kActive[] = "active";
void InitializeOverridesList(base::ListValue* list) {
base::ListValue migrated;
std::set<std::string> seen_entries;
- for (base::Value* val : *list) {
+ for (const auto& val : *list) {
std::unique_ptr<base::DictionaryValue> new_dict(
new base::DictionaryValue());
std::string entry_name;
@@ -96,7 +96,7 @@ void InitializeOverridesList(base::ListValue* list) {
// marks it as active.
void AddOverridesToList(base::ListValue* list,
const std::string& override) {
- for (base::Value* val : *list) {
+ for (const auto& val : *list) {
base::DictionaryValue* dict = nullptr;
std::string entry;
if (!val->GetAsDictionary(&dict) || !dict->GetString(kEntry, &entry)) {
@@ -121,7 +121,7 @@ void AddOverridesToList(base::ListValue* list,
void ValidateOverridesList(const extensions::ExtensionSet* all_extensions,
base::ListValue* list) {
base::ListValue migrated;
- for (base::Value* val : *list) {
+ for (const auto& val : *list) {
base::DictionaryValue* dict = nullptr;
std::string entry;
if (!val->GetAsDictionary(&dict) || !dict->GetString(kEntry, &entry)) {
@@ -176,7 +176,7 @@ bool UpdateOverridesList(base::ListValue* overrides_list,
UpdateBehavior behavior) {
base::ListValue::iterator iter =
std::find_if(overrides_list->begin(), overrides_list->end(),
- [&override_url](const base::Value* value) {
+ [&override_url](const std::unique_ptr<base::Value>& value) {
std::string entry;
const base::DictionaryValue* dict = nullptr;
return value->GetAsDictionary(&dict) &&

Powered by Google App Engine
This is Rietveld 408576698