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

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: Improve code comments Created 8 years, 5 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/ui/cocoa/simple_message_box_mac.mm » ('j') | 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 1676d6d7feed19f1b6398f9f9f96158efc308d29..ccb133cc8b7958d00f3d02d81f347fee3bd9f868 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"
@@ -152,6 +153,7 @@
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/profiling.h"
+#include "chrome/common/startup_metric_utils.h"
#include "chrome/common/url_constants.h"
#include "chrome/common/web_apps.h"
#include "content/public/browser/color_chooser.h"
@@ -1195,6 +1197,26 @@ 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)
+ // Measure the latency from startup till the first browser window becomes
+ // visible.
+ static bool is_first_browser_window = true;
+ if (is_first_browser_window &&
+ !startup_metric_utils::WasNonBrowserUIDisplayed()) {
+ is_first_browser_window = 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 | chrome/browser/ui/cocoa/simple_message_box_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698