Chromium Code Reviews| 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..ebf9d6c035335de437426230a307128e21df5d36 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 metric related prefs in |registry|. |
|
gab
2016/01/06 19:26:17
s/startup metric related/startup related/ ?
fdoray
2016/01/07 13:53:06
Done.
|
| +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 the Startup.TimeSinceLastStartup histogram. Obtains the timestamp of |
|
gab
2016/01/06 19:26:16
"the the"
fdoray
2016/01/07 13:53:06
Done.
|
| +// 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); |