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

Unified Diff: src/base/platform/elapsed-timer.h

Issue 430503007: Rename ASSERT* to DCHECK*. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE and fixes Created 6 years, 4 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 | « src/base/platform/condition-variable.cc ('k') | src/base/platform/mutex.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « src/base/platform/condition-variable.cc ('k') | src/base/platform/mutex.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698