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

Unified Diff: chrome/browser/profiles/profile_info_cache.cc

Issue 12601006: Removing base::DictionaryValue::key_iterator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initial patch. Created 7 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
« no previous file with comments | « chrome/browser/profiles/profile_impl.cc ('k') | chrome/test/webdriver/webdriver_capabilities_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_info_cache.cc
diff --git a/chrome/browser/profiles/profile_info_cache.cc b/chrome/browser/profiles/profile_info_cache.cc
index bccb8e6cfe9f4daa9a7b275e0eee67ac2dec1cc7..8770f10089b4c958432f57e78cc94683998195fe 100644
--- a/chrome/browser/profiles/profile_info_cache.cc
+++ b/chrome/browser/profiles/profile_info_cache.cc
@@ -176,14 +176,12 @@ ProfileInfoCache::ProfileInfoCache(PrefService* prefs,
// Populate the cache
const DictionaryValue* cache =
prefs_->GetDictionary(prefs::kProfileInfoCache);
- for (DictionaryValue::key_iterator it = cache->begin_keys();
- it != cache->end_keys(); ++it) {
- std::string key = *it;
+ for (DictionaryValue::Iterator it(*cache); !it.IsAtEnd(); it.Advance()) {
const DictionaryValue* info = NULL;
- cache->GetDictionary(key, &info);
+ it.value().GetAsDictionary(&info);
string16 name;
info->GetString(kNameKey, &name);
- sorted_keys_.insert(FindPositionForProfile(key, name), key);
+ sorted_keys_.insert(FindPositionForProfile(it.key(), name), it.key());
}
}
@@ -813,11 +811,10 @@ std::vector<string16> ProfileInfoCache::GetProfileNames() {
const DictionaryValue* cache = local_state->GetDictionary(
prefs::kProfileInfoCache);
string16 name;
- for (base::DictionaryValue::key_iterator it = cache->begin_keys();
- it != cache->end_keys();
- ++it) {
+ for (base::DictionaryValue::Iterator it(*cache); !it.IsAtEnd();
+ it.Advance()) {
const base::DictionaryValue* info = NULL;
- cache->GetDictionary(*it, &info);
+ it.value().GetAsDictionary(&info);
info->GetString(kNameKey, &name);
names.push_back(name);
}
« no previous file with comments | « chrome/browser/profiles/profile_impl.cc ('k') | chrome/test/webdriver/webdriver_capabilities_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698