diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-20 06:40:15 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-20 06:40:15 +0000 |
commit | e172584ff551a313430fda5439f3cf7f87cbdec6 (patch) | |
tree | 9c86221f0789b9964b4632a5eb84bb7e5fa49903 /chrome/browser/task_manager_resource_providers.cc | |
parent | 3553c6cc33291037232c0b9b70f744ac5d2dc03c (diff) | |
download | chromium_src-e172584ff551a313430fda5439f3cf7f87cbdec6.zip chromium_src-e172584ff551a313430fda5439f3cf7f87cbdec6.tar.gz chromium_src-e172584ff551a313430fda5439f3cf7f87cbdec6.tar.bz2 |
Correctly handle extension reloading in the task manager.
BUG=18693
TEST=Added new tests to browser_tests.
Review URL: http://codereview.chromium.org/300005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29498 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/task_manager_resource_providers.cc')
-rw-r--r-- | chrome/browser/task_manager_resource_providers.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/browser/task_manager_resource_providers.cc b/chrome/browser/task_manager_resource_providers.cc index 931d325..b9fe366 100644 --- a/chrome/browser/task_manager_resource_providers.cc +++ b/chrome/browser/task_manager_resource_providers.cc @@ -493,7 +493,7 @@ TaskManagerExtensionProcessResource::TaskManagerExtensionProcessResource( base::Process process(extension_host_->render_process_host()->process()); process_handle_ = process.handle(); pid_ = process.pid(); - std::wstring extension_name(UTF8ToWide(extension()->name())); + std::wstring extension_name(UTF8ToWide(GetExtension()->name())); DCHECK(!extension_name.empty()); // Since the extension_name will be concatenated with a prefix, we need // to explicitly set the extension_name to be LTR format if there is no @@ -522,7 +522,7 @@ base::ProcessHandle TaskManagerExtensionProcessResource::GetProcess() const { return process_handle_; } -Extension* TaskManagerExtensionProcessResource::extension() const { +const Extension* TaskManagerExtensionProcessResource::GetExtension() const { return extension_host_->extension(); } @@ -572,6 +572,8 @@ void TaskManagerExtensionProcessResourceProvider::StartUpdating() { NotificationService::AllSources()); registrar_.Add(this, NotificationType::EXTENSION_PROCESS_CRASHED, NotificationService::AllSources()); + registrar_.Add(this, NotificationType::EXTENSION_HOST_DESTROYED, + NotificationService::AllSources()); } void TaskManagerExtensionProcessResourceProvider::StopUpdating() { @@ -583,6 +585,8 @@ void TaskManagerExtensionProcessResourceProvider::StopUpdating() { NotificationService::AllSources()); registrar_.Remove(this, NotificationType::EXTENSION_PROCESS_CRASHED, NotificationService::AllSources()); + registrar_.Remove(this, NotificationType::EXTENSION_HOST_DESTROYED, + NotificationService::AllSources()); // Delete all the resources. STLDeleteContainerPairSecondPointers(resources_.begin(), resources_.end()); @@ -600,6 +604,7 @@ void TaskManagerExtensionProcessResourceProvider::Observe( AddToTaskManager(Details<ExtensionHost>(details).ptr()); break; case NotificationType::EXTENSION_PROCESS_CRASHED: + case NotificationType::EXTENSION_HOST_DESTROYED: RemoveFromTaskManager(Details<ExtensionHost>(details).ptr()); break; default: |