Chromium Code Reviews| Index: chrome/browser/extensions/extension_process_manager.cc |
| diff --git a/chrome/browser/extensions/extension_process_manager.cc b/chrome/browser/extensions/extension_process_manager.cc |
| index 806968623b580adb85e0ca85fda6e49460839f9b..fe9190e796ffa84c7fabea0591568c432588d9ee 100644 |
| --- a/chrome/browser/extensions/extension_process_manager.cc |
| +++ b/chrome/browser/extensions/extension_process_manager.cc |
| @@ -100,6 +100,8 @@ ExtensionProcessManager::ExtensionProcessManager(Profile* profile) |
| Source<Profile>(original_profile)); |
| registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED, |
| Source<Profile>(profile)); |
| + registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE, |
| + Source<Profile>(profile)); |
| // We can listen to everything for SITE_INSTANCE_DELETED because we check the |
| // |site_instance_id| in UnregisterExtensionSiteInstance. |
| registrar_.Add(this, content::NOTIFICATION_SITE_INSTANCE_DELETED, |
| @@ -336,6 +338,16 @@ void ExtensionProcessManager::Observe(int type, |
| break; |
| } |
| + case chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE: { |
| + ExtensionHost* host = Details<ExtensionHost>(details).ptr(); |
| + if (host->extension_host_type() == ViewType::EXTENSION_BACKGROUND_PAGE) { |
| + delete host; |
| + // |host| should deregister itself from our structures. |
| + DCHECK(background_hosts_.find(host) == background_hosts_.end()); |
|
Aaron Boodman
2011/09/06 19:47:04
Don't be a wuss! CHECK
Tessa MacDuff
2011/09/07 00:59:21
I'm no wuss! Done!
|
| + } |
| + break; |
| + } |
| + |
| case content::NOTIFICATION_APP_TERMINATING: { |
| // Close background hosts when the last browser is closed so that they |
| // have time to shutdown various objects on different threads. Our |