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 2b23a4fc9d54ecf31f1433804f2235372c0f1795..526ca4a944055df73a6806f7837eb58871abf4bb 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 as much as possible. OS-provided timings are still |
+// received as Time but are converted to TimeTicks as soon as possible as well |
fdoray
2015/11/09 21:27:16
The "as well" sounds weird to me. But I trust you
gab
2015/11/10 01:25:29
Agreed, re-worded entire comment.
|
+// (while the likelihood of a skew between the two basis is as low as possible). |
+// See crbug.com/544131 for reasoning. |
namespace startup_metric_utils { |
@@ -59,38 +63,40 @@ 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 startup type. This is only currently supported on the Windows |
// platform and will simply return UNCERTAIN_STARTUP_TYPE on other platforms. |