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

Unified Diff: third_party/WebKit/Source/platform/heap/PersistentNode.cpp

Issue 2619493003: Replace ASSERTs in platform/heap/ with DCHECKs
Patch Set: temp Created 3 years, 11 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/heap/PersistentNode.cpp
diff --git a/third_party/WebKit/Source/platform/heap/PersistentNode.cpp b/third_party/WebKit/Source/platform/heap/PersistentNode.cpp
index 3cb1821980c5530b49d00f6458b7c736b5d57df1..986a2c35a0270251c2dbcf7a7cdd8f948f78ede7 100644
--- a/third_party/WebKit/Source/platform/heap/PersistentNode.cpp
+++ b/third_party/WebKit/Source/platform/heap/PersistentNode.cpp
@@ -42,13 +42,13 @@ int PersistentRegion::numberOfPersistents() {
void PersistentRegion::ensurePersistentNodeSlots(void* self,
TraceCallback trace) {
- ASSERT(!m_freeListHead);
+ DCHECK(!m_freeListHead);
PersistentNodeSlots* slots = new PersistentNodeSlots;
for (int i = 0; i < PersistentNodeSlots::slotCount; ++i) {
PersistentNode* node = &slots->m_slot[i];
node->setFreeListNext(m_freeListHead);
m_freeListHead = node;
- ASSERT(node->isUnused());
+ DCHECK(node->isUnused());
}
slots->m_next = m_slots;
m_slots = slots;
@@ -57,18 +57,18 @@ void PersistentRegion::ensurePersistentNodeSlots(void* self,
void PersistentRegion::releasePersistentNode(
PersistentNode* persistentNode,
ThreadState::PersistentClearCallback callback) {
- ASSERT(!persistentNode->isUnused());
+ DCHECK(!persistentNode->isUnused());
// 'self' is in use, containing the persistent wrapper object.
void* self = persistentNode->self();
if (callback) {
(*callback)(self);
- ASSERT(persistentNode->isUnused());
+ DCHECK(persistentNode->isUnused());
return;
}
Persistent<DummyGCBase>* persistent =
reinterpret_cast<Persistent<DummyGCBase>*>(self);
persistent->clear();
- ASSERT(persistentNode->isUnused());
+ DCHECK(persistentNode->isUnused());
}
// This function traces all PersistentNodes. If we encounter
@@ -111,8 +111,8 @@ void PersistentRegion::tracePersistentNodes(Visitor* visitor,
delete deadSlots;
} else {
if (freeListLast) {
- ASSERT(freeListNext);
- ASSERT(!freeListLast->freeListNext());
+ DCHECK(freeListNext);
+ DCHECK(!freeListLast->freeListNext());
freeListLast->setFreeListNext(m_freeListHead);
m_freeListHead = freeListNext;
}
@@ -159,19 +159,19 @@ void CrossThreadPersistentRegion::prepareForThreadStateTermination(
CrossThreadPersistent<DummyGCBase>* persistent =
reinterpret_cast<CrossThreadPersistent<DummyGCBase>*>(
slots->m_slot[i].self());
- ASSERT(persistent);
+ DCHECK(persistent);
void* rawObject = persistent->atomicGet();
if (!rawObject)
continue;
BasePage* page = pageFromObject(rawObject);
- ASSERT(page);
+ DCHECK(page);
// The main thread will upon detach just mark its heap pages as orphaned,
// but not invalidate its CrossThreadPersistent<>s.
if (page->orphaned())
continue;
if (page->arena()->getThreadState() == threadState) {
persistent->clear();
- ASSERT(slots->m_slot[i].isUnused());
+ DCHECK(slots->m_slot[i].isUnused());
}
}
slots = slots->m_next;

Powered by Google App Engine
This is Rietveld 408576698