diff options
author | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-17 08:15:34 +0000 |
---|---|---|
committer | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-17 08:15:34 +0000 |
commit | 604c8bd0bd1421f2160df0a11d59fa82547500bc (patch) | |
tree | 0f977b8d1acb6aefed8649c91b193bd4718262db /chrome/browser | |
parent | d98e7ceee03e22fbf3f93a9b4488128843ae59a1 (diff) | |
download | chromium_src-604c8bd0bd1421f2160df0a11d59fa82547500bc.zip chromium_src-604c8bd0bd1421f2160df0a11d59fa82547500bc.tar.gz chromium_src-604c8bd0bd1421f2160df0a11d59fa82547500bc.tar.bz2 |
DevTools: Network requests are timed with 1.6 days.
BUG=65506
Review URL: http://codereview.chromium.org/5861008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69524 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/net/load_timing_observer.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/chrome/browser/net/load_timing_observer.cc b/chrome/browser/net/load_timing_observer.cc index 326a699..53dab62 100644 --- a/chrome/browser/net/load_timing_observer.cc +++ b/chrome/browser/net/load_timing_observer.cc @@ -21,17 +21,21 @@ const size_t kMaxNumEntries = 1000; namespace { +const int64 kSyncPeriodMicroseconds = 1000 * 1000 * 10; + // We know that this conversion is not solid and suffers from world clock -// changes, but it should be good enough for the load timing info. +// changes, but given that we sync clock every 10 seconds, it should be good +// enough for the load timing info. static Time TimeTicksToTime(const TimeTicks& time_ticks) { static int64 tick_to_time_offset; - static bool tick_to_time_offset_available = false; - if (!tick_to_time_offset_available) { + static int64 last_sync_ticks = 0; + if (time_ticks.ToInternalValue() - last_sync_ticks > + kSyncPeriodMicroseconds) { int64 cur_time = (Time::Now() - Time()).InMicroseconds(); int64 cur_time_ticks = (TimeTicks::Now() - TimeTicks()).InMicroseconds(); // If we add this number to a time tick value, it gives the timestamp. tick_to_time_offset = cur_time - cur_time_ticks; - tick_to_time_offset_available = true; + last_sync_ticks = time_ticks.ToInternalValue(); } return Time::FromInternalValue(time_ticks.ToInternalValue() + tick_to_time_offset); |