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

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

Issue 10695130: Fix a memory leak in RulesRegistryStorageDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/declarative/rules_registry_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "content/public/browser/notification_observer.h" 14 #include "content/public/browser/notification_observer.h"
15 #include "content/public/browser/notification_registrar.h" 15 #include "content/public/browser/notification_registrar.h"
16 16
17 class Profile; 17 class Profile;
18 18
19 namespace content { 19 namespace content {
20 class NotificationSource; 20 class NotificationSource;
21 class NotificationSource; 21 class NotificationSource;
22 } 22 }
23 23
24 namespace extensions { 24 namespace extensions {
25 class RulesRegistry; 25 class RulesRegistry;
26 class RulesRegistryStorageDelegate;
26 } 27 }
27 28
28 namespace extensions { 29 namespace extensions {
29 30
30 // This class owns all RulesRegistries implementations of an ExtensionService. 31 // This class owns all RulesRegistries implementations of an ExtensionService.
31 // This class lives on the UI thread. 32 // This class lives on the UI thread.
32 class RulesRegistryService : public content::NotificationObserver { 33 class RulesRegistryService : public content::NotificationObserver {
33 public: 34 public:
34 explicit RulesRegistryService(Profile* profile); 35 explicit RulesRegistryService(Profile* profile);
35 virtual ~RulesRegistryService(); 36 virtual ~RulesRegistryService();
(...skipping 24 matching lines...) Expand all
60 // It is not guaranteed that this notification is processed synchronously. 61 // It is not guaranteed that this notification is processed synchronously.
61 // If extensions live on another thread, the notification is posted. 62 // If extensions live on another thread, the notification is posted.
62 void OnExtensionUnloaded(const std::string& extension_id); 63 void OnExtensionUnloaded(const std::string& extension_id);
63 64
64 // Implementation of content::NotificationObserver. 65 // Implementation of content::NotificationObserver.
65 virtual void Observe(int type, 66 virtual void Observe(int type,
66 const content::NotificationSource& source, 67 const content::NotificationSource& source,
67 const content::NotificationDetails& details) OVERRIDE; 68 const content::NotificationDetails& details) OVERRIDE;
68 69
69 RulesRegistryMap rule_registries_; 70 RulesRegistryMap rule_registries_;
71 std::vector<RulesRegistryStorageDelegate*> delegates_;
battre 2012/07/11 09:16:32 Add comment that delegates are owned by rules_regi
Matt Perry 2012/07/11 21:15:28 Done.
70 72
71 content::NotificationRegistrar registrar_; 73 content::NotificationRegistrar registrar_;
72 74
73 Profile* profile_; 75 Profile* profile_;
74 76
75 DISALLOW_COPY_AND_ASSIGN(RulesRegistryService); 77 DISALLOW_COPY_AND_ASSIGN(RulesRegistryService);
76 }; 78 };
77 79
78 } // namespace extensions 80 } // namespace extensions
79 81
80 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_SERVICE_H__ 82 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_SERVICE_H__
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/declarative/rules_registry_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698