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

Unified Diff: third_party/WebKit/Source/wtf/DateMath.cpp

Issue 2585673002: Replace ASSERT, ENABLE(ASSERT), and ASSERT_NOT_REACHED in wtf (Closed)
Patch Set: Fix an Asan issue with LinkedHashSetNodeBase::unlink Created 4 years 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 | « third_party/WebKit/Source/wtf/BloomFilter.h ('k') | third_party/WebKit/Source/wtf/Deque.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/DateMath.cpp
diff --git a/third_party/WebKit/Source/wtf/DateMath.cpp b/third_party/WebKit/Source/wtf/DateMath.cpp
index 3d472d19d41c88bd236452c27be0693ffd2567bd..9fc692cb0f1e8c2fee36a0461d5b4705fa2bd62f 100644
--- a/third_party/WebKit/Source/wtf/DateMath.cpp
+++ b/third_party/WebKit/Source/wtf/DateMath.cpp
@@ -159,7 +159,8 @@ static double msToDays(double ms) {
}
static void appendTwoDigitNumber(StringBuilder& builder, int number) {
- ASSERT(number >= 0 && number < 100);
+ DCHECK_GE(number, 0);
+ DCHECK_LT(number, 100);
if (number <= 9)
builder.append('0');
builder.appendNumber(number);
@@ -274,7 +275,7 @@ double dateToDaysFrom1970(int year, int month, int day) {
}
double yearday = floor(daysFrom1970ToYear(year));
- ASSERT((year >= 1970 && yearday >= 0) || (year < 1970 && yearday < 0));
+ DCHECK((year >= 1970 && yearday >= 0) || (year < 1970 && yearday < 0));
return yearday + dayInYear(year, month, day);
}
@@ -324,7 +325,7 @@ static int equivalentYearForDST(int year) {
int product = (quotient)*28;
year += product;
- ASSERT((year >= minYear && year <= maxYear) ||
+ DCHECK((year >= minYear && year <= maxYear) ||
(product - year ==
static_cast<int>(std::numeric_limits<double>::quiet_NaN())));
return year;
@@ -390,9 +391,9 @@ static double calculateDSTOffset(double ms, double utcOffset) {
}
void initializeDates() {
-#if ENABLE(ASSERT)
+#if DCHECK_IS_ON()
static bool alreadyInitialized;
- ASSERT(!alreadyInitialized);
+ DCHECK(!alreadyInitialized);
alreadyInitialized = true;
#endif
@@ -445,7 +446,7 @@ inline static void skipSpacesAndComments(const char*& s) {
// returns 0-11 (Jan-Dec); -1 on failure
static int findMonth(const char* monthStr) {
- ASSERT(monthStr);
+ DCHECK(monthStr);
char needle[4];
for (int i = 0; i < 3; ++i) {
if (!*monthStr)
« no previous file with comments | « third_party/WebKit/Source/wtf/BloomFilter.h ('k') | third_party/WebKit/Source/wtf/Deque.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698