diff options
author | yoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-26 00:09:49 +0000 |
---|---|---|
committer | yoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-26 00:09:49 +0000 |
commit | da55b8dd1cec219ceae19f964f7153dea3c70684 (patch) | |
tree | 21e0a2674c7f2b029cad2f4625119bf8cc0cc456 /chrome/browser/extensions/extension_processes_api.h | |
parent | bc68aa1aa9b8f1d812f6ad55ca7fe19ad3c1705c (diff) | |
download | chromium_src-da55b8dd1cec219ceae19f964f7153dea3c70684.zip chromium_src-da55b8dd1cec219ceae19f964f7153dea3c70684.tar.gz chromium_src-da55b8dd1cec219ceae19f964f7153dea3c70684.tar.bz2 |
Change event routers from singletons to being owned by the ExtensionService.
ExtensionService is in turn owned by the Profile.
Also stop pretending that each event router observes more than one profile. (To support multi-profile, each profile would have its own ExtensionService and routers.)
BUG=81745
TEST=covered by existing tests
Review URL: http://codereview.chromium.org/6961027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86750 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_processes_api.h')
-rw-r--r-- | chrome/browser/extensions/extension_processes_api.h | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/chrome/browser/extensions/extension_processes_api.h b/chrome/browser/extensions/extension_processes_api.h index fe0a2f9..18e871f 100644 --- a/chrome/browser/extensions/extension_processes_api.h +++ b/chrome/browser/extensions/extension_processes_api.h @@ -13,15 +13,16 @@ #include "chrome/browser/task_manager/task_manager.h" #include "content/common/notification_registrar.h" +class Profile; + // Observes the Task Manager and routes the notifications as events to the // extension system. class ExtensionProcessesEventRouter : public TaskManagerModelObserver { public: - // Single instance of the event router. - static ExtensionProcessesEventRouter* GetInstance(); + explicit ExtensionProcessesEventRouter(Profile* profile); + virtual ~ExtensionProcessesEventRouter(); - // Safe to call multiple times. - void ObserveProfile(Profile* profile); + void Init(); // Called when an extension process wants to listen to process events. void ListenerAdded(); @@ -30,10 +31,6 @@ class ExtensionProcessesEventRouter : public TaskManagerModelObserver { void ListenerRemoved(); private: - friend struct DefaultSingletonTraits<ExtensionProcessesEventRouter>; - - ExtensionProcessesEventRouter(); - virtual ~ExtensionProcessesEventRouter(); // TaskManagerModelObserver methods. virtual void OnModelChanged() {} @@ -48,9 +45,8 @@ class ExtensionProcessesEventRouter : public TaskManagerModelObserver { // Used for tracking registrations to process related notifications. NotificationRegistrar registrar_; - // Registered profiles. - typedef std::set<Profile*> ProfileSet; - ProfileSet profiles_; + // The associated Profile owns us transitively via ExtensionService. + Profile* profile_; // TaskManager to observe for updates. TaskManagerModel* model_; |