OLD | NEW |
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_RULES_REGISTRY_SERVICE_H__ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_SERVICE_H__ |
6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_SERVICE_H__ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_SERVICE_H__ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 namespace extensions { | 28 namespace extensions { |
29 | 29 |
30 // This class owns all RulesRegistries implementations of an ExtensionService. | 30 // This class owns all RulesRegistries implementations of an ExtensionService. |
31 // This class lives on the UI thread. | 31 // This class lives on the UI thread. |
32 class RulesRegistryService : public content::NotificationObserver { | 32 class RulesRegistryService : public content::NotificationObserver { |
33 public: | 33 public: |
34 explicit RulesRegistryService(Profile* profile); | 34 explicit RulesRegistryService(Profile* profile); |
35 virtual ~RulesRegistryService(); | 35 virtual ~RulesRegistryService(); |
36 | 36 |
| 37 // Unregisters refptrs to concrete RulesRegistries at other objects that were |
| 38 // created by us so that the RulesRegistries can be released. |
| 39 void Shutdown(); |
| 40 |
37 // Registers the default RulesRegistries used in Chromium. | 41 // Registers the default RulesRegistries used in Chromium. |
38 void RegisterDefaultRulesRegistries(); | 42 void RegisterDefaultRulesRegistries(); |
39 | 43 |
40 // Registers a RulesRegistry and wraps it in an InitializingRulesRegistry. | 44 // Registers a RulesRegistry and wraps it in an InitializingRulesRegistry. |
41 void RegisterRulesRegistry(const std::string& event_name, | 45 void RegisterRulesRegistry(const std::string& event_name, |
42 scoped_refptr<RulesRegistry> rule_registry); | 46 scoped_refptr<RulesRegistry> rule_registry); |
43 | 47 |
44 // Returns the RulesRegistry for |event_name| or NULL if no such registry | 48 // Returns the RulesRegistry for |event_name| or NULL if no such registry |
45 // has been registered. | 49 // has been registered. |
46 scoped_refptr<RulesRegistry> GetRulesRegistry( | 50 scoped_refptr<RulesRegistry> GetRulesRegistry( |
(...skipping 18 matching lines...) Expand all Loading... |
65 RulesRegistryMap rule_registries_; | 69 RulesRegistryMap rule_registries_; |
66 | 70 |
67 content::NotificationRegistrar registrar_; | 71 content::NotificationRegistrar registrar_; |
68 | 72 |
69 DISALLOW_COPY_AND_ASSIGN(RulesRegistryService); | 73 DISALLOW_COPY_AND_ASSIGN(RulesRegistryService); |
70 }; | 74 }; |
71 | 75 |
72 } // namespace extensions | 76 } // namespace extensions |
73 | 77 |
74 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_SERVICE_H__ | 78 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_SERVICE_H__ |
OLD | NEW |