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

Unified Diff: chrome/browser/net/predictor.cc

Issue 2823073003: Make Use of Value::GetList API
Patch Set: Further Usages 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/net/predictor.cc
diff --git a/chrome/browser/net/predictor.cc b/chrome/browser/net/predictor.cc
index 04a7ec424755251c1665b05010142ccdded3b0d3..55abb0daef794a0976023af884540b7947bdb8be 100644
--- a/chrome/browser/net/predictor.cc
+++ b/chrome/browser/net/predictor.cc
@@ -560,12 +560,14 @@ void Predictor::DeserializeReferrers(const base::ListValue& referral_list) {
if (referral_list.GetSize() > 0 &&
referral_list.GetInteger(0, &format_version) &&
format_version == kPredictorReferrerVersion) {
+ const auto& list = referral_list.base::Value::GetList();
for (size_t i = 1; i < referral_list.GetSize(); ++i) {
- const base::ListValue* motivator;
- if (!referral_list.GetList(i, &motivator)) {
+ if (!list[i].is_list()) {
NOTREACHED();
return;
}
+ const base::ListValue* motivator =
+ static_cast<const base::ListValue*>(&list[i]);
std::string motivating_url_spec;
if (!motivator->GetString(0, &motivating_url_spec)) {
NOTREACHED();
« no previous file with comments | « chrome/browser/extensions/menu_manager.cc ('k') | chrome/browser/ui/views/payments/shipping_address_editor_view_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698