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

Unified Diff: chrome/browser/net/http_server_properties_manager.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/extensions/extension_prefs.cc ('k') | chrome/browser/net/transport_security_persister.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/http_server_properties_manager.cc
diff --git a/chrome/browser/net/http_server_properties_manager.cc b/chrome/browser/net/http_server_properties_manager.cc
index 7796e6c829651dc3f3c84b4e0c97314580673a94..0f2de16025bbc7ca505a42ceb7d30941a96f3131 100644
--- a/chrome/browser/net/http_server_properties_manager.cc
+++ b/chrome/browser/net/http_server_properties_manager.cc
@@ -281,11 +281,10 @@ void HttpServerPropertiesManager::UpdateCacheFromPrefsOnUI() {
scoped_ptr<net::AlternateProtocolMap> alternate_protocol_map(
new net::AlternateProtocolMap);
- for (base::DictionaryValue::key_iterator it = servers_dict->begin_keys();
- it != servers_dict->end_keys();
- ++it) {
+ for (base::DictionaryValue::Iterator it(*servers_dict); !it.IsAtEnd();
+ it.Advance()) {
// Get server's host/pair.
- const std::string& server_str = *it;
+ const std::string& server_str = it.key();
net::HostPortPair server = net::HostPortPair::FromString(server_str);
if (server.host().empty()) {
DVLOG(1) << "Malformed http_server_properties for server: " << server_str;
@@ -294,8 +293,7 @@ void HttpServerPropertiesManager::UpdateCacheFromPrefsOnUI() {
}
const base::DictionaryValue* server_pref_dict = NULL;
- if (!servers_dict->GetDictionaryWithoutPathExpansion(
- server_str, &server_pref_dict)) {
+ if (!it.value().GetAsDictionary(&server_pref_dict)) {
DVLOG(1) << "Malformed http_server_properties server: " << server_str;
detected_corrupted_prefs = true;
continue;
@@ -315,10 +313,9 @@ void HttpServerPropertiesManager::UpdateCacheFromPrefsOnUI() {
if (server_pref_dict->GetDictionaryWithoutPathExpansion(
"settings", &spdy_settings_dict)) {
net::SettingsMap settings_map;
- for (base::DictionaryValue::key_iterator dict_it =
- spdy_settings_dict->begin_keys();
- dict_it != spdy_settings_dict->end_keys(); ++dict_it) {
- const std::string& id_str = *dict_it;
+ for (base::DictionaryValue::Iterator dict_it(*spdy_settings_dict);
+ !dict_it.IsAtEnd(); dict_it.Advance()) {
+ const std::string& id_str = dict_it.key();
int id = 0;
if (!base::StringToInt(id_str, &id)) {
DVLOG(1) << "Malformed id in SpdySettings for server: " <<
@@ -327,8 +324,7 @@ void HttpServerPropertiesManager::UpdateCacheFromPrefsOnUI() {
continue;
}
int value = 0;
- if (!spdy_settings_dict->GetIntegerWithoutPathExpansion(id_str,
- &value)) {
+ if (!dict_it.value().GetAsInteger(&value)) {
DVLOG(1) << "Malformed value in SpdySettings for server: " <<
server_str;
NOTREACHED();
« no previous file with comments | « chrome/browser/extensions/extension_prefs.cc ('k') | chrome/browser/net/transport_security_persister.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698