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

Unified Diff: extensions/browser/verified_contents.cc

Issue 2740143002: Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Comment Updates 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
Index: extensions/browser/verified_contents.cc
diff --git a/extensions/browser/verified_contents.cc b/extensions/browser/verified_contents.cc
index 29404843c8e0bdc3cbefd31622f85fcacf6ac3d8..9ef8864b492c6d52904c849d2464d8f947b741d2 100644
--- a/extensions/browser/verified_contents.cc
+++ b/extensions/browser/verified_contents.cc
@@ -43,12 +43,12 @@ const char kWebstoreKId[] = "webstore";
// Helper function to iterate over a list of dictionaries, returning the
// dictionary that has |key| -> |value| in it, if any, or NULL.
-DictionaryValue* FindDictionaryWithValue(const ListValue* list,
- const std::string& key,
- const std::string& value) {
+const DictionaryValue* FindDictionaryWithValue(const ListValue* list,
+ const std::string& key,
+ const std::string& value) {
for (const auto& i : *list) {
- DictionaryValue* dictionary;
- if (!i->GetAsDictionary(&dictionary))
+ const DictionaryValue* dictionary;
+ if (!i.GetAsDictionary(&dictionary))
continue;
std::string found_value;
if (dictionary->GetString(key, &found_value) && found_value == value)
@@ -250,20 +250,20 @@ bool VerifiedContents::GetPayload(const base::FilePath& path,
// }
// }
// ]
- DictionaryValue* dictionary =
+ const DictionaryValue* dictionary =
FindDictionaryWithValue(top_list, kDescriptionKey, kTreeHashPerFile);
- DictionaryValue* signed_content = NULL;
+ const DictionaryValue* signed_content = NULL;
if (!dictionary ||
!dictionary->GetDictionaryWithoutPathExpansion(kSignedContentKey,
&signed_content)) {
return false;
}
- ListValue* signatures = NULL;
+ const ListValue* signatures = NULL;
if (!signed_content->GetList(kSignaturesKey, &signatures))
return false;
- DictionaryValue* signature_dict =
+ const DictionaryValue* signature_dict =
FindDictionaryWithValue(signatures, kHeaderKidKey, kWebstoreKId);
if (!signature_dict)
return false;

Powered by Google App Engine
This is Rietveld 408576698