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

Unified Diff: net/log/net_log_util.cc

Issue 1127133008: NetLog: Use TimeTicks::UnixEpoch() to calculate timeTickOffset. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 97d9a7648a746e3e4c07f08d3a59ed77d57a9ef9..001009c7a6ed0c7a1eedea062bb5010e3bf005a0 100644
--- a/net/log/net_log_util.cc
+++ b/net/log/net_log_util.cc
@@ -272,23 +272,11 @@ scoped_ptr<base::DictionaryValue> GetNetConstants() {
}
// Information about how the "time ticks" values we have given it relate to
- // actual system times. (We used time ticks throughout since they are stable
- // across system clock changes).
+ // actual system times. Time ticks are used throughout since they are stable
+ // across system clock changes.
{
- int64 cur_time_ms = (base::Time::Now() - base::Time()).InMilliseconds();
-
- int64 cur_time_ticks_ms =
- (base::TimeTicks::Now() - base::TimeTicks()).InMilliseconds();
-
- // If we add this number to a time tick value, it gives the timestamp.
- int64 tick_to_time_ms = cur_time_ms - cur_time_ticks_ms;
-
- // Chrome on all platforms stores times using the Windows epoch
- // (Jan 1 1601), but the javascript wants a unix epoch.
- // TODO(eroman): Getting the timestamp relative to the unix epoch should
- // be part of the time library.
- const int64 kUnixEpochMs = 11644473600000LL;
- int64 tick_to_unix_time_ms = tick_to_time_ms - kUnixEpochMs;
+ int64 tick_to_unix_time_ms =
+ (base::TimeTicks() - base::TimeTicks::UnixEpoch()).InMilliseconds();
// Pass it as a string, since it may be too large to fit in an integer.
constants_dict->SetString("timeTickOffset",
« 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