| Index: src/base/platform/elapsed-timer.h
|
| diff --git a/src/base/platform/elapsed-timer.h b/src/base/platform/elapsed-timer.h
|
| index b525f05d13c3de42ac64a900803f0aa2f76ed24c..3f456efdf362ea1d81a42fe7f086002fbb160438 100644
|
| --- a/src/base/platform/elapsed-timer.h
|
| +++ b/src/base/platform/elapsed-timer.h
|
| @@ -21,29 +21,29 @@ class ElapsedTimer V8_FINAL {
|
| // |Elapsed()| or |HasExpired()|, and may be restarted using |Restart()|.
|
| // This method must not be called on an already started timer.
|
| void Start() {
|
| - ASSERT(!IsStarted());
|
| + DCHECK(!IsStarted());
|
| start_ticks_ = Now();
|
| #ifdef DEBUG
|
| started_ = true;
|
| #endif
|
| - ASSERT(IsStarted());
|
| + DCHECK(IsStarted());
|
| }
|
|
|
| // Stops this timer. Must not be called on a timer that was not
|
| // started before.
|
| void Stop() {
|
| - ASSERT(IsStarted());
|
| + DCHECK(IsStarted());
|
| start_ticks_ = TimeTicks();
|
| #ifdef DEBUG
|
| started_ = false;
|
| #endif
|
| - ASSERT(!IsStarted());
|
| + DCHECK(!IsStarted());
|
| }
|
|
|
| // Returns |true| if this timer was started previously.
|
| bool IsStarted() const {
|
| - ASSERT(started_ || start_ticks_.IsNull());
|
| - ASSERT(!started_ || !start_ticks_.IsNull());
|
| + DCHECK(started_ || start_ticks_.IsNull());
|
| + DCHECK(!started_ || !start_ticks_.IsNull());
|
| return !start_ticks_.IsNull();
|
| }
|
|
|
| @@ -53,21 +53,21 @@ class ElapsedTimer V8_FINAL {
|
| // avoiding the need to obtain the clock value twice. It may only be called
|
| // on a previously started timer.
|
| TimeDelta Restart() {
|
| - ASSERT(IsStarted());
|
| + DCHECK(IsStarted());
|
| TimeTicks ticks = Now();
|
| TimeDelta elapsed = ticks - start_ticks_;
|
| - ASSERT(elapsed.InMicroseconds() >= 0);
|
| + DCHECK(elapsed.InMicroseconds() >= 0);
|
| start_ticks_ = ticks;
|
| - ASSERT(IsStarted());
|
| + DCHECK(IsStarted());
|
| return elapsed;
|
| }
|
|
|
| // Returns the time elapsed since the previous start. This method may only
|
| // be called on a previously started timer.
|
| TimeDelta Elapsed() const {
|
| - ASSERT(IsStarted());
|
| + DCHECK(IsStarted());
|
| TimeDelta elapsed = Now() - start_ticks_;
|
| - ASSERT(elapsed.InMicroseconds() >= 0);
|
| + DCHECK(elapsed.InMicroseconds() >= 0);
|
| return elapsed;
|
| }
|
|
|
| @@ -75,14 +75,14 @@ class ElapsedTimer V8_FINAL {
|
| // previous start, or |false| if not. This method may only be called on
|
| // a previously started timer.
|
| bool HasExpired(TimeDelta time_delta) const {
|
| - ASSERT(IsStarted());
|
| + DCHECK(IsStarted());
|
| return Elapsed() >= time_delta;
|
| }
|
|
|
| private:
|
| static V8_INLINE TimeTicks Now() {
|
| TimeTicks now = TimeTicks::HighResolutionNow();
|
| - ASSERT(!now.IsNull());
|
| + DCHECK(!now.IsNull());
|
| return now;
|
| }
|
|
|
|
|