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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // We will then ask the URLMatcher, whether a given URL | 69 // We will then ask the URLMatcher, whether a given URL |
70 // "http://www.example.com/query/" has any matches, and the URLMatcher | 70 // "http://www.example.com/query/" has any matches, and the URLMatcher |
71 // will respond with the URLMatcherConditionSet::ID. We can map this | 71 // will respond with the URLMatcherConditionSet::ID. We can map this |
72 // to the WebRequestRule and check whether also the other conditions (in this | 72 // to the WebRequestRule and check whether also the other conditions (in this |
73 // example 'scheme': 'http') are fulfilled. | 73 // example 'scheme': 'http') are fulfilled. |
74 class WebRequestRulesRegistry : public RulesRegistry { | 74 class WebRequestRulesRegistry : public RulesRegistry { |
75 public: | 75 public: |
76 // |cache_delegate| can be NULL. In that case it constructs the registry with | 76 // |cache_delegate| can be NULL. In that case it constructs the registry with |
77 // storage functionality suspended. | 77 // storage functionality suspended. |
78 WebRequestRulesRegistry(Profile* profile, | 78 WebRequestRulesRegistry(Profile* profile, |
79 scoped_ptr<RulesCacheDelegate>* cache_delegate); | 79 RulesCacheDelegate* cache_delegate); |
80 | 80 |
81 // TODO(battre): This will become an implementation detail, because we need | 81 // TODO(battre): This will become an implementation detail, because we need |
82 // a way to also execute the actions of the rules. | 82 // a way to also execute the actions of the rules. |
83 std::set<const WebRequestRule*> GetMatches( | 83 std::set<const WebRequestRule*> GetMatches( |
84 const WebRequestData& request_data_without_ids) const; | 84 const WebRequestData& request_data_without_ids) const; |
85 | 85 |
86 // Returns which modifications should be executed on the network request | 86 // Returns which modifications should be executed on the network request |
87 // according to the rules registered in this registry. | 87 // according to the rules registered in this registry. |
88 std::list<LinkedPtrEventResponseDelta> CreateDeltas( | 88 std::list<LinkedPtrEventResponseDelta> CreateDeltas( |
89 const ExtensionInfoMap* extension_info_map, | 89 const ExtensionInfoMap* extension_info_map, |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 183 |
184 void* profile_id_; | 184 void* profile_id_; |
185 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 185 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
186 | 186 |
187 DISALLOW_COPY_AND_ASSIGN(WebRequestRulesRegistry); | 187 DISALLOW_COPY_AND_ASSIGN(WebRequestRulesRegistry); |
188 }; | 188 }; |
189 | 189 |
190 } // namespace extensions | 190 } // namespace extensions |
191 | 191 |
192 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES
_REGISTRY_H_ | 192 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES
_REGISTRY_H_ |
OLD | NEW |