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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 14931012: Add support for latency measurement to Telemetry smoothness benchmarks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | content/common/browser_rendering_stats.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 5cb74b81de044e766d43d3eca2a2f7dd5e5c203e..fa663baa13ff5d2cdce4be1f0b4c87b30e3d35c6 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -2502,6 +2502,20 @@ void RenderWidgetHostImpl::DetachDelegate() {
}
void RenderWidgetHostImpl::FrameSwapped(const ui::LatencyInfo& latency_info) {
+ ui::LatencyInfo::LatencyMap::const_iterator l =
+ latency_info.latency_components.find(std::make_pair(
+ ui::INPUT_EVENT_LATENCY_COMPONENT, GetLatencyComponentId()));
+ if (l == latency_info.latency_components.end())
+ return;
+
+ rendering_stats_.input_event_count += l->second.event_count;
+ rendering_stats_.total_input_latency +=
+ l->second.event_count *
+ (latency_info.swap_timestamp - l->second.event_time);
+
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableGpuBenchmarking))
+ Send(new ViewMsg_SetBrowserRenderingStats(routing_id_, rendering_stats_));
}
} // namespace content
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | content/common/browser_rendering_stats.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698