summaryrefslogtreecommitdiffstats
path: root/base/timer.cc
diff options
context:
space:
mode:
authordarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-30 00:49:22 +0000
committerdarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-30 00:49:22 +0000
commita897b5e01b98060b4dca455664b8db8ad9452580 (patch)
tree501fe83516d390b97233bd3fc11a78e94bcd2c93 /base/timer.cc
parent090b2acd3053aa4816f70f3c7e4a1446d9d3fd9b (diff)
downloadchromium_src-a897b5e01b98060b4dca455664b8db8ad9452580.zip
chromium_src-a897b5e01b98060b4dca455664b8db8ad9452580.tar.gz
chromium_src-a897b5e01b98060b4dca455664b8db8ad9452580.tar.bz2
Remove assertion in Timer() because it was too aggressive. Instead, we need to
just treat a negative delay as a zero delay. TBR=mbelshe git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1582 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/timer.cc')
-rw-r--r--base/timer.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/base/timer.cc b/base/timer.cc
index 16d0ad8..af407bee 100644
--- a/base/timer.cc
+++ b/base/timer.cc
@@ -38,10 +38,13 @@ Timer::Timer(Time fire_time, Task* task)
repeating_(false) {
timer_id_ = timer_id_counter_.GetNext();
- // TODO(darin): kill off this stuff
+ // TODO(darin): kill off this stuff. because we are forced to compute 'now'
+ // in order to determine the delay, it is possible that our fire time could
+ // be in the past. /sigh/
creation_time_ = Time::Now();
delay_ = static_cast<int>((fire_time_ - creation_time_).InMilliseconds());
- DCHECK(delay_ >= 0);
+ if (delay_ < 0)
+ delay_ = 0;
DHISTOGRAM_COUNTS(L"Timer.Durations", delay_);
}