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 b071321b73a1b80ddf1f8050ed3ec36dced300b1..2b2885f61a9141bbad9ecf0bacc1b6c98ee5e281 100644 |
--- a/components/startup_metric_utils/browser/startup_metric_utils.h |
+++ b/components/startup_metric_utils/browser/startup_metric_utils.h |
@@ -9,7 +9,11 @@ |
#include "base/time/time.h" |
-// Utility functions to support metric collection for browser startup. |
+// 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 |
+// TimeTicks as soon as possible in an attempt to reduce the potential skew |
+// between the two basis. See crbug.com/544131 for reasoning. |
namespace startup_metric_utils { |
@@ -59,43 +63,45 @@ void RecordExeMainEntryPointTime(const base::Time& time); |
// Call this with the time recorded just before the message loop is started. |
// |is_first_run| - is the current launch part of a first run. |
-void RecordBrowserMainMessageLoopStart(const base::Time& time, |
+void RecordBrowserMainMessageLoopStart(const base::TimeTicks& ticks, |
bool is_first_run); |
// Call this with the time when the first browser window became visible. |
-void RecordBrowserWindowDisplay(const base::Time& time); |
+void RecordBrowserWindowDisplay(const base::TimeTicks& ticks); |
// Call this with the time delta that the browser spent opening its tabs. |
void RecordBrowserOpenTabsDelta(const base::TimeDelta& delta); |
// Call this with the time when the first web contents loaded its main frame, |
// only if the first web contents was unimpended in its attempt to do so. |
-void RecordFirstWebContentsMainFrameLoad(const base::Time& time); |
+void RecordFirstWebContentsMainFrameLoad(const base::TimeTicks& ticks); |
// Call this with the time when the first web contents loaded its main frame. |
// This records an old stat kept for comparison purposes until M49. |
-void RecordDeprecatedFirstWebContentsMainFrameLoad(const base::Time& time); |
+void RecordDeprecatedFirstWebContentsMainFrameLoad( |
+ const base::TimeTicks& ticks); |
// Call this with the time when the first web contents had a non-empty paint, |
// only if the first web contents was unimpended in its attempt to do so. |
-void RecordFirstWebContentsNonEmptyPaint(const base::Time& time); |
+void RecordFirstWebContentsNonEmptyPaint(const base::TimeTicks& ticks); |
// Call this with the time when the first web contents had a non-empty paint. |
// This records an old stat kept for comparison purposes until M49. |
-void RecordDeprecatedFirstWebContentsNonEmptyPaint(const base::Time& time); |
+void RecordDeprecatedFirstWebContentsNonEmptyPaint( |
+ const base::TimeTicks& ticks); |
// Call this with the time when the first web contents began navigating its main |
// frame. |
-void RecordFirstWebContentsMainNavigationStart(const base::Time& time); |
+void RecordFirstWebContentsMainNavigationStart(const base::TimeTicks& ticks); |
// Call this with the time when the first web contents successfully committed |
// its navigation for the main frame. |
-void RecordFirstWebContentsMainNavigationFinished(const base::Time& time); |
+void RecordFirstWebContentsMainNavigationFinished(const base::TimeTicks& ticks); |
-// Returns the time of main entry recorded from RecordMainEntryPointTime. |
-// Returns a null Time if a value has not been recorded yet. |
-// This method is expected to be called from the UI thread. |
-base::Time MainEntryPointTime(); |
+// Returns the TimeTicks corresponding to main entry as recorded by |
+// RecordMainEntryPointTime. Returns a null TimeTicks if a value has not been |
+// recorded yet. This method is expected to be called from the UI thread. |
+base::TimeTicks MainEntryPointTicks(); |
// Returns the startup type. This is only currently supported on the Windows |
// platform and will simply return UNCERTAIN_STARTUP_TYPE on other platforms. |