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

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

Issue 10907182: Add UMA counter for hung renderers on cross-site navigation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 if (pending_render_view_host_->are_navigations_suspended()) 188 if (pending_render_view_host_->are_navigations_suspended())
189 pending_render_view_host_->SetNavigationsSuspended(false); 189 pending_render_view_host_->SetNavigationsSuspended(false);
190 } else { 190 } else {
191 // The request has been started and paused while we're waiting for the 191 // The request has been started and paused while we're waiting for the
192 // unload handler to finish. We'll pretend that it did, by notifying the 192 // unload handler to finish. We'll pretend that it did, by notifying the
193 // IO thread to let the response continue. The pending renderer will then 193 // IO thread to let the response continue. The pending renderer will then
194 // be swapped in as part of the usual DidNavigate logic. (If the unload 194 // be swapped in as part of the usual DidNavigate logic. (If the unload
195 // handler later finishes, this call will be ignored because the state in 195 // handler later finishes, this call will be ignored because the state in
196 // CrossSiteResourceHandler will already be cleaned up.) 196 // CrossSiteResourceHandler will already be cleaned up.)
197 ViewMsg_SwapOut_Params params; 197 ViewMsg_SwapOut_Params params;
198 params.closing_process_id = render_view_host_->GetProcess()->GetID();
199 params.closing_route_id = render_view_host_->GetRoutingID();
198 params.new_render_process_host_id = 200 params.new_render_process_host_id =
199 pending_render_view_host_->GetProcess()->GetID(); 201 pending_render_view_host_->GetProcess()->GetID();
200 params.new_request_id = pending_request_id; 202 params.new_request_id = pending_request_id;
201 current_host()->GetProcess()->CrossSiteSwapOutACK(params); 203 current_host()->GetProcess()->SimulateSwapOutACK(params);
202 } 204 }
203 return false; 205 return false;
204 } 206 }
205 207
206 void RenderViewHostManager::DidNavigateMainFrame( 208 void RenderViewHostManager::DidNavigateMainFrame(
207 RenderViewHost* render_view_host) { 209 RenderViewHost* render_view_host) {
208 if (!cross_navigation_pending_) { 210 if (!cross_navigation_pending_) {
209 DCHECK(!pending_render_view_host_); 211 DCHECK(!pending_render_view_host_);
210 212
211 // We should only hear this from our current renderer. 213 // We should only hear this from our current renderer.
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
964 } 966 }
965 967
966 RenderViewHostImpl* RenderViewHostManager::GetSwappedOutRenderViewHost( 968 RenderViewHostImpl* RenderViewHostManager::GetSwappedOutRenderViewHost(
967 SiteInstance* instance) { 969 SiteInstance* instance) {
968 RenderViewHostMap::iterator iter = swapped_out_hosts_.find(instance->GetId()); 970 RenderViewHostMap::iterator iter = swapped_out_hosts_.find(instance->GetId());
969 if (iter != swapped_out_hosts_.end()) 971 if (iter != swapped_out_hosts_.end())
970 return iter->second; 972 return iter->second;
971 973
972 return NULL; 974 return NULL;
973 } 975 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698