Index: components/policy/core/common/policy_map.cc |
diff --git a/components/policy/core/common/policy_map.cc b/components/policy/core/common/policy_map.cc |
index b8c58f96cb993f5d0587b1871bf403f21f596c28..55114d76b5adca2f5965f859295fb62056c0b9aa 100644 |
--- a/components/policy/core/common/policy_map.cc |
+++ b/components/policy/core/common/policy_map.cc |
@@ -93,6 +93,18 @@ void PolicyMap::Erase(const std::string& policy) { |
map_.erase(policy); |
} |
+void PolicyMap::EraseNonmatching( |
+ const base::Callback<bool(const const_iterator)>& filter) { |
+ PolicyMapType::iterator iter(map_.begin()); |
+ while (iter != map_.end()) { |
+ if (!filter.Run(iter)) { |
+ map_.erase(iter++); |
+ } else { |
+ ++iter; |
+ } |
+ } |
+} |
+ |
void PolicyMap::Swap(PolicyMap* other) { |
map_.swap(other->map_); |
} |
@@ -156,17 +168,6 @@ void PolicyMap::GetDifferingKeys(const PolicyMap& other, |
differing_keys->insert(iter_other->first); |
} |
-void PolicyMap::FilterLevel(PolicyLevel level) { |
- PolicyMapType::iterator iter(map_.begin()); |
- while (iter != map_.end()) { |
- if (iter->second.level != level) { |
- map_.erase(iter++); |
- } else { |
- ++iter; |
- } |
- } |
-} |
- |
bool PolicyMap::Equals(const PolicyMap& other) const { |
return other.size() == size() && |
std::equal(begin(), end(), other.begin(), MapEntryEquals); |