Chromium Code Reviews| Index: chrome/browser/extensions/extension_host.cc |
| =================================================================== |
| --- chrome/browser/extensions/extension_host.cc (revision 34318) |
| +++ chrome/browser/extensions/extension_host.cc (working copy) |
| @@ -131,6 +131,8 @@ |
| // to the task manager then. |
| registrar_.Add(this, NotificationType::RENDERER_PROCESS_CREATED, |
| Source<RenderProcessHost>(render_process_host())); |
| + registrar_.Add(this, NotificationType::RENDERER_PROCESS_CLOSED, |
| + Source<RenderProcessHost>(render_process_host())); |
| } |
| ExtensionHost::~ExtensionHost() { |
| @@ -231,6 +233,18 @@ |
| NotificationType::EXTENSION_PROCESS_CREATED, |
| Source<Profile>(profile_), |
| Details<ExtensionHost>(this)); |
| + } else if (type == NotificationType::RENDERER_PROCESS_CLOSED) { |
| + Details<RenderProcessHost::RendererClosedDetails> closed_details = |
| + static_cast<Details<RenderProcessHost::RendererClosedDetails> >( |
| + details); |
| + if (!closed_details->did_crash) |
| + return; |
| + |
|
Matt Perry
2009/12/11 01:54:52
nit: add DCHECK(closed_details->was_extension_rend
|
| + LOG(INFO) << "Sending EXTENSION_PROCESS_CRASHED for " + extension_->name(); |
| + NotificationService::current()->Notify( |
| + NotificationType::EXTENSION_PROCESS_CRASHED, |
| + Source<Profile>(profile_), |
| + Details<ExtensionHost>(this)); |
| } else { |
| NOTREACHED(); |
| } |
| @@ -241,15 +255,6 @@ |
| view_->UpdatePreferredSize(new_size); |
| } |
| -void ExtensionHost::RenderViewGone(RenderViewHost* render_view_host) { |
| - LOG(INFO) << "Sending EXTENSION_PROCESS_CRASHED for " + extension_->name(); |
| - DCHECK_EQ(render_view_host_, render_view_host); |
| - NotificationService::current()->Notify( |
| - NotificationType::EXTENSION_PROCESS_CRASHED, |
| - Source<Profile>(profile_), |
| - Details<ExtensionHost>(this)); |
| -} |
| - |
| void ExtensionHost::DidNavigate(RenderViewHost* render_view_host, |
| const ViewHostMsg_FrameNavigate_Params& params) { |
| // We only care when the outer frame changes. |