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

Unified Diff: chromeos/printing/ppd_provider.cc

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: 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
« no previous file with comments | « chromeos/network/shill_property_handler_unittest.cc ('k') | chromeos/system/statistics_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/printing/ppd_provider.cc
diff --git a/chromeos/printing/ppd_provider.cc b/chromeos/printing/ppd_provider.cc
index 37130fc02b61a536952ace5bc62ef4ae09f9b6a5..a6a08c59ec79ca9a5e0938bc4afe1337b072139b 100644
--- a/chromeos/printing/ppd_provider.cc
+++ b/chromeos/printing/ppd_provider.cc
@@ -431,11 +431,11 @@
// This should just be a simple list of locale strings.
std::vector<std::string> available_locales;
bool found_en = false;
- for (const base::Value& entry : *top_list) {
+ for (const std::unique_ptr<base::Value>& entry : *top_list) {
std::string tmp;
// Locales should have at *least* a two-character country code. 100 is an
// arbitrary upper bound for length to protect against extreme bogosity.
- if (!entry.GetAsString(&tmp) || tmp.size() < 2 || tmp.size() > 100) {
+ if (!entry->GetAsString(&tmp) || tmp.size() < 2 || tmp.size() > 100) {
FailQueuedMetadataResolutions(PpdProvider::INTERNAL_ERROR);
return;
}
@@ -603,10 +603,10 @@
result = PpdProvider::NOT_FOUND;
for (const auto& entry : *top_list) {
int device_id;
- const base::ListValue* sub_list;
+ base::ListValue* sub_list;
// Each entry should be a size-2 list with an integer and a string.
- if (!entry.GetAsList(&sub_list) || sub_list->GetSize() != 2 ||
+ if (!entry->GetAsList(&sub_list) || sub_list->GetSize() != 2 ||
!sub_list->GetInteger(0, &device_id) ||
!sub_list->GetString(1, &contents) || device_id < 0 ||
device_id > 0xffff) {
@@ -791,9 +791,9 @@
return PpdProvider::INTERNAL_ERROR;
}
for (const auto& entry : *top_list) {
- const base::ListValue* sub_list;
+ base::ListValue* sub_list;
contents->push_back({});
- if (!entry.GetAsList(&sub_list) || sub_list->GetSize() != 2 ||
+ if (!entry->GetAsList(&sub_list) || sub_list->GetSize() != 2 ||
!sub_list->GetString(0, &contents->back().first) ||
!sub_list->GetString(1, &contents->back().second)) {
contents->clear();
« no previous file with comments | « chromeos/network/shill_property_handler_unittest.cc ('k') | chromeos/system/statistics_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698