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

Unified Diff: chrome/browser/extensions/api/declarative/rules_registry_with_cache.cc

Issue 9844028: Implement rules removal for WebRequestRulesRegistry (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 8 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 | « no previous file | chrome/browser/extensions/api/declarative/substring_set_matcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/declarative/rules_registry_with_cache.cc
diff --git a/chrome/browser/extensions/api/declarative/rules_registry_with_cache.cc b/chrome/browser/extensions/api/declarative/rules_registry_with_cache.cc
index a10e059db280d40af163c7b190db34f8a0543f43..1234b9f3db2231ce4e1dc86c04ec26d2bf2055a8 100644
--- a/chrome/browser/extensions/api/declarative/rules_registry_with_cache.cc
+++ b/chrome/browser/extensions/api/declarative/rules_registry_with_cache.cc
@@ -29,7 +29,7 @@ std::string RulesRegistryWithCache::AddRules(
for (std::vector<linked_ptr<Rule> >::const_iterator i =
rules.begin(); i != rules.end(); ++i) {
const RuleId& rule_id = *((*i)->id);
- RulesDictionaryKey key = make_pair(extension_id, rule_id);
+ RulesDictionaryKey key(extension_id, rule_id);
if (rules_.find(key) != rules_.end())
return StringPrintf(kDuplicateRuleId, rule_id.c_str());
}
@@ -43,7 +43,7 @@ std::string RulesRegistryWithCache::AddRules(
for (std::vector<linked_ptr<Rule> >::const_iterator i =
rules.begin(); i != rules.end(); ++i) {
const RuleId& rule_id = *((*i)->id);
- RulesDictionaryKey key = make_pair(extension_id, rule_id);
+ RulesDictionaryKey key(extension_id, rule_id);
rules_[key] = *i;
}
return kSuccess;
@@ -62,7 +62,7 @@ std::string RulesRegistryWithCache::RemoveRules(
// Commit removal of rules from |rules_| on success.
for (std::vector<std::string>::const_iterator i =
rule_identifiers.begin(); i != rule_identifiers.end(); ++i) {
- RulesDictionaryKey lookup_key = make_pair(extension_id, *i);
+ RulesDictionaryKey lookup_key(extension_id, *i);
rules_.erase(lookup_key);
}
return kSuccess;
@@ -96,7 +96,7 @@ std::string RulesRegistryWithCache::GetRules(
for (std::vector<std::string>::const_iterator i = rule_identifiers.begin();
i != rule_identifiers.end(); ++i) {
- RulesDictionaryKey lookup_key = make_pair(extension_id, *i);
+ RulesDictionaryKey lookup_key(extension_id, *i);
RulesDictionary::iterator entry = rules_.find(lookup_key);
if (entry != rules_.end())
out->push_back(entry->second);
« no previous file with comments | « no previous file | chrome/browser/extensions/api/declarative/substring_set_matcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698