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

Unified Diff: chrome/browser/ui/browser.cc

Issue 10662046: Add a histogram to measure browser window display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix style nit Created 8 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698