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

Unified Diff: chrome/browser/task_manager_resource_providers.cc

Issue 300005: Correctly handle extension reloading in the task manager.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 11 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/task_manager_resource_providers.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/task_manager_resource_providers.cc
===================================================================
--- chrome/browser/task_manager_resource_providers.cc (revision 29395)
+++ chrome/browser/task_manager_resource_providers.cc (working copy)
@@ -493,7 +493,7 @@
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 @@
return process_handle_;
}
-Extension* TaskManagerExtensionProcessResource::extension() const {
+const Extension* TaskManagerExtensionProcessResource::GetExtension() const {
return extension_host_->extension();
}
@@ -572,6 +572,8 @@
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 @@
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 @@
AddToTaskManager(Details<ExtensionHost>(details).ptr());
break;
case NotificationType::EXTENSION_PROCESS_CRASHED:
+ case NotificationType::EXTENSION_HOST_DESTROYED:
RemoveFromTaskManager(Details<ExtensionHost>(details).ptr());
break;
default:
« no previous file with comments | « chrome/browser/task_manager_resource_providers.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698