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

Side by Side Diff: content/browser/web_contents/render_view_host_manager.cc

Issue 10065028: Fixing a problem, where a hung renderer process is not killed when navigating away (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/web_contents/render_view_host_manager.h" 5 #include "content/browser/web_contents/render_view_host_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 if (pending_render_view_host_->are_navigations_suspended()) 180 if (pending_render_view_host_->are_navigations_suspended())
181 pending_render_view_host_->SetNavigationsSuspended(false); 181 pending_render_view_host_->SetNavigationsSuspended(false);
182 } else { 182 } else {
183 // The request has been started and paused while we're waiting for the 183 // The request has been started and paused while we're waiting for the
184 // unload handler to finish. We'll pretend that it did, by notifying the 184 // unload handler to finish. We'll pretend that it did, by notifying the
185 // IO thread to let the response continue. The pending renderer will then 185 // IO thread to let the response continue. The pending renderer will then
186 // be swapped in as part of the usual DidNavigate logic. (If the unload 186 // be swapped in as part of the usual DidNavigate logic. (If the unload
187 // handler later finishes, this call will be ignored because the state in 187 // handler later finishes, this call will be ignored because the state in
188 // CrossSiteResourceHandler will already be cleaned up.) 188 // CrossSiteResourceHandler will already be cleaned up.)
189 ViewMsg_SwapOut_Params params; 189 ViewMsg_SwapOut_Params params;
190 params.closing_process_id = render_view_host_->GetProcess()->GetID();
191 params.closing_route_id = render_view_host_->GetRoutingID();
190 params.new_render_process_host_id = 192 params.new_render_process_host_id =
191 pending_render_view_host_->GetProcess()->GetID(); 193 pending_render_view_host_->GetProcess()->GetID();
192 params.new_request_id = pending_request_id; 194 params.new_request_id = pending_request_id;
193 current_host()->GetProcess()->CrossSiteSwapOutACK(params); 195 current_host()->GetProcess()->SimulateSwapOutACK(params);
194 } 196 }
195 return false; 197 return false;
196 } 198 }
197 199
198 void RenderViewHostManager::DidNavigateMainFrame( 200 void RenderViewHostManager::DidNavigateMainFrame(
199 RenderViewHost* render_view_host) { 201 RenderViewHost* render_view_host) {
200 if (!cross_navigation_pending_) { 202 if (!cross_navigation_pending_) {
201 DCHECK(!pending_render_view_host_); 203 DCHECK(!pending_render_view_host_);
202 204
203 // We should only hear this from our current renderer. 205 // We should only hear this from our current renderer.
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 } 832 }
831 } 833 }
832 834
833 bool RenderViewHostManager::IsSwappedOut(RenderViewHost* rvh) { 835 bool RenderViewHostManager::IsSwappedOut(RenderViewHost* rvh) {
834 if (!rvh->GetSiteInstance()) 836 if (!rvh->GetSiteInstance())
835 return false; 837 return false;
836 838
837 return swapped_out_hosts_.find(rvh->GetSiteInstance()->GetId()) != 839 return swapped_out_hosts_.find(rvh->GetSiteInstance()->GetId()) !=
838 swapped_out_hosts_.end(); 840 swapped_out_hosts_.end();
839 } 841 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698