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

Unified Diff: chrome/browser/dom_ui/new_tab_ui.h

Issue 6010004: Refactor RenderWidgetHost::set_paint_observer() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove helper classes per review Created 9 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
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..95f86f4113cf1ac822febe20c91f7d73c558506c 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"
@@ -96,12 +97,21 @@ class NewTabUI : public DOMUI,
// Reset the CSS caches.
void InitializeCSSCaches();
+ void StartTimingPaint(RenderViewHost* render_view_host);
+ void PaintTimeout();
+
// Updates the user prefs version and calls |MigrateUserPrefs| if needed.
// Returns true if the version was updated.
static bool UpdateUserPrefsVersion(PrefService* prefs);
NotificationRegistrar registrar_;
+ // 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<NewTabUI> timer_;
// The preference version. This used for migrating prefs of the NTP.
static const int current_pref_version_ = 3;

Powered by Google App Engine
This is Rietveld 408576698