Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Side by Side Diff: chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.h

Issue 28273006: <webview>: Implement declarativeWebRequest API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added tests Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 RulesRegistryWithCache { 74 class WebRequestRulesRegistry : public RulesRegistryWithCache {
75 public: 75 public:
76 // For testing, |ui_part| can be NULL. In that case it constructs the 76 // For testing, |ui_part| can be NULL. In that case it constructs the
77 // registry with storage functionality suspended. 77 // registry with storage functionality suspended.
78 WebRequestRulesRegistry( 78 WebRequestRulesRegistry(
79 Profile* profile, 79 Profile* profile,
80 scoped_ptr<RulesRegistryWithCache::RuleStorageOnUI>* ui_part); 80 scoped_ptr<RulesRegistryWithCache::RuleStorageOnUI>* ui_part,
81 const WebViewKey& webview_key);
81 82
82 // TODO(battre): This will become an implementation detail, because we need 83 // TODO(battre): This will become an implementation detail, because we need
83 // a way to also execute the actions of the rules. 84 // a way to also execute the actions of the rules.
84 std::set<const WebRequestRule*> GetMatches( 85 std::set<const WebRequestRule*> GetMatches(
85 const WebRequestData& request_data_without_ids) const; 86 const WebRequestData& request_data_without_ids) const;
86 87
87 // Returns which modifications should be executed on the network request 88 // Returns which modifications should be executed on the network request
88 // according to the rules registered in this registry. 89 // according to the rules registered in this registry.
89 std::list<LinkedPtrEventResponseDelta> CreateDeltas( 90 std::list<LinkedPtrEventResponseDelta> CreateDeltas(
90 const ExtensionInfoMap* extension_info_map, 91 const ExtensionInfoMap* extension_info_map,
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 185
185 void* profile_id_; 186 void* profile_id_;
186 scoped_refptr<ExtensionInfoMap> extension_info_map_; 187 scoped_refptr<ExtensionInfoMap> extension_info_map_;
187 188
188 DISALLOW_COPY_AND_ASSIGN(WebRequestRulesRegistry); 189 DISALLOW_COPY_AND_ASSIGN(WebRequestRulesRegistry);
189 }; 190 };
190 191
191 } // namespace extensions 192 } // namespace extensions
192 193
193 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES _REGISTRY_H_ 194 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES _REGISTRY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698