Index: components/startup_metric_utils/browser/startup_metric_utils.h |
diff --git a/components/startup_metric_utils/browser/startup_metric_utils.h b/components/startup_metric_utils/browser/startup_metric_utils.h |
index c0391ff89c91655d6ea671e11b0ded86bc7c6fee..fde9f361db823888bb3285fcac0e59d68308ff21 100644 |
--- a/components/startup_metric_utils/browser/startup_metric_utils.h |
+++ b/components/startup_metric_utils/browser/startup_metric_utils.h |
@@ -9,6 +9,9 @@ |
#include "base/time/time.h" |
+class PrefRegistrySimple; |
+class PrefService; |
+ |
// Utility functions to support metric collection for browser startup. Timings |
// should use TimeTicks whenever possible. OS-provided timings are still |
// received as Time out of cross-platform support necessity but are converted to |
@@ -36,6 +39,9 @@ enum StartupTemperature { |
UNDETERMINED_STARTUP_TEMPERATURE |
}; |
+// Registers startup related prefs in |registry|. |
+void RegisterPrefs(PrefRegistrySimple* registry); |
+ |
// Returns true if any UI other than the browser window has been displayed |
// so far. Useful to test if UI has been displayed before the first browser |
// window was shown, which would invalidate any surrounding timing metrics. |
@@ -68,6 +74,13 @@ void RecordExeMainEntryPointTime(const base::Time& time); |
void RecordBrowserMainMessageLoopStart(const base::TimeTicks& ticks, |
bool is_first_run); |
+// Logs the Startup.TimeSinceLastStartup histogram. Obtains the timestamp of the |
+// last startup from |pref_service| and overwrites it with the timestamp of the |
+// current startup. If the startup temperature has been set by |
+// RecordBrowserMainMessageLoopStart, the time since last startup is also logged |
+// to an histogram suffixed with the startup temperature. |
+void RecordTimeSinceLastStartup(PrefService* pref_service); |
+ |
// Call this with the time when the first browser window became visible. |
void RecordBrowserWindowDisplay(const base::TimeTicks& ticks); |