diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-02 23:58:05 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-02 23:58:05 +0000 |
commit | 3f8eb7f922bf949df0f2985a3a58830f8203cda2 (patch) | |
tree | 0b8a39d52681f6e02358649c2af9bec4fb2ded5f /chrome/browser/browser.cc | |
parent | ccd7db7332c10277f91bce84326e830b9961d822 (diff) | |
download | chromium_src-3f8eb7f922bf949df0f2985a3a58830f8203cda2.zip chromium_src-3f8eb7f922bf949df0f2985a3a58830f8203cda2.tar.gz chromium_src-3f8eb7f922bf949df0f2985a3a58830f8203cda2.tar.bz2 |
Add histograms that track how long it takes to open the new tab page.
This doesn't time all loads of the new tab page, just new foreground
tabs using ctrl+t or the plus button. This includes the time it takes
to create the tab contents and logs the time until JS has started
executing, domcontentloaded, and onload.
Note: onload doesn't mean the page is done loading. We have "NewTabUI load" for that.
BUG=23120
Review URL: http://codereview.chromium.org/242107
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27918 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r-- | chrome/browser/browser.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index e0cc047..1223101 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, |