| 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 EXTENSIONS_BROWSER_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES_REGISTRY_
H_ | 5 #ifndef EXTENSIONS_BROWSER_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES_REGISTRY_
H_ |
| 6 #define EXTENSIONS_BROWSER_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES_REGISTRY_
H_ | 6 #define EXTENSIONS_BROWSER_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES_REGISTRY_
H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 const WebRequestData& request_data_without_ids) const; | 88 const WebRequestData& request_data_without_ids) const; |
| 89 | 89 |
| 90 // Returns which modifications should be executed on the network request | 90 // Returns which modifications should be executed on the network request |
| 91 // according to the rules registered in this registry. | 91 // according to the rules registered in this registry. |
| 92 std::list<LinkedPtrEventResponseDelta> CreateDeltas( | 92 std::list<LinkedPtrEventResponseDelta> CreateDeltas( |
| 93 const InfoMap* extension_info_map, | 93 const InfoMap* extension_info_map, |
| 94 const WebRequestData& request_data, | 94 const WebRequestData& request_data, |
| 95 bool crosses_incognito); | 95 bool crosses_incognito); |
| 96 | 96 |
| 97 // Implementation of RulesRegistry: | 97 // Implementation of RulesRegistry: |
| 98 virtual std::string AddRulesImpl( | 98 std::string AddRulesImpl( |
| 99 const std::string& extension_id, | 99 const std::string& extension_id, |
| 100 const std::vector<linked_ptr<RulesRegistry::Rule> >& rules) override; | 100 const std::vector<linked_ptr<RulesRegistry::Rule>>& rules) override; |
| 101 virtual std::string RemoveRulesImpl( | 101 std::string RemoveRulesImpl( |
| 102 const std::string& extension_id, | 102 const std::string& extension_id, |
| 103 const std::vector<std::string>& rule_identifiers) override; | 103 const std::vector<std::string>& rule_identifiers) override; |
| 104 virtual std::string RemoveAllRulesImpl( | 104 std::string RemoveAllRulesImpl(const std::string& extension_id) override; |
| 105 const std::string& extension_id) override; | |
| 106 | 105 |
| 107 // Returns true if this object retains no allocated data. Only for debugging. | 106 // Returns true if this object retains no allocated data. Only for debugging. |
| 108 bool IsEmpty() const; | 107 bool IsEmpty() const; |
| 109 | 108 |
| 110 protected: | 109 protected: |
| 111 virtual ~WebRequestRulesRegistry(); | 110 ~WebRequestRulesRegistry() override; |
| 112 | 111 |
| 113 // Virtual for testing: | 112 // Virtual for testing: |
| 114 virtual base::Time GetExtensionInstallationTime( | 113 virtual base::Time GetExtensionInstallationTime( |
| 115 const std::string& extension_id) const; | 114 const std::string& extension_id) const; |
| 116 virtual void ClearCacheOnNavigation(); | 115 virtual void ClearCacheOnNavigation(); |
| 117 | 116 |
| 118 void SetExtensionInfoMapForTesting( | 117 void SetExtensionInfoMapForTesting( |
| 119 scoped_refptr<InfoMap> extension_info_map) { | 118 scoped_refptr<InfoMap> extension_info_map) { |
| 120 extension_info_map_ = extension_info_map; | 119 extension_info_map_ = extension_info_map; |
| 121 } | 120 } |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 | 187 |
| 189 content::BrowserContext* browser_context_; | 188 content::BrowserContext* browser_context_; |
| 190 scoped_refptr<InfoMap> extension_info_map_; | 189 scoped_refptr<InfoMap> extension_info_map_; |
| 191 | 190 |
| 192 DISALLOW_COPY_AND_ASSIGN(WebRequestRulesRegistry); | 191 DISALLOW_COPY_AND_ASSIGN(WebRequestRulesRegistry); |
| 193 }; | 192 }; |
| 194 | 193 |
| 195 } // namespace extensions | 194 } // namespace extensions |
| 196 | 195 |
| 197 #endif // EXTENSIONS_BROWSER_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES_REGIST
RY_H_ | 196 #endif // EXTENSIONS_BROWSER_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES_REGIST
RY_H_ |
| OLD | NEW |