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

Unified Diff: third_party/WebKit/Source/wtf/TerminatedArrayBuilder.h

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
Index: third_party/WebKit/Source/wtf/TerminatedArrayBuilder.h
diff --git a/third_party/WebKit/Source/wtf/TerminatedArrayBuilder.h b/third_party/WebKit/Source/wtf/TerminatedArrayBuilder.h
index d3f99132ecd380324ece0c70f452421c3d6aaea0..020626132993512de9f6a8ceed36261336bde9b6 100644
--- a/third_party/WebKit/Source/wtf/TerminatedArrayBuilder.h
+++ b/third_party/WebKit/Source/wtf/TerminatedArrayBuilder.h
@@ -20,18 +20,18 @@ class TerminatedArrayBuilder {
if (!m_array)
return;
m_capacity = m_count = m_array->size();
- ASSERT(m_array->at(m_count - 1).isLastInArray());
+ DCHECK(m_array->at(m_count - 1).isLastInArray());
}
void grow(size_t count) {
- ASSERT(count);
+ DCHECK(count);
if (!m_array) {
- ASSERT(!m_count);
- ASSERT(!m_capacity);
+ DCHECK(!m_count);
+ DCHECK(!m_capacity);
m_capacity = count;
m_array = ArrayType<T>::Allocator::create(m_capacity);
} else {
- ASSERT(m_array->at(m_count - 1).isLastInArray());
+ DCHECK(m_array->at(m_count - 1).isLastInArray());
m_capacity += count;
m_array = ArrayType<T>::Allocator::resize(
ArrayType<T>::Allocator::release(m_array), m_capacity);
@@ -42,7 +42,7 @@ class TerminatedArrayBuilder {
void append(const T& item) {
RELEASE_ASSERT(m_count < m_capacity);
- ASSERT(!item.isLastInArray());
+ DCHECK(!item.isLastInArray());
m_array->at(m_count++) = item;
if (m_count == m_capacity)
m_array->at(m_capacity - 1).setLastInArray(true);
@@ -55,11 +55,11 @@ class TerminatedArrayBuilder {
}
private:
-#if ENABLE(ASSERT)
+#if DCHECK_IS_ON()
void assertValid() {
for (size_t i = 0; i < m_count; ++i) {
bool isLastInArray = (i + 1 == m_count);
- ASSERT(m_array->at(i).isLastInArray() == isLastInArray);
+ DCHECK_EQ(m_array->at(i).isLastInArray(), isLastInArray);
}
}
#else
« no previous file with comments | « third_party/WebKit/Source/wtf/StringHasher.h ('k') | third_party/WebKit/Source/wtf/ThreadRestrictionVerifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698