summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-25 16:47:38 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-25 16:47:38 +0000
commit120e1f1b2728ae5d1d4fed21bddb3533b921fdba (patch)
treea98843fd8911bade1e6da4b75ff99b68e268afea /chrome/browser/renderer_host
parent82810fe1c2733add9da822ee5434c46d123a4fc2 (diff)
downloadchromium_src-120e1f1b2728ae5d1d4fed21bddb3533b921fdba.zip
chromium_src-120e1f1b2728ae5d1d4fed21bddb3533b921fdba.tar.gz
chromium_src-120e1f1b2728ae5d1d4fed21bddb3533b921fdba.tar.bz2
Calculate whiteout duration on linux (the time we draw green
or white because of no backing store). This is mainly just a copy of the Windows code (mac has it too). Review URL: http://codereview.chromium.org/220043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27195 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_gtk.cc11
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_gtk.h6
2 files changed, 17 insertions, 0 deletions
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 56b64ad..0f680bc 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -571,9 +571,20 @@ void RenderWidgetHostViewGtk::Paint(const gfx::Rect& damage_rect) {
backing_store->ShowRect(
paint_rect, x11_util::GetX11WindowFromGtkWidget(view_.get()));
}
+ if (!whiteout_start_time_.is_null()) {
+ base::TimeDelta whiteout_duration = base::TimeTicks::Now() -
+ whiteout_start_time_;
+ UMA_HISTOGRAM_TIMES("MPArch.RWHH_WhiteoutDuration", whiteout_duration);
+
+ // Reset the start time to 0 so that we start recording again the next
+ // time the backing store is NULL...
+ whiteout_start_time_ = base::TimeTicks();
+ }
} else {
if (window)
gdk_window_clear(window);
+ if (whiteout_start_time_.is_null())
+ whiteout_start_time_ = base::TimeTicks::Now();
}
}
diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.h b/chrome/browser/renderer_host/render_widget_host_view_gtk.h
index 102eb09..2f7e6b3 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_gtk.h
+++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.h
@@ -13,6 +13,7 @@
#include "base/gfx/native_widget_types.h"
#include "base/scoped_ptr.h"
+#include "base/time.h"
#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/common/owned_widget_gtk.h"
#include "webkit/glue/plugins/gtk_plugin_container_manager.h"
@@ -113,6 +114,11 @@ class RenderWidgetHostViewGtk : public RenderWidgetHostView {
// Whether we are showing a context menu.
bool is_showing_context_menu_;
+ // The time at which this view started displaying white pixels as a result of
+ // not having anything to paint (empty backing store from renderer). This
+ // value returns true for is_null() if we are not recording whiteout times.
+ base::TimeTicks whiteout_start_time_;
+
// Variables used only for popups --------------------------------------------
// Our parent widget.
RenderWidgetHostView* parent_host_view_;