OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES_RE
GISTRY_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES_RE
GISTRY_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES_RE
GISTRY_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES_RE
GISTRY_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 // Returns true in case of consistency and MUST set |error| otherwise. | 119 // Returns true in case of consistency and MUST set |error| otherwise. |
120 static bool CheckConsistency(const WebRequestConditionSet* conditions, | 120 static bool CheckConsistency(const WebRequestConditionSet* conditions, |
121 const WebRequestActionSet* actions, | 121 const WebRequestActionSet* actions, |
122 std::string* error); | 122 std::string* error); |
123 | 123 |
124 typedef std::map<URLMatcherConditionSet::ID, WebRequestRule*> RuleTriggers; | 124 typedef std::map<URLMatcherConditionSet::ID, WebRequestRule*> RuleTriggers; |
125 typedef std::map<WebRequestRule::GlobalRuleId, linked_ptr<WebRequestRule> > | 125 typedef std::map<WebRequestRule::GlobalRuleId, linked_ptr<WebRequestRule> > |
126 RulesMap; | 126 RulesMap; |
127 | 127 |
128 // Map that tells us which WebRequestRule may match under the condition that | 128 // Map that tells us which WebRequestRule may match under the condition that |
129 // the URLMatcherConditionSet::ID was returned by the |url_matcher_|. | 129 // the URLMatcherConditionSet::ID was returned by the |url_matcher_| or |
| 130 // |first_party_url_matcher_|. |
130 RuleTriggers rule_triggers_; | 131 RuleTriggers rule_triggers_; |
131 | 132 |
132 // These rules contain condition sets with conditions without URL attributes. | 133 // These rules contain condition sets with conditions without URL attributes. |
133 // Such conditions are not triggered by URL matcher, so we need to test them | 134 // Such conditions are not triggered by URL matcher, so we need to test them |
134 // separately. | 135 // separately. |
135 std::set<const WebRequestRule*> rules_with_untriggered_conditions_; | 136 std::set<const WebRequestRule*> rules_with_untriggered_conditions_; |
136 | 137 |
137 RulesMap webrequest_rules_; | 138 RulesMap webrequest_rules_; |
138 | 139 |
139 URLMatcher url_matcher_; | 140 URLMatcher url_matcher_; |
| 141 URLMatcher first_party_url_matcher_; |
140 | 142 |
141 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 143 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
142 }; | 144 }; |
143 | 145 |
144 } // namespace extensions | 146 } // namespace extensions |
145 | 147 |
146 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES
_REGISTRY_H_ | 148 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES
_REGISTRY_H_ |
OLD | NEW |