Chromium Code Reviews| Index: chrome/browser/ui/browser.cc |
| diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc |
| index 478acf76fe8a8eea71e4551f5d135f1655591199..6271aa3e16f5cf0845066591ed7d53d9da32a396 100644 |
| --- a/chrome/browser/ui/browser.cc |
| +++ b/chrome/browser/ui/browser.cc |
| @@ -19,6 +19,7 @@ |
| #include "base/metrics/field_trial.h" |
| #include "base/metrics/histogram.h" |
| #include "base/path_service.h" |
| +#include "base/process_info.h" |
| #include "base/string_number_conversions.h" |
| #include "base/string_util.h" |
| #include "base/stringprintf.h" |
| @@ -1978,6 +1979,25 @@ void Browser::OnWindowDidShow() { |
| return; |
| window_has_shown_ = true; |
| +// CurrentProcessInfo::CreationTime() is currently only implemented on Mac and |
| +// Windows. |
| +#if defined(OS_MACOSX) || defined(OS_WIN) |
|
sky
2012/06/26 16:14:15
Aren't there a number of code paths that could res
|
| + // Measure the latency from startup till the first browser window becomes |
| + // visible. |
| + static bool isFirstBrowserWindow = true; |
| + if (isFirstBrowserWindow) { |
| + isFirstBrowserWindow = false; |
| + const base::Time* process_creation_time = |
| + base::CurrentProcessInfo::CreationTime(); |
| + |
| + if (process_creation_time) { |
| + UMA_HISTOGRAM_LONG_TIMES( |
| + "Startup.BrowserWindowDisplay", |
| + base::Time::Now() - *process_creation_time); |
| + } |
| + } |
| +#endif // OS_MACOSX || OS_WIN |
| + |
| // Nothing to do for non-tabbed windows. |
| if (!is_type_tabbed()) |
| return; |