Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Unified Diff: components/startup_metric_utils/browser/startup_metric_utils.h

Issue 1425263003: Use TimeTicks as much as possible in startup_metric_utils. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698