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

Unified Diff: chrome/browser/extensions/api/declarative/rules_registry.h

Issue 28273006: <webview>: Implement declarativeWebRequest API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Istiaque's comments 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/declarative/rules_registry.h
diff --git a/chrome/browser/extensions/api/declarative/rules_registry.h b/chrome/browser/extensions/api/declarative/rules_registry.h
index f877a656dfb5587cd172fd546f7862ecefd436f9..d1758e18e625aaed5e9f8205250270d16a32f770 100644
--- a/chrome/browser/extensions/api/declarative/rules_registry.h
+++ b/chrome/browser/extensions/api/declarative/rules_registry.h
@@ -40,6 +40,7 @@ class RulesCacheDelegate;
class RulesRegistry : public base::RefCountedThreadSafe<RulesRegistry> {
public:
typedef extensions::api::events::Rule Rule;
+ typedef std::pair<int, int> WebViewKey;
enum Defaults { DEFAULT_PRIORITY = 100 };
// After the RulesCacheDelegate object (the part of the registry which runs on
@@ -50,7 +51,8 @@ class RulesRegistry : public base::RefCountedThreadSafe<RulesRegistry> {
RulesRegistry(Profile* profile,
const std::string& event_name,
content::BrowserThread::ID owner_thread,
- RulesCacheDelegate* cache_delegate);
+ RulesCacheDelegate* cache_delegate,
+ const WebViewKey& webview_key);
const OneShotEvent& ready() const {
return ready_;
@@ -130,6 +132,11 @@ class RulesRegistry : public base::RefCountedThreadSafe<RulesRegistry> {
// The name of the event with which rules are registered.
const std::string& event_name() const { return event_name_; }
+ // The key that identifies the webview (or tabs) in which these rules apply.
+ const WebViewKey& webview_key() const {
+ return webview_key_;
+ }
+
protected:
virtual ~RulesRegistry();
@@ -192,6 +199,9 @@ class RulesRegistry : public base::RefCountedThreadSafe<RulesRegistry> {
// The name of the event with which rules are registered.
const std::string event_name_;
+ // The key that identifies the context in which these rules apply.
+ WebViewKey webview_key_;
+
RulesDictionary rules_;
// Signaled when we have finished reading from storage for all extensions that

Powered by Google App Engine
This is Rietveld 408576698