| 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..d5aa4065bced9993f4a13816da96dc496b0ff609 100644
|
| --- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.h
|
| +++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.h
|
| @@ -13,9 +13,11 @@
|
| #include "base/time.h"
|
| #include "base/memory/linked_ptr.h"
|
| #include "base/memory/ref_counted.h"
|
| +#include "chrome/browser/extensions/api/declarative/declarative_rule.h"
|
| #include "chrome/browser/extensions/api/declarative/rules_registry_with_cache.h"
|
| #include "chrome/browser/extensions/api/declarative_webrequest/request_stage.h"
|
| -#include "chrome/browser/extensions/api/declarative_webrequest/webrequest_rule.h"
|
| +#include "chrome/browser/extensions/api/declarative_webrequest/webrequest_action.h"
|
| +#include "chrome/browser/extensions/api/declarative_webrequest/webrequest_condition.h"
|
| #include "chrome/browser/extensions/extension_info_map.h"
|
| #include "chrome/common/extensions/matcher/url_matcher.h"
|
|
|
| @@ -34,6 +36,10 @@ namespace extensions {
|
|
|
| class RulesRegistryService;
|
|
|
| +typedef linked_ptr<extension_web_request_api_helpers::EventResponseDelta>
|
| + LinkedPtrEventResponseDelta;
|
| +typedef DeclarativeRule<WebRequestCondition, WebRequestAction> WebRequestRule;
|
| +
|
| // The WebRequestRulesRegistry is responsible for managing
|
| // the internal representation of rules for the Declarative Web Request API.
|
| //
|
| @@ -69,13 +75,13 @@ 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(
|
| - const WebRequestRule::RequestData& request_data);
|
| + const DeclarativeWebRequestData& request_data);
|
|
|
| // Returns which modifications should be executed on the network request
|
| // according to the rules registered in this registry.
|
| std::list<LinkedPtrEventResponseDelta> CreateDeltas(
|
| const ExtensionInfoMap* extension_info_map,
|
| - const WebRequestRule::RequestData& request_data,
|
| + const DeclarativeWebRequestData& request_data,
|
| bool crosses_incognito);
|
|
|
| // Implementation of RulesRegistryWithCache:
|
| @@ -101,6 +107,14 @@ class WebRequestRulesRegistry : public RulesRegistryWithCache {
|
| virtual void ClearCacheOnNavigation();
|
|
|
| private:
|
| + // Checks whether the set of |conditions| and |actions| are consistent,
|
| + // meaning for example that we do not allow combining an |action| that needs
|
| + // to be executed before the |condition| can be fulfilled.
|
| + // Returns true in case of consistency and MUST set |error| otherwise.
|
| + static bool CheckConsistency(WebRequestConditionSet* conditions,
|
| + WebRequestActionSet* actions,
|
| + std::string* error);
|
| +
|
| typedef std::map<URLMatcherConditionSet::ID, WebRequestRule*> RuleTriggers;
|
| typedef std::map<WebRequestRule::GlobalRuleId, linked_ptr<WebRequestRule> >
|
| RulesMap;
|
|
|