diff options
author | pneubeck@chromium.org <pneubeck@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-12 09:25:23 +0000 |
---|---|---|
committer | pneubeck@chromium.org <pneubeck@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-12 09:25:23 +0000 |
commit | ee6ba60fd0a4859d62f2651c39425657d95d1d58 (patch) | |
tree | c879fceacac87d5b6bbc6ef47bd5cb74dd17bb35 | |
parent | 4dec840f200451443c05b233c9d800e17355e65c (diff) | |
download | chromium_src-ee6ba60fd0a4859d62f2651c39425657d95d1d58.zip chromium_src-ee6ba60fd0a4859d62f2651c39425657d95d1d58.tar.gz chromium_src-ee6ba60fd0a4859d62f2651c39425657d95d1d58.tar.bz2 |
Remove base::DictionaryValue::HasNext.
BUG=162611
TBR=alexeypa@chromium.org (for remoting/)
Review URL: https://chromiumcodereview.appspot.com/13408007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193888 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/values.h | 3 | ||||
-rw-r--r-- | base/values_unittest.cc | 6 | ||||
-rw-r--r-- | chrome/browser/plugins/plugin_finder.cc | 2 | ||||
-rw-r--r-- | chrome/browser/plugins/plugin_finder_unittest.cc | 2 | ||||
-rw-r--r-- | chrome/browser/policy/policy_loader_mac_unittest.cc | 4 | ||||
-rw-r--r-- | chrome/browser/policy/policy_loader_win_unittest.cc | 8 | ||||
-rw-r--r-- | chrome/browser/policy/preg_parser_win.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc | 2 | ||||
-rw-r--r-- | chrome/browser/value_store/leveldb_value_store.cc | 2 | ||||
-rw-r--r-- | chrome/browser/value_store/testing_value_store.cc | 4 | ||||
-rw-r--r-- | net/test/local_test_server.cc | 2 | ||||
-rw-r--r-- | remoting/host/policy_hack/policy_watcher.cc | 4 | ||||
-rw-r--r-- | remoting/host/policy_hack/policy_watcher_mac.mm | 2 | ||||
-rw-r--r-- | remoting/host/policy_hack/policy_watcher_win.cc | 2 |
14 files changed, 21 insertions, 24 deletions
diff --git a/base/values.h b/base/values.h index ce2f77f..48e411b 100644 --- a/base/values.h +++ b/base/values.h @@ -342,9 +342,6 @@ class BASE_EXPORT DictionaryValue : public Value { public: explicit Iterator(const DictionaryValue& target); - // DEPRECATED: use !IsAtEnd() instead. - bool HasNext() const { return it_ != target_.dictionary_.end(); } - bool IsAtEnd() const { return it_ == target_.dictionary_.end(); } void Advance() { ++it_; } diff --git a/base/values_unittest.cc b/base/values_unittest.cc index bad83fa..b3459ab 100644 --- a/base/values_unittest.cc +++ b/base/values_unittest.cc @@ -740,14 +740,14 @@ TEST(ValuesTest, MergeDictionaryDeepCopy) { TEST(ValuesTest, DictionaryIterator) { DictionaryValue dict; - for (DictionaryValue::Iterator it(dict); it.HasNext(); it.Advance()) { + for (DictionaryValue::Iterator it(dict); !it.IsAtEnd(); it.Advance()) { ADD_FAILURE(); } StringValue value1("value1"); dict.Set("key1", value1.DeepCopy()); bool seen1 = false; - for (DictionaryValue::Iterator it(dict); it.HasNext(); it.Advance()) { + for (DictionaryValue::Iterator it(dict); !it.IsAtEnd(); it.Advance()) { EXPECT_FALSE(seen1); EXPECT_EQ("key1", it.key()); EXPECT_TRUE(value1.Equals(&it.value())); @@ -758,7 +758,7 @@ TEST(ValuesTest, DictionaryIterator) { StringValue value2("value2"); dict.Set("key2", value2.DeepCopy()); bool seen2 = seen1 = false; - for (DictionaryValue::Iterator it(dict); it.HasNext(); it.Advance()) { + for (DictionaryValue::Iterator it(dict); !it.IsAtEnd(); it.Advance()) { if (it.key() == "key1") { EXPECT_FALSE(seen1); EXPECT_TRUE(value1.Equals(&it.value())); diff --git a/chrome/browser/plugins/plugin_finder.cc b/chrome/browser/plugins/plugin_finder.cc index 0070387..8b4c519 100644 --- a/chrome/browser/plugins/plugin_finder.cc +++ b/chrome/browser/plugins/plugin_finder.cc @@ -250,7 +250,7 @@ void PluginFinder::ReinitializePlugins( identifier_plugin_.clear(); for (DictionaryValue::Iterator plugin_it(*plugin_list); - plugin_it.HasNext(); plugin_it.Advance()) { + !plugin_it.IsAtEnd(); plugin_it.Advance()) { const DictionaryValue* plugin = NULL; const std::string& identifier = plugin_it.key(); if (plugin_list->GetDictionaryWithoutPathExpansion(identifier, &plugin)) { diff --git a/chrome/browser/plugins/plugin_finder_unittest.cc b/chrome/browser/plugins/plugin_finder_unittest.cc index ed1ac31..86b9ead 100644 --- a/chrome/browser/plugins/plugin_finder_unittest.cc +++ b/chrome/browser/plugins/plugin_finder_unittest.cc @@ -22,7 +22,7 @@ TEST(PluginFinderTest, JsonSyntax) { EXPECT_EQ(base::Value::TYPE_INTEGER, version->GetType()); for (DictionaryValue::Iterator plugin_it(*plugin_list); - plugin_it.HasNext(); plugin_it.Advance()) { + !plugin_it.IsAtEnd(); plugin_it.Advance()) { const DictionaryValue* plugin = NULL; ASSERT_TRUE(plugin_it.value().GetAsDictionary(&plugin)); std::string dummy_str; diff --git a/chrome/browser/policy/policy_loader_mac_unittest.cc b/chrome/browser/policy/policy_loader_mac_unittest.cc index 0bc3218..a5b1f6a06 100644 --- a/chrome/browser/policy/policy_loader_mac_unittest.cc +++ b/chrome/browser/policy/policy_loader_mac_unittest.cc @@ -72,7 +72,7 @@ CFPropertyListRef CreatePropertyFromValue(const base::Value* value) { &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); for (base::DictionaryValue::Iterator iterator(*dict_value); - iterator.HasNext(); iterator.Advance()) { + !iterator.IsAtEnd(); iterator.Advance()) { // CFDictionaryAddValue() retains both |key| and |value|, so make sure // the references are balanced. ScopedCFTypeRef<CFStringRef> key( @@ -311,7 +311,7 @@ TEST_F(PolicyLoaderMacTest, TestConversions) { // base::Value::TYPE_LIST base::ListValue list; root.Set("emptyl", list.DeepCopy()); - for (base::DictionaryValue::Iterator it(root); it.HasNext(); it.Advance()) + for (base::DictionaryValue::Iterator it(root); !it.IsAtEnd(); it.Advance()) list.Append(it.value().DeepCopy()); EXPECT_EQ(root.size(), list.GetSize()); list.Append(root.DeepCopy()); diff --git a/chrome/browser/policy/policy_loader_win_unittest.cc b/chrome/browser/policy/policy_loader_win_unittest.cc index 00b303b..5193063 100644 --- a/chrome/browser/policy/policy_loader_win_unittest.cc +++ b/chrome/browser/policy/policy_loader_win_unittest.cc @@ -81,7 +81,7 @@ bool InstallValue(const base::Value& value, if (!value.GetAsDictionary(&sub_dict)) return false; for (base::DictionaryValue::Iterator it(*sub_dict); - it.HasNext(); it.Advance()) { + !it.IsAtEnd(); it.Advance()) { if (!InstallValue(it.value(), hive, path + kPathSep + name, UTF8ToUTF16(it.key()))) { return false; @@ -149,7 +149,7 @@ base::DictionaryValue* BuildSchema(const base::Value& value) { if (value.GetAsDictionary(&dict)) { base::DictionaryValue* properties = new base::DictionaryValue(); for (base::DictionaryValue::Iterator it(*dict); - it.HasNext(); it.Advance()) { + !it.IsAtEnd(); it.Advance()) { properties->Set(it.key(), BuildSchema(it.value())); } schema->SetString(schema::kType, "object"); @@ -379,14 +379,14 @@ void TestHarness::Install3rdPartyPolicy(const base::DictionaryValue* policies) { const string16 kPathPrefix = string16(kRegistryMandatorySubKey) + kPathSep + kThirdParty + kPathSep; for (base::DictionaryValue::Iterator domain(*policies); - domain.HasNext(); domain.Advance()) { + !domain.IsAtEnd(); domain.Advance()) { const base::DictionaryValue* components = NULL; if (!domain.value().GetAsDictionary(&components)) { ADD_FAILURE(); continue; } for (base::DictionaryValue::Iterator component(*components); - component.HasNext(); component.Advance()) { + !component.IsAtEnd(); component.Advance()) { const string16 path = string16(kRegistryMandatorySubKey) + kPathSep + kThirdParty + kPathSep + UTF8ToUTF16(domain.key()) + kPathSep + diff --git a/chrome/browser/policy/preg_parser_win.cc b/chrome/browser/policy/preg_parser_win.cc index 60228a7..9963506 100644 --- a/chrome/browser/policy/preg_parser_win.cc +++ b/chrome/browser/policy/preg_parser_win.cc @@ -193,7 +193,7 @@ void HandleRecord(const string16& key_name, } else if (StartsWithASCII(action_trigger, kActionTriggerDelVals, true)) { // Delete all values, but keep keys (i.e. retain dictionary entries). base::DictionaryValue new_dict; - for (base::DictionaryValue::Iterator it(*dict); it.HasNext(); + for (base::DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) { base::DictionaryValue* subdict = NULL; if (dict->GetDictionaryWithoutPathExpansion(it.key(), &subdict)) { diff --git a/chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc b/chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc index 19e6404..1bd75cd 100644 --- a/chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc +++ b/chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc @@ -32,7 +32,7 @@ bool ListMatches(base::ListValue* left_list, const std::string& right_json) { CHECK(left_list->GetDictionary(i, &left_dict)); CHECK(right_list->GetDictionary(i, &right_dict)); for (base::DictionaryValue::Iterator iter(*right_dict); - iter.HasNext(); iter.Advance()) { + !iter.IsAtEnd(); iter.Advance()) { base::Value* left_value = NULL; if (left_dict->HasKey(iter.key()) && left_dict->Get(iter.key(), &left_value) && diff --git a/chrome/browser/value_store/leveldb_value_store.cc b/chrome/browser/value_store/leveldb_value_store.cc index bad05dd..60b7c2e 100644 --- a/chrome/browser/value_store/leveldb_value_store.cc +++ b/chrome/browser/value_store/leveldb_value_store.cc @@ -234,7 +234,7 @@ ValueStore::WriteResult LeveldbValueStore::Set( leveldb::WriteBatch batch; scoped_ptr<ValueStoreChangeList> changes(new ValueStoreChangeList()); - for (DictionaryValue::Iterator it(settings); it.HasNext(); it.Advance()) { + for (DictionaryValue::Iterator it(settings); !it.IsAtEnd(); it.Advance()) { error = AddToBatch(options, it.key(), it.value(), &batch, changes.get()); if (!error.empty()) { return WriteFailureForKey("find changes to set multiple items", diff --git a/chrome/browser/value_store/testing_value_store.cc b/chrome/browser/value_store/testing_value_store.cc index 9e0c42f..e226e80 100644 --- a/chrome/browser/value_store/testing_value_store.cc +++ b/chrome/browser/value_store/testing_value_store.cc @@ -99,7 +99,7 @@ ValueStore::WriteResult TestingValueStore::Set( } scoped_ptr<ValueStoreChangeList> changes(new ValueStoreChangeList()); - for (DictionaryValue::Iterator it(settings); it.HasNext(); it.Advance()) { + for (DictionaryValue::Iterator it(settings); !it.IsAtEnd(); it.Advance()) { Value* old_value = NULL; if (!storage_.GetWithoutPathExpansion(it.key(), &old_value) || !old_value->Equals(&it.value())) { @@ -139,7 +139,7 @@ ValueStore::WriteResult TestingValueStore::Remove( ValueStore::WriteResult TestingValueStore::Clear() { std::vector<std::string> keys; - for (DictionaryValue::Iterator it(storage_); it.HasNext(); it.Advance()) { + for (DictionaryValue::Iterator it(storage_); !it.IsAtEnd(); it.Advance()) { keys.push_back(it.key()); } return Remove(keys); diff --git a/net/test/local_test_server.cc b/net/test/local_test_server.cc index 5741561..25a792e 100644 --- a/net/test/local_test_server.cc +++ b/net/test/local_test_server.cc @@ -198,7 +198,7 @@ bool LocalTestServer::AddCommandLineArguments(CommandLine* command_line) const { return false; // Serialize the argument dictionary into CommandLine. - for (DictionaryValue::Iterator it(arguments_dict); it.HasNext(); + for (DictionaryValue::Iterator it(arguments_dict); !it.IsAtEnd(); it.Advance()) { const base::Value& value = it.value(); const std::string& key = it.key(); diff --git a/remoting/host/policy_hack/policy_watcher.cc b/remoting/host/policy_hack/policy_watcher.cc index 3f0ef7a..01b288a 100644 --- a/remoting/host/policy_hack/policy_watcher.cc +++ b/remoting/host/policy_hack/policy_watcher.cc @@ -39,7 +39,7 @@ scoped_ptr<base::DictionaryValue> CopyGoodValuesAndAddDefaults( const base::DictionaryValue* bad_type_values) { scoped_ptr<base::DictionaryValue> to(default_values->DeepCopy()); for (base::DictionaryValue::Iterator i(*default_values); - i.HasNext(); i.Advance()) { + !i.IsAtEnd(); i.Advance()) { const base::Value* value = NULL; @@ -193,7 +193,7 @@ void PolicyWatcher::UpdatePolicies( scoped_ptr<base::DictionaryValue> changed_policies( new base::DictionaryValue()); base::DictionaryValue::Iterator iter(*new_policies); - while (iter.HasNext()) { + while (!iter.IsAtEnd()) { base::Value* old_policy; if (!(old_policies_->Get(iter.key(), &old_policy) && old_policy->Equals(&iter.value()))) { diff --git a/remoting/host/policy_hack/policy_watcher_mac.mm b/remoting/host/policy_hack/policy_watcher_mac.mm index 0283c8e..82cc219 100644 --- a/remoting/host/policy_hack/policy_watcher_mac.mm +++ b/remoting/host/policy_hack/policy_watcher_mac.mm @@ -46,7 +46,7 @@ class PolicyWatcherMac : public PolicyWatcher { CFStringRef policy_bundle_id = CFSTR("com.google.Chrome"); if (CFPreferencesAppSynchronize(policy_bundle_id)) { for (base::DictionaryValue::Iterator i(Defaults()); - i.HasNext(); i.Advance()) { + !i.IsAtEnd(); i.Advance()) { const std::string& policy_name = i.key(); base::mac::ScopedCFTypeRef<CFStringRef> policy_key( base::SysUTF8ToCFStringRef(policy_name)); diff --git a/remoting/host/policy_hack/policy_watcher_win.cc b/remoting/host/policy_hack/policy_watcher_win.cc index 94d71f1..af943e8 100644 --- a/remoting/host/policy_hack/policy_watcher_win.cc +++ b/remoting/host/policy_hack/policy_watcher_win.cc @@ -172,7 +172,7 @@ class PolicyWatcherWin : scoped_ptr<base::DictionaryValue> policy(new base::DictionaryValue()); for (base::DictionaryValue::Iterator i(Defaults()); - i.HasNext(); i.Advance()) { + !i.IsAtEnd(); i.Advance()) { const std::string& policy_name = i.key(); if (i.value().GetType() == base::DictionaryValue::TYPE_BOOLEAN) { bool bool_value; |