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

Side by Side Diff: chrome/browser/extensions/api/declarative/rules_registry_service.h

Issue 10076001: Fix memory leak caused by Rules Registries (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698