diff options
Diffstat (limited to 'chrome/browser/renderer_host')
3 files changed, 22 insertions, 28 deletions
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index f7fb092..fff6622 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -860,12 +860,23 @@ void BrowserRenderProcessHost::OnChannelError() { if (!channel_.get()) return; + // NULL in single process mode or if fast termination happened. + bool did_crash = + child_process_.get() ? child_process_->DidProcessCrash() : false; + + if (did_crash) { + UMA_HISTOGRAM_PERCENTAGE("BrowserRenderProcessHost.ChildCrashes", + extension_process_ ? 2 : 1); + } + + RendererClosedDetails details(did_crash, extension_process_); NotificationService::current()->Notify( NotificationType::RENDERER_PROCESS_CLOSED, Source<RenderProcessHost>(this), - NotificationService::NoDetails()); + Details<RendererClosedDetails>(&details)); WebCacheManager::GetInstance()->Remove(id()); + child_process_.reset(); channel_.reset(); IDMap<IPC::Channel::Listener>::iterator iter(&listeners_); @@ -877,32 +888,6 @@ void BrowserRenderProcessHost::OnChannelError() { ClearTransportDIBCache(); - if (child_process_.get()) { - // Determine whether the process crashed or not. This method will invoke - // OnDidProcessCrashDetermined with the result. This may occur - // asynchronously. - child_process_->DetermineDidProcessCrash(); - } else { - // This occurs in single process mode or if fast termination happened. - // Manually trigger OnDidProcessCrashDetermined, because we know this is - // not a crash. - OnDidProcessCrashDetermined(false); - } -} - -void BrowserRenderProcessHost::OnDidProcessCrashDetermined(bool did_crash) { - child_process_.reset(); - - if (did_crash) { - UMA_HISTOGRAM_PERCENTAGE("BrowserRenderProcessHost.ChildCrashes", - extension_process_ ? 2 : 1); - - NotificationService::current()->Notify( - NotificationType::RENDERER_PROCESS_CRASHED, - Source<RenderProcessHost>(this), - Details<bool>(&extension_process_)); - } - // this object is not deleted at this point and may be reused later. // TODO(darin): clean this up } diff --git a/chrome/browser/renderer_host/browser_render_process_host.h b/chrome/browser/renderer_host/browser_render_process_host.h index 00c2a02..2a7f8b6 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.h +++ b/chrome/browser/renderer_host/browser_render_process_host.h @@ -100,7 +100,6 @@ class BrowserRenderProcessHost : public RenderProcessHost, // ChildProcessLauncher::Client implementation. virtual void OnProcessLaunched(); - virtual void OnDidProcessCrashDetermined(bool did_crash); private: friend class VisitRelayingRenderProcessHost; diff --git a/chrome/browser/renderer_host/render_process_host.h b/chrome/browser/renderer_host/render_process_host.h index 1eb9804..1ceeb42 100644 --- a/chrome/browser/renderer_host/render_process_host.h +++ b/chrome/browser/renderer_host/render_process_host.h @@ -46,6 +46,16 @@ class RenderProcessHost : public IPC::Channel::Sender, TYPE_EXTENSION, // Renderer with extension privileges. }; + // Details for RENDERER_PROCESS_CLOSED notifications. + struct RendererClosedDetails { + RendererClosedDetails(bool did_crash, bool was_extension_renderer) { + this->did_crash = did_crash; + this->was_extension_renderer = was_extension_renderer; + } + bool did_crash; + bool was_extension_renderer; + }; + explicit RenderProcessHost(Profile* profile); virtual ~RenderProcessHost(); |
