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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 10561009: Consolidate RecordBrowserStartupTime() into one location (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 017948bdead72be4f23b7fd4fa564755693945e4..0fe36acc32a6a1f700e038ac55d4bc4ff1a2221e 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -17,6 +17,7 @@
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
#include "base/path_service.h"
+#include "base/process_info.h"
#include "base/process_util.h"
#include "base/string_number_conversions.h"
#include "base/string_piece.h"
@@ -2002,6 +2003,19 @@ void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
// Misc ------------------------------------------------------------------------
+void RecordBrowserStartupTime() {
+// CurrentProcessInfo::CreationTime() is currently only implemented on Mac and
+// Windows.
+#if defined(OS_MACOSX) || defined(OS_WIN)
+ const base::Time *process_creation_time =
+ base::CurrentProcessInfo::CreationTime();
+
+ if (process_creation_time)
+ RecordPreReadExperimentTime("Startup.BrowserMessageLoopStartTime",
+ base::Time::Now() - *process_creation_time);
+#endif // OS_MACOSX || OS_WIN
+}
+
// This code is specific to the Windows-only PreReadExperiment field-trial.
void RecordPreReadExperimentTime(const char* name, base::TimeDelta time) {
DCHECK(name != NULL);

Powered by Google App Engine
This is Rietveld 408576698