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

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_win.cc

Issue 378038: Add a RWH_TabSwitchPaintDuration histogram. (Closed)
Patch Set: remove tab switching test changes Created 11 years, 1 month 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 | « chrome/browser/renderer_host/render_widget_host_view_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/render_widget_host_view_win.cc
diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc
index f97d24973d9be7ffb0c976be15bcf43b995785a7..d01c410f9cbecc1fa33e2a78084ae388e5bcc7f6 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_win.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc
@@ -255,6 +255,8 @@ void RenderWidgetHostViewWin::DidBecomeSelected() {
if (!is_hidden_)
return;
+ if (tab_switch_paint_time_.is_null())
+ tab_switch_paint_time_ = TimeTicks::Now();
is_hidden_ = false;
EnsureTooltip();
render_widget_host_->WasRestored();
@@ -793,6 +795,15 @@ void RenderWidgetHostViewWin::OnPaint(HDC dc) {
// time the backing store is NULL...
whiteout_start_time_ = TimeTicks();
}
+ if (!tab_switch_paint_time_.is_null()) {
+ TimeDelta tab_switch_paint_duration = TimeTicks::Now() -
+ tab_switch_paint_time_;
+ UMA_HISTOGRAM_TIMES("MPArch.RWH_TabSwitchPaintDuration",
+ tab_switch_paint_duration);
+ // Reset tab_switch_paint_time_ to 0 so future tab selections are
+ // recorded.
+ tab_switch_paint_time_ = TimeTicks();
+ }
} else {
DrawBackground(paint_dc.m_ps.rcPaint, &paint_dc);
if (whiteout_start_time_.is_null())
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698