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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 bool IsEmpty() const; | 93 bool IsEmpty() const; |
94 | 94 |
95 protected: | 95 protected: |
96 virtual ~WebRequestRulesRegistry(); | 96 virtual ~WebRequestRulesRegistry(); |
97 | 97 |
98 // Virtual for testing: | 98 // Virtual for testing: |
99 virtual base::Time GetExtensionInstallationTime( | 99 virtual base::Time GetExtensionInstallationTime( |
100 const std::string& extension_id) const; | 100 const std::string& extension_id) const; |
101 virtual void ClearCacheOnNavigation(); | 101 virtual void ClearCacheOnNavigation(); |
102 | 102 |
103 const std::set<const WebRequestRule*>& | |
104 rules_with_untriggered_conditions_for_test() const { | |
vabr (Chromium)
2012/12/13 12:18:06
Here I'm not sure about the indenting. I've seen o
Jeffrey Yasskin
2012/12/18 02:24:32
My editor doesn't indent the function name, so I'd
battre
2012/12/18 08:20:44
I have seen both styles. I think that no spaces is
vabr (Chromium)
2012/12/18 18:26:42
For the private-getter: note that this is protecte
vabr (Chromium)
2012/12/18 18:26:42
Thanks both for the advice on indenting. I changed
| |
105 return rules_with_untriggered_conditions_; | |
106 } | |
107 | |
103 private: | 108 private: |
104 typedef std::map<URLMatcherConditionSet::ID, WebRequestRule*> RuleTriggers; | 109 typedef std::map<URLMatcherConditionSet::ID, WebRequestRule*> RuleTriggers; |
105 typedef std::map<WebRequestRule::GlobalRuleId, linked_ptr<WebRequestRule> > | 110 typedef std::map<WebRequestRule::GlobalRuleId, linked_ptr<WebRequestRule> > |
106 RulesMap; | 111 RulesMap; |
107 | 112 |
108 // Map that tells us which WebRequestRule may match under the condition that | 113 // Map that tells us which WebRequestRule may match under the condition that |
109 // the URLMatcherConditionSet::ID was returned by the |url_matcher_|. | 114 // the URLMatcherConditionSet::ID was returned by the |url_matcher_|. |
110 RuleTriggers rule_triggers_; | 115 RuleTriggers rule_triggers_; |
111 | 116 |
117 // These rules contain condition sets with conditions without URL attributes. | |
118 // Such conditions are not triggered by URL matcher, so we need to test them | |
119 // separately. | |
120 std::set<const WebRequestRule*> rules_with_untriggered_conditions_; | |
121 | |
112 RulesMap webrequest_rules_; | 122 RulesMap webrequest_rules_; |
113 | 123 |
114 URLMatcher url_matcher_; | 124 URLMatcher url_matcher_; |
115 | 125 |
116 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 126 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
117 }; | 127 }; |
118 | 128 |
119 } // namespace extensions | 129 } // namespace extensions |
120 | 130 |
121 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES _REGISTRY_H_ | 131 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES _REGISTRY_H_ |
OLD | NEW |