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

Side by Side Diff: chrome/browser/supervised_user/child_accounts/family_info_fetcher.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/supervised_user/child_accounts/family_info_fetcher.h" 5 #include "chrome/browser/supervised_user/child_accounts/family_info_fetcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 } 232 }
233 } 233 }
234 234
235 // static 235 // static
236 bool FamilyInfoFetcher::ParseMembers(const base::ListValue* list, 236 bool FamilyInfoFetcher::ParseMembers(const base::ListValue* list,
237 std::vector<FamilyMember>* members) { 237 std::vector<FamilyMember>* members) {
238 for (base::ListValue::const_iterator it = list->begin(); 238 for (base::ListValue::const_iterator it = list->begin();
239 it != list->end(); 239 it != list->end();
240 it++) { 240 it++) {
241 FamilyMember member; 241 FamilyMember member;
242 base::DictionaryValue* dict = NULL; 242 const base::DictionaryValue* dict = NULL;
243 if (!(*it)->GetAsDictionary(&dict) || !ParseMember(dict, &member)) { 243 if (!it->GetAsDictionary(&dict) || !ParseMember(dict, &member)) {
244 return false; 244 return false;
245 } 245 }
246 members->push_back(member); 246 members->push_back(member);
247 } 247 }
248 return true; 248 return true;
249 } 249 }
250 250
251 // static 251 // static
252 bool FamilyInfoFetcher::ParseMember(const base::DictionaryValue* dict, 252 bool FamilyInfoFetcher::ParseMember(const base::DictionaryValue* dict,
253 FamilyMember* member) { 253 FamilyMember* member) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 consumer_->OnFailure(SERVICE_ERROR); 317 consumer_->OnFailure(SERVICE_ERROR);
318 return; 318 return;
319 } 319 }
320 std::vector<FamilyMember> members; 320 std::vector<FamilyMember> members;
321 if (!ParseMembers(members_list, &members)){ 321 if (!ParseMembers(members_list, &members)){
322 consumer_->OnFailure(SERVICE_ERROR); 322 consumer_->OnFailure(SERVICE_ERROR);
323 return; 323 return;
324 } 324 }
325 consumer_->OnGetFamilyMembersSuccess(members); 325 consumer_->OnGetFamilyMembersSuccess(members);
326 } 326 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698