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

Unified Diff: chrome/browser/media_galleries/media_galleries_preferences.cc

Issue 2740143002: Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Rebase 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/media_galleries/media_galleries_preferences.cc
diff --git a/chrome/browser/media_galleries/media_galleries_preferences.cc b/chrome/browser/media_galleries/media_galleries_preferences.cc
index db859f57d8e6927312b692c68f52d49409115ccc..649e3102995d153e16aa5c2047156d6d4f3d6277 100644
--- a/chrome/browser/media_galleries/media_galleries_preferences.cc
+++ b/chrome/browser/media_galleries/media_galleries_preferences.cc
@@ -621,7 +621,7 @@ bool MediaGalleriesPreferences::UpdateDeviceIDForSingletonType(
iter != list->end(); ++iter) {
// All of these calls should succeed, but preferences file can be corrupt.
base::DictionaryValue* dict;
- if (!(*iter)->GetAsDictionary(&dict))
+ if (!iter->GetAsDictionary(&dict))
continue;
std::string this_device_id;
if (!dict->GetString(kMediaGalleriesDeviceIdKey, &this_device_id))
@@ -713,7 +713,7 @@ void MediaGalleriesPreferences::InitFromPrefs() {
for (base::ListValue::const_iterator it = list->begin();
it != list->end(); ++it) {
const base::DictionaryValue* dict = NULL;
- if (!(*it)->GetAsDictionary(&dict))
+ if (!it->GetAsDictionary(&dict))
continue;
MediaGalleryPrefInfo gallery_info;
@@ -957,13 +957,11 @@ MediaGalleryPrefId MediaGalleriesPreferences::AddOrUpdateGalleryInternal(
new ListPrefUpdate(prefs, prefs::kMediaGalleriesRememberedGalleries));
base::ListValue* list = update->Get();
- for (base::ListValue::const_iterator list_iter = list->begin();
- list_iter != list->end();
- ++list_iter) {
+ for (base::ListValue::iterator list_iter = list->begin();
+ list_iter != list->end(); ++list_iter) {
base::DictionaryValue* dict;
MediaGalleryPrefId iter_id;
- if ((*list_iter)->GetAsDictionary(&dict) &&
- GetPrefId(*dict, &iter_id) &&
+ if (list_iter->GetAsDictionary(&dict) && GetPrefId(*dict, &iter_id) &&
*pref_id_it == iter_id) {
if (update_gallery_type)
dict->SetString(kMediaGalleriesTypeKey, TypeToStringValue(new_type));
@@ -1058,7 +1056,7 @@ void MediaGalleriesPreferences::UpdateDefaultGalleriesPaths() {
base::DictionaryValue* dict;
MediaGalleryPrefId pref_id;
- if (!((*iter)->GetAsDictionary(&dict) && GetPrefId(*dict, &pref_id)))
+ if (!(iter->GetAsDictionary(&dict) && GetPrefId(*dict, &pref_id)))
continue;
std::string default_gallery_type_string;
@@ -1155,7 +1153,7 @@ void MediaGalleriesPreferences::EraseOrBlacklistGalleryById(
iter != list->end(); ++iter) {
base::DictionaryValue* dict;
MediaGalleryPrefId iter_id;
- if ((*iter)->GetAsDictionary(&dict) && GetPrefId(*dict, &iter_id) &&
+ if (iter->GetAsDictionary(&dict) && GetPrefId(*dict, &iter_id) &&
id == iter_id) {
RemoveGalleryPermissionsFromPrefs(id);
MediaGalleryPrefInfo::Type type;
@@ -1333,7 +1331,7 @@ bool MediaGalleriesPreferences::SetGalleryPermissionInPrefs(
for (base::ListValue::iterator iter = permissions->begin();
iter != permissions->end(); ++iter) {
base::DictionaryValue* dict = NULL;
- if (!(*iter)->GetAsDictionary(&dict))
+ if (!iter->GetAsDictionary(&dict))
continue;
MediaGalleryPermission perm;
if (!GetMediaGalleryPermissionFromDictionary(dict, &perm))
@@ -1370,7 +1368,7 @@ bool MediaGalleriesPreferences::UnsetGalleryPermissionInPrefs(
for (base::ListValue::iterator iter = permissions->begin();
iter != permissions->end(); ++iter) {
const base::DictionaryValue* dict = NULL;
- if (!(*iter)->GetAsDictionary(&dict))
+ if (!iter->GetAsDictionary(&dict))
continue;
MediaGalleryPermission perm;
if (!GetMediaGalleryPermissionFromDictionary(dict, &perm))
@@ -1397,8 +1395,8 @@ MediaGalleriesPreferences::GetGalleryPermissionsFromPrefs(
for (base::ListValue::const_iterator iter = permissions->begin();
iter != permissions->end(); ++iter) {
- base::DictionaryValue* dict = NULL;
- if (!(*iter)->GetAsDictionary(&dict))
+ const base::DictionaryValue* dict = NULL;
+ if (!iter->GetAsDictionary(&dict))
continue;
MediaGalleryPermission perm;
if (!GetMediaGalleryPermissionFromDictionary(dict, &perm))

Powered by Google App Engine
This is Rietveld 408576698