| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // | 57 // |
| 58 // For this, the URLRequestCondition has a URLMatcherConditionSet, which | 58 // For this, the URLRequestCondition has a URLMatcherConditionSet, which |
| 59 // represents the {'host_suffix': 'example.com', 'path_prefix': '/query'} part. | 59 // represents the {'host_suffix': 'example.com', 'path_prefix': '/query'} part. |
| 60 // We will then ask the URLMatcher, whether a given URL | 60 // We will then ask the URLMatcher, whether a given URL |
| 61 // "http://www.example.com/query/" has any matches, and the URLMatcher | 61 // "http://www.example.com/query/" has any matches, and the URLMatcher |
| 62 // will respond with the URLMatcherConditionSet::ID. We can map this | 62 // will respond with the URLMatcherConditionSet::ID. We can map this |
| 63 // to the WebRequestRule and check whether also the other conditions (in this | 63 // to the WebRequestRule and check whether also the other conditions (in this |
| 64 // example 'scheme': 'http') are fulfilled. | 64 // example 'scheme': 'http') are fulfilled. |
| 65 class WebRequestRulesRegistry : public RulesRegistryWithCache { | 65 class WebRequestRulesRegistry : public RulesRegistryWithCache { |
| 66 public: | 66 public: |
| 67 explicit WebRequestRulesRegistry(Profile* profile); | 67 WebRequestRulesRegistry(Profile* profile, Delegate* delegate); |
| 68 | 68 |
| 69 // TODO(battre): This will become an implementation detail, because we need | 69 // TODO(battre): This will become an implementation detail, because we need |
| 70 // a way to also execute the actions of the rules. | 70 // a way to also execute the actions of the rules. |
| 71 std::set<WebRequestRule::GlobalRuleId> GetMatches( | 71 std::set<WebRequestRule::GlobalRuleId> GetMatches( |
| 72 net::URLRequest* request, | 72 net::URLRequest* request, |
| 73 RequestStages request_stage); | 73 RequestStages request_stage); |
| 74 | 74 |
| 75 // Returns which modifications should be executed on the network request | 75 // Returns which modifications should be executed on the network request |
| 76 // according to the rules registered in this registry. | 76 // according to the rules registered in this registry. |
| 77 std::list<LinkedPtrEventResponseDelta> CreateDeltas( | 77 std::list<LinkedPtrEventResponseDelta> CreateDeltas( |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 RulesMap webrequest_rules_; | 110 RulesMap webrequest_rules_; |
| 111 | 111 |
| 112 URLMatcher url_matcher_; | 112 URLMatcher url_matcher_; |
| 113 | 113 |
| 114 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 114 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 } // namespace extensions | 117 } // namespace extensions |
| 118 | 118 |
| 119 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES
_REGISTRY_H_ | 119 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES
_REGISTRY_H_ |
| OLD | NEW |