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

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

Issue 764643002: Remove WebViewKey in rules registry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renaming move "remove rules registry for webview" part to WebViewGuest. Created 6 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: extensions/browser/api/declarative/rules_registry.h
diff --git a/extensions/browser/api/declarative/rules_registry.h b/extensions/browser/api/declarative/rules_registry.h
index 4772823f6539d7d18b4bd33b6033d6ccf0fefc56..4fc3178050f5301f1dc825606f8440012fa63f70 100644
--- a/extensions/browser/api/declarative/rules_registry.h
+++ b/extensions/browser/api/declarative/rules_registry.h
@@ -40,18 +40,6 @@ class RulesCacheDelegate;
class RulesRegistry : public base::RefCountedThreadSafe<RulesRegistry> {
public:
typedef extensions::core_api::events::Rule Rule;
- struct WebViewKey {
- int embedder_process_id;
- int webview_instance_id;
- WebViewKey(int embedder_process_id, int webview_instance_id)
- : embedder_process_id(embedder_process_id),
- webview_instance_id(webview_instance_id) {}
- bool operator<(const WebViewKey& other) const {
- return embedder_process_id < other.embedder_process_id ||
- ((embedder_process_id == other.embedder_process_id) &&
- (webview_instance_id < other.webview_instance_id));
- }
- };
enum Defaults { DEFAULT_PRIORITY = 100 };
// After the RulesCacheDelegate object (the part of the registry which runs on
@@ -63,7 +51,7 @@ class RulesRegistry : public base::RefCountedThreadSafe<RulesRegistry> {
const std::string& event_name,
content::BrowserThread::ID owner_thread,
RulesCacheDelegate* cache_delegate,
- const WebViewKey& webview_key);
+ int id);
const OneShotEvent& ready() const {
return ready_;
@@ -145,11 +133,8 @@ 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.
- // If the rules apply to the main browser, then this returns the tuple (0, 0).
- const WebViewKey& webview_key() const {
- return webview_key_;
- }
+ // The unique identifier for this RulesRegistry object.
+ int id() const { return id_; }
protected:
virtual ~RulesRegistry();
@@ -233,7 +218,7 @@ class RulesRegistry : public base::RefCountedThreadSafe<RulesRegistry> {
const std::string event_name_;
// The key that identifies the context in which these rules apply.
- WebViewKey webview_key_;
+ int id_;
RulesDictionary rules_;

Powered by Google App Engine
This is Rietveld 408576698