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

Unified Diff: chrome/browser/permissions/chooser_context_base.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: More fixes 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
« no previous file with comments | « chrome/browser/metrics/plugin_metrics_provider.cc ('k') | chrome/browser/plugins/plugin_prefs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/permissions/chooser_context_base.cc
diff --git a/chrome/browser/permissions/chooser_context_base.cc b/chrome/browser/permissions/chooser_context_base.cc
index af7b37e5d9cfa23d26b65c776a4fd58ebdc96000..6ccdc07dc0275e243a02dd58b8ed3058315d7336 100644
--- a/chrome/browser/permissions/chooser_context_base.cc
+++ b/chrome/browser/permissions/chooser_context_base.cc
@@ -55,12 +55,8 @@ ChooserContextBase::GetGrantedObjects(const GURL& requesting_origin,
if (!object_list)
return results;
- for (base::ListValue::iterator it = object_list->begin();
- it != object_list->end(); ++it) {
+ for (auto& object : *object_list) {
// Steal ownership of |object| from |object_list|.
- std::unique_ptr<base::Value> object(*it);
- *it = nullptr;
-
std::unique_ptr<base::DictionaryValue> object_dict =
base::DictionaryValue::From(std::move(object));
if (object_dict && IsValidObject(*object_dict))
@@ -88,7 +84,7 @@ ChooserContextBase::GetAllGrantedObjects() {
if (!setting->GetList(kObjectListKey, &object_list))
continue;
- for (base::Value* object : *object_list) {
+ for (const auto& object : *object_list) {
base::DictionaryValue* object_dict;
if (!object->GetAsDictionary(&object_dict) ||
!IsValidObject(*object_dict)) {
« no previous file with comments | « chrome/browser/metrics/plugin_metrics_provider.cc ('k') | chrome/browser/plugins/plugin_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698