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

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

Issue 841443002: mac: Add a metric for the time blocked by WaitForSurface(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from ccameron. Created 5 years, 11 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 | « no previous file | tools/metrics/histograms/histograms.xml » ('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 986bda4ecce621a7506bd15622cf455f13b29864..8da65865fa9f54be685a9bf3f06afc858ea86891 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -805,7 +805,8 @@ void RenderWidgetHostImpl::WaitForSurface() {
}
TimeDelta max_delay = TimeDelta::FromMilliseconds(kPaintMsgTimeoutMS);
- TimeTicks end_time = TimeTicks::Now() + max_delay;
+ TimeTicks start_time = TimeTicks::Now();
+ TimeDelta elapsed_delay;
do {
TRACE_EVENT0("renderer_host", "WaitForSurface::WaitForUpdate");
@@ -833,8 +834,12 @@ void RenderWidgetHostImpl::WaitForSurface() {
// BackingStore yet. This is necessary to support the GPU path which
// typically has multiple frames pipelined -- we may need to skip one or two
// BackingStore messages to get to the latest.
- max_delay = end_time - TimeTicks::Now();
- } while (max_delay > TimeDelta::FromSeconds(0));
+ elapsed_delay = TimeTicks::Now() - start_time;
+ } while (elapsed_delay < max_delay);
+
+ UMA_HISTOGRAM_CUSTOM_TIMES("OSX.RendererHost.SurfaceWaitTime", elapsed_delay,
+ TimeDelta::FromMilliseconds(1),
+ TimeDelta::FromMilliseconds(200), 50);
}
#endif
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698