Index: chrome/browser/dom_ui/new_tab_ui.h |
diff --git a/chrome/browser/dom_ui/new_tab_ui.h b/chrome/browser/dom_ui/new_tab_ui.h |
index 40add0320fe99614b6610a80a76ebbe995c4217a..55275428baf0f03b5b39dbd7e3056d95124a4a31 100644 |
--- a/chrome/browser/dom_ui/new_tab_ui.h |
+++ b/chrome/browser/dom_ui/new_tab_ui.h |
@@ -9,6 +9,7 @@ |
#include <string> |
#include "base/gtest_prod_util.h" |
+#include "base/timer.h" |
#include "chrome/browser/dom_ui/dom_ui.h" |
#include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
#include "chrome/browser/sessions/tab_restore_service.h" |
@@ -88,6 +89,25 @@ class NewTabUI : public DOMUI, |
private: |
FRIEND_TEST_ALL_PREFIXES(NewTabUITest, UpdateUserPrefsVersion); |
+ class PaintTimer : public NotificationObserver { |
+ public: |
+ PaintTimer(RenderViewHost* render_view_host); |
+ |
+ private: |
+ void Timeout(); |
+ virtual void Observe(NotificationType type, |
+ const NotificationSource& source, |
+ const NotificationDetails& details); |
+ NotificationRegistrar registrar_; |
brettw
2011/01/03 19:48:30
Can you put a blank line above this?
|
+ // The time when we started benchmarking. |
+ base::TimeTicks start_; |
+ // The last time we got a paint notification. |
+ base::TimeTicks last_paint_; |
+ // Scoping so we can be sure our timeouts don't outlive us. |
+ base::OneShotTimer<PaintTimer> timer_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(PaintTimer); |
+ }; |
virtual void Observe(NotificationType type, |
const NotificationSource& source, |
@@ -102,6 +122,8 @@ class NewTabUI : public DOMUI, |
NotificationRegistrar registrar_; |
+ scoped_ptr<PaintTimer> paint_timer_; |
+ |
// The preference version. This used for migrating prefs of the NTP. |
static const int current_pref_version_ = 3; |