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

Unified Diff: net/log/net_log_util.cc

Issue 1775663002: Replace TimeTicks::UnixEpoch with Time::UnixEpoch for the net log (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/log/net_log_util.cc
diff --git a/net/log/net_log_util.cc b/net/log/net_log_util.cc
index 4d4dfa66f644ffad9a5756cae6ed2ef03d6f13d5..a1a0e7e836c16f6f54be6683c765ff024eddc538 100644
--- a/net/log/net_log_util.cc
+++ b/net/log/net_log_util.cc
@@ -275,9 +275,15 @@ scoped_ptr<base::DictionaryValue> GetNetConstants() {
// Information about how the "time ticks" values we have given it relate to
// actual system times. Time ticks are used throughout since they are stable
// across system clock changes.
+ // Note: |timeTickOffset| is only comparable to TimeTicks values, converted to
+ // milliseconds by subtracting the null TimeTicks.
eroman 2016/03/08 00:11:04 I am not sure what this comment means. Subtracting
Charlie Harrison 2016/03/08 01:14:46 Yeah that's what I meant. I thought saying somethi
{
+ base::TimeDelta time_since_epoch =
+ base::Time::Now() - base::Time::UnixEpoch();
+ base::TimeDelta reference_time_ticks =
+ base::TimeTicks::Now() - base::TimeTicks();
int64_t tick_to_unix_time_ms =
- (base::TimeTicks() - base::TimeTicks::UnixEpoch()).InMilliseconds();
+ (time_since_epoch - reference_time_ticks).InMilliseconds();
// Pass it as a string, since it may be too large to fit in an integer.
constants_dict->SetString("timeTickOffset",
charliea (OOO until 10-5) 2016/03/08 17:01:42 Am I right in that we're just trying to do a drop-
Charlie Harrison 2016/03/08 17:13:41 I'm not sure why this operation is as flawed as yo
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698