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

Unified Diff: content/browser/renderer_host/resource_dispatcher_host_impl.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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/resource_dispatcher_host_impl.cc
diff --git a/content/browser/renderer_host/resource_dispatcher_host_impl.cc b/content/browser/renderer_host/resource_dispatcher_host_impl.cc
index dd6bf7de3b50124e89ef71be0938217fb2cd4334..18e3a10a5b771b4b48b4bec2871c6ea93c223e86 100644
--- a/content/browser/renderer_host/resource_dispatcher_host_impl.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host_impl.cc
@@ -261,11 +261,13 @@ net::RequestPriority DetermineRequestPriority(ResourceType::Type type) {
}
}
-void OnSwapOutACKHelper(int render_process_id, int render_view_id) {
+void OnSwapOutACKHelper(int render_process_id,
+ int render_view_id,
+ bool timed_out) {
RenderViewHostImpl* rvh = RenderViewHostImpl::FromID(render_process_id,
render_view_id);
if (rvh)
- rvh->OnSwapOutACK();
+ rvh->OnSwapOutACK(timed_out);
}
net::Error CallbackAndReturn(
@@ -1184,8 +1186,20 @@ ResourceRequestInfoImpl* ResourceDispatcherHostImpl::CreateRequestInfo(
context);
}
+
void ResourceDispatcherHostImpl::OnSwapOutACK(
+ const ViewMsg_SwapOut_Params& params) {
+ HandleSwapOutACK(params, false);
+}
+
+void ResourceDispatcherHostImpl::OnSimulateSwapOutACK(
const ViewMsg_SwapOut_Params& params) {
+ // Call the real implementation with true, which means that we timed out.
+ HandleSwapOutACK(params, true);
+}
+
+void ResourceDispatcherHostImpl::HandleSwapOutACK(
+ const ViewMsg_SwapOut_Params& params, bool timed_out) {
// Closes for cross-site transitions are handled such that the cross-site
// transition continues.
ResourceLoader* loader = GetLoader(params.new_render_process_host_id,
@@ -1203,7 +1217,8 @@ void ResourceDispatcherHostImpl::OnSwapOutACK(
FROM_HERE,
base::Bind(&OnSwapOutACKHelper,
params.closing_process_id,
- params.closing_route_id));
+ params.closing_route_id,
+ timed_out));
}
void ResourceDispatcherHostImpl::OnDidLoadResourceFromMemoryCache(

Powered by Google App Engine
This is Rietveld 408576698