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

Unified Diff: chrome/browser/browser.cc

Issue 242107: Add histograms that track how long it takes to open the new tab page. (Closed)
Patch Set: comments Created 11 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/dom_ui/new_tab_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser.cc
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index e0cc0478e8f873866da5d7e36ee40e25a0633081..122310199ae2dc4981049828c7ff055d1695308a 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -1512,8 +1512,14 @@ TabContents* Browser::AddBlankTab(bool foreground) {
}
TabContents* Browser::AddBlankTabAt(int index, bool foreground) {
- return AddTabWithURL(GURL(chrome::kChromeUINewTabURL), GURL(),
- PageTransition::TYPED, foreground, index, false, NULL);
+ // Time new tab page creation time. We keep track of the timing data in
+ // TabContents, but we want to include the time it takes to create the
+ // TabContents object too.
+ base::TimeTicks new_tab_start_time = base::TimeTicks::Now();
+ TabContents* tab_contents = AddTabWithURL(GURL(chrome::kChromeUINewTabURL),
+ GURL(), PageTransition::TYPED, foreground, index, false, NULL);
+ tab_contents->set_new_tab_start_time(new_tab_start_time);
+ return tab_contents;
}
Browser* Browser::CreateNewStripWithContents(TabContents* detached_contents,
« no previous file with comments | « no previous file | chrome/browser/dom_ui/new_tab_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698