diff options
author | creis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-12 17:12:10 +0000 |
---|---|---|
committer | creis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-12 17:12:10 +0000 |
commit | f380ed66f7b2f301e7f5b0a615665659644e8393 (patch) | |
tree | 942ca2d172006d46c8f1d53263636b94250cb6a3 /content/browser/renderer_host/render_view_host_impl.cc | |
parent | e3b2015196458c983c82315c4567dbd4f6b43efd (diff) | |
download | chromium_src-f380ed66f7b2f301e7f5b0a615665659644e8393.zip chromium_src-f380ed66f7b2f301e7f5b0a615665659644e8393.tar.gz chromium_src-f380ed66f7b2f301e7f5b0a615665659644e8393.tar.bz2 |
Revert 126151 - Fixing a problem, where a hung renderer process is not killed when navigating away
BUG=104346
TEST=Steps to reproduce listed in the bug.
Review URL: https://chromiumcodereview.appspot.com/9514016
Patch from Nasko Oskov <nasko@chromium.org>.
TBR=creis@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9690020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126159 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host/render_view_host_impl.cc')
-rw-r--r-- | content/browser/renderer_host/render_view_host_impl.cc | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc index cf2593f..daf17c7 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc @@ -41,7 +41,6 @@ #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_types.h" -#include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host_delegate.h" #include "content/public/browser/render_view_host_observer.h" #include "content/public/browser/user_metrics.h" @@ -419,12 +418,6 @@ void RenderViewHostImpl::WasSwappedOut() { // Don't bother reporting hung state anymore. StopHangMonitorTimeout(); - // If we are still waiting on the unload handler to be run, we consider - // the process hung and we should terminate it if there are no other tabs - // using the process. If there are other views using this process, the - // unresponsive renderer timeout will catch it. - bool hung = is_waiting_for_unload_ack_; - // Now that we're no longer the active RVH in the tab, start filtering out // most IPC messages. Usually the renderer will have stopped sending // messages as of OnSwapOutACK. However, we may have timed out waiting @@ -433,39 +426,6 @@ void RenderViewHostImpl::WasSwappedOut() { // still allow synchronous messages through). SetSwappedOut(true); - // If we are not running the renderer in process and no other tab is using - // the hung process, kill it, assuming it is a real process (unit tests don't - // have real processes). - if (hung) { - base::ProcessHandle process_handle = GetProcess()->GetHandle(); - int views = 0; - - // Count the number of listeners for the process, which is equivalent to - // views using the process as of this writing. - content::RenderProcessHost::listeners_iterator iter( - GetProcess()->ListenersIterator()); - for (; !iter.IsAtEnd(); iter.Advance()) - ++views; - - if (!content::RenderProcessHost::run_renderer_in_process() && - process_handle && views <= 1) { - // We expect the delegate for this RVH to be TabContents, as it is the - // only class that swaps out render view hosts on navigation. - DCHECK(delegate_->GetRenderViewType() == content::VIEW_TYPE_TAB_CONTENTS); - - // Kill the process only if TabContents sets SuddenTerminationAllowed, - // which indicates that the timer has expired. - // This is not the case if we load data URLs or about:blank. The reason - // is that there is no network requests and this code is hit without - // setting the unresponsiveness timer. This allows a corner case where a - // navigation to a data URL will leave a process running, if the - // beforeunload handler completes fine, but the unload handler hangs. - // At this time, the complexity to solve this edge case is not worthwhile. - if (SuddenTerminationAllowed()) - base::KillProcess(process_handle, content::RESULT_CODE_HUNG, false); - } - } - // Inform the renderer that it can exit if no one else is using it. Send(new ViewMsg_WasSwappedOut(GetRoutingID())); } |