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

Unified Diff: chrome/browser/extensions/extension_prefs.cc

Issue 8501036: Convert extensions code using DictionaryValue::key_iterator and (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 9 years, 1 month 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 | « no previous file | chrome/browser/extensions/settings/syncable_settings_storage.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_prefs.cc
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index 92412645bc76dc65f1c8531c4d385367bb72c0f3..ebe337cc0b60403f3c82af43d9fae8d2f6495a9b 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -1679,25 +1679,17 @@ void ExtensionPrefs::InitPrefStore(bool extensions_disabled) {
// Set regular extension controlled prefs.
const DictionaryValue* prefs = GetExtensionControlledPrefs(*ext_id, false);
- for (DictionaryValue::key_iterator i = prefs->begin_keys();
- i != prefs->end_keys(); ++i) {
- Value* value;
- if (!prefs->GetWithoutPathExpansion(*i, &value))
- continue;
+ for (DictionaryValue::Iterator i(*prefs); i.HasNext(); i.Advance()) {
extension_pref_value_map_->SetExtensionPref(
- *ext_id, *i, kExtensionPrefsScopeRegular, value->DeepCopy());
+ *ext_id, i.key(), kExtensionPrefsScopeRegular, i.value().DeepCopy());
}
// Set incognito extension controlled prefs.
prefs = GetExtensionControlledPrefs(*ext_id, true);
- for (DictionaryValue::key_iterator i = prefs->begin_keys();
- i != prefs->end_keys(); ++i) {
- Value* value;
- if (!prefs->GetWithoutPathExpansion(*i, &value))
- continue;
+ for (DictionaryValue::Iterator i(*prefs); i.HasNext(); i.Advance()) {
extension_pref_value_map_->SetExtensionPref(
- *ext_id, *i, kExtensionPrefsScopeIncognitoPersistent,
- value->DeepCopy());
+ *ext_id, i.key(), kExtensionPrefsScopeIncognitoPersistent,
+ i.value().DeepCopy());
}
// Set content settings.
« no previous file with comments | « no previous file | chrome/browser/extensions/settings/syncable_settings_storage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698