Chromium Code Reviews| 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..6e856a00c602c4b7b1bdbb0c4aef9a2c049bffa4 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 rules_registry_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 id for the webview (or tabs) in which these rules apply. |
| + int rules_registry_id() const { return rules_registry_id_; } |
|
Fady Samuel
2014/11/26 23:39:40
Just call this ID. Also, don't mention webview or
Xi Han
2014/11/27 23:25:24
Rename to 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 rules_registry_id_; |
|
Fady Samuel
2014/11/26 23:39:40
int id_
Xi Han
2014/11/27 23:25:24
Done.
|
| RulesDictionary rules_; |