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

Unified Diff: chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.h

Issue 11569007: Refactoring how conditions without URL attributes are handled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactor of GetMatches, IsFulfilled etc. Created 8 years 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
Index: chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.h
diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.h b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.h
index 953dac3bf1b7c05002b1fc0ccd76c65bc6f8664c..08d0a934ea6546d72285d23aa109251736edaa27 100644
--- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.h
+++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.h
@@ -68,7 +68,7 @@ class WebRequestRulesRegistry : public RulesRegistryWithCache {
// TODO(battre): This will become an implementation detail, because we need
// a way to also execute the actions of the rules.
- std::set<WebRequestRule::GlobalRuleId> GetMatches(
+ std::set<const WebRequestRule*> GetMatches(
vabr (Chromium) 2012/12/18 18:26:42 If it is for some reason necessary to return (a se
Jeffrey Yasskin 2012/12/18 21:56:02 The only risk here would be if WebRequestRules are
vabr (Chromium) 2012/12/19 08:38:19 Oh, right. Yes, I hope the only place where rules
const WebRequestRule::RequestData& request_data);
// Returns which modifications should be executed on the network request
@@ -100,6 +100,11 @@ class WebRequestRulesRegistry : public RulesRegistryWithCache {
const std::string& extension_id) const;
virtual void ClearCacheOnNavigation();
+ const std::set<const WebRequestRule*>&
+ rules_with_untriggered_conditions_for_test() const {
+ return rules_with_untriggered_conditions_;
+ }
+
private:
typedef std::map<URLMatcherConditionSet::ID, WebRequestRule*> RuleTriggers;
typedef std::map<WebRequestRule::GlobalRuleId, linked_ptr<WebRequestRule> >
@@ -109,6 +114,11 @@ class WebRequestRulesRegistry : public RulesRegistryWithCache {
// the URLMatcherConditionSet::ID was returned by the |url_matcher_|.
RuleTriggers rule_triggers_;
+ // These rules contain condition sets with conditions without URL attributes.
+ // Such conditions are not triggered by URL matcher, so we need to test them
+ // separately.
+ std::set<const WebRequestRule*> rules_with_untriggered_conditions_;
+
RulesMap webrequest_rules_;
URLMatcher url_matcher_;

Powered by Google App Engine
This is Rietveld 408576698