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

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_gtk.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
Index: chrome/browser/renderer_host/render_widget_host_view_gtk.cc
diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
index b54aba3e9e2749c8fe9e96e301162ee6495189f7..b19cb46e66f3e424a4bcc0dbfa2f8606d122c23e 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -376,6 +376,8 @@ void RenderWidgetHostViewGtk::DidBecomeSelected() {
if (!is_hidden_)
return;
+ if (tab_switch_paint_time_.is_null())
+ tab_switch_paint_time_ = base::TimeTicks::Now();
is_hidden_ = false;
host_->WasRestored();
}
@@ -595,6 +597,15 @@ void RenderWidgetHostViewGtk::Paint(const gfx::Rect& damage_rect) {
// time the backing store is NULL...
whiteout_start_time_ = base::TimeTicks();
}
+ if (!tab_switch_paint_time_.is_null()) {
+ base::TimeDelta tab_switch_paint_duration = base::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_ = base::TimeTicks();
+ }
} else {
if (window)
gdk_window_clear(window);
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_gtk.h ('k') | chrome/browser/renderer_host/render_widget_host_view_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698