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 51bae624a755f0a96dae3e0bea7c61ec11fea5fb..1027792ce66e567a30d97c3f143027c2c302f976 100644 |
--- a/components/startup_metric_utils/browser/startup_metric_utils.h |
+++ b/components/startup_metric_utils/browser/startup_metric_utils.h |
@@ -11,6 +11,9 @@ |
#include "base/time/time.h" |
#include "build/build_config.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 |
@@ -42,6 +45,9 @@ enum StartupTemperature { |
bool GetHardFaultCountForCurrentProcess(uint32_t* hard_fault_count); |
#endif // defined(OS_WIN) |
+// 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. |
@@ -74,6 +80,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); |