Chromium Code Reviews| Index: chrome/browser/extensions/api/declarative/rules_registry_service.h |
| diff --git a/chrome/browser/extensions/api/declarative/rules_registry_service.h b/chrome/browser/extensions/api/declarative/rules_registry_service.h |
| index 37bb8c0fbd3c6971398f478cc353a9e0fcf0e1f1..9e8c285de493dd57ba8a70b8f105f1393020f589 100644 |
| --- a/chrome/browser/extensions/api/declarative/rules_registry_service.h |
| +++ b/chrome/browser/extensions/api/declarative/rules_registry_service.h |
| @@ -14,6 +14,7 @@ |
| #include "base/memory/scoped_vector.h" |
| #include "base/scoped_observer.h" |
| #include "chrome/browser/extensions/api/declarative/rules_registry.h" |
| +#include "chrome/browser/extensions/api/declarative_content/content_rules_registry.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "content/public/browser/notification_observer.h" |
| #include "content/public/browser/notification_registrar.h" |
| @@ -28,7 +29,6 @@ class NotificationSource; |
| } |
| namespace extensions { |
| -class ContentRulesRegistry; |
| class ExtensionRegistry; |
| class RulesRegistry; |
| class RulesRegistryStorageDelegate; |
| @@ -84,11 +84,12 @@ class RulesRegistryService : public BrowserContextKeyedAPI, |
| const WebViewKey& webview_key, |
| const std::string& event_name); |
| - // Accessors for each type of rules registry. |
| - ContentRulesRegistry* content_rules_registry() const { |
| - CHECK(content_rules_registry_); |
| - return content_rules_registry_; |
| + // Accessors for content rules registries. |
| + std::map<std::string, ContentRulesRegistry*>& content_rules_registry_map() { |
| + return content_rules_registry_map_; |
| } |
| + ContentRulesRegistry* GetContentRulesRegistry( |
| + const std::string& event_name); |
| // Removes all rules registries of a given webview embedder process ID. |
| void RemoveWebViewRulesRegistries(int process_id); |
| @@ -139,9 +140,9 @@ class RulesRegistryService : public BrowserContextKeyedAPI, |
| // We own the parts of the registries which need to run on the UI thread. |
| ScopedVector<RulesCacheDelegate> cache_delegates_; |
| - // Weak pointer into rule_registries_ to make it easier to handle content rule |
| - // conditions. |
| - ContentRulesRegistry* content_rules_registry_; |
| + // Collection of content rule registries to make it easier to handle content |
|
Jeffrey Yasskin
2014/07/15 17:12:59
You've removed the information about what structur
Mark Dittmer
2014/07/15 18:32:42
Fixed comment to refer to weak pointers. When/if w
|
| + // rule conditions. |
| + std::map<std::string, ContentRulesRegistry*> content_rules_registry_map_; |
| content::NotificationRegistrar registrar_; |