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

Unified Diff: third_party/WebKit/Source/platform/graphics/ContiguousContainer.cpp

Issue 2807923002: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in platform/graphics (Closed)
Patch Set: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in platform/graphics Created 3 years, 8 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
Index: third_party/WebKit/Source/platform/graphics/ContiguousContainer.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/ContiguousContainer.cpp b/third_party/WebKit/Source/platform/graphics/ContiguousContainer.cpp
index 3291e45bd3f9d5d839c208af51fb0782a3f7feb1..45848334965822c7b72e04f29a8453695679017a 100644
--- a/third_party/WebKit/Source/platform/graphics/ContiguousContainer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ContiguousContainer.cpp
@@ -40,7 +40,7 @@ class ContiguousContainerBase::Buffer {
bool isEmpty() const { return usedCapacity() == 0; }
void* allocate(size_t objectSize) {
- ASSERT(unusedCapacity() >= objectSize);
+ DCHECK_GE(unusedCapacity(), objectSize);
ANNOTATE_CHANGE_SIZE(m_begin, m_capacity, usedCapacity(),
usedCapacity() + objectSize);
void* result = m_end;
@@ -49,7 +49,7 @@ class ContiguousContainerBase::Buffer {
}
void deallocateLastObject(void* object) {
- RELEASE_ASSERT(m_begin <= object && object < m_end);
+ CHECK(m_begin <= object && object < m_end);
tkent 2017/04/09 23:17:27 Split this into two CHECKs.
Hwanseung Lee 2017/04/11 22:24:10 Done.
ANNOTATE_CHANGE_SIZE(m_begin, m_capacity, usedCapacity(),
static_cast<char*>(object) - m_begin);
m_end = static_cast<char*>(object);
@@ -105,7 +105,7 @@ void ContiguousContainerBase::reserveInitialCapacity(size_t bufferSize,
void* ContiguousContainerBase::allocate(size_t objectSize,
const char* typeName) {
- ASSERT(objectSize <= m_maxObjectSize);
+ DCHECK_LE(objectSize, m_maxObjectSize);
Buffer* bufferForAlloc = nullptr;
if (!m_buffers.isEmpty()) {
@@ -168,7 +168,7 @@ ContiguousContainerBase::Buffer*
ContiguousContainerBase::allocateNewBufferForNextAllocation(
size_t bufferSize,
const char* typeName) {
- ASSERT(m_buffers.isEmpty() || m_endIndex == m_buffers.size() - 1);
+ DCHECK(m_buffers.isEmpty() || m_endIndex == m_buffers.size() - 1);
std::unique_ptr<Buffer> newBuffer =
WTF::makeUnique<Buffer>(bufferSize, typeName);
Buffer* bufferToReturn = newBuffer.get();

Powered by Google App Engine
This is Rietveld 408576698