From 7ea7ec4f52496cd65e8917b522df445bc9fd63f5 Mon Sep 17 00:00:00 2001 From: "tc@google.com" Date: Thu, 26 Mar 2009 21:05:07 +0000 Subject: Fix fast shutdown The check for unload handlers was backwards. This bug was introduced in r7901 . Also, remove the call to process_.Close(). When we Terminate the process, we get a IPC channel error and BrowserRenderProcessHost::OnChannelError gets called. This method needs the handle so it can call DidProcessCrash. It also does the call to process_.Close() for us. Review URL: http://codereview.chromium.org/42653 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12597 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/renderer_host/browser_render_process_host.cc | 1 - chrome/browser/renderer_host/render_view_host.cc | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index c694fdd..e8bb8b7b 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -494,7 +494,6 @@ bool BrowserRenderProcessHost::FastShutdownIfPossible() { // Otherwise, we're allowed to just terminate the process. Using exit code 0 // means that UMA won't treat this as a renderer crash. process_.Terminate(ResultCodes::NORMAL_EXIT); - process_.Close(); return true; } diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index e820f47..a8b7ad4 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -659,7 +659,7 @@ bool RenderViewHost::CanTerminate() const { if (!delegate_->CanTerminate()) return false; - return has_unload_listener_; + return !has_unload_listener_; } /////////////////////////////////////////////////////////////////////////////// -- cgit v1.1