Index: third_party/WebKit/Source/platform/heap/Persistent.h |
diff --git a/third_party/WebKit/Source/platform/heap/Persistent.h b/third_party/WebKit/Source/platform/heap/Persistent.h |
index 794753c93dd8661116a915453cb52540a94db514..c5e3e7b4320118ab5135629d9527b6d740fbde2b 100644 |
--- a/third_party/WebKit/Source/platform/heap/Persistent.h |
+++ b/third_party/WebKit/Source/platform/heap/Persistent.h |
@@ -156,7 +156,7 @@ class PersistentBase { |
// needing to be cleared out before the thread is terminated. |
PersistentBase* registerAsStaticReference() { |
if (m_persistentNode) { |
- ASSERT(ThreadState::current()); |
+ DCHECK(ThreadState::current()); |
ThreadState::current()->registerStaticPersistentNode(m_persistentNode, |
nullptr); |
LEAK_SANITIZER_IGNORE_OBJECT(this); |
@@ -209,7 +209,7 @@ class PersistentBase { |
NO_SANITIZE_ADDRESS |
void initialize() { |
- ASSERT(!m_persistentNode); |
+ DCHECK(!m_persistentNode); |
if (!m_raw || isHashTableDeletedValue()) |
return; |
@@ -222,10 +222,10 @@ class PersistentBase { |
return; |
} |
ThreadState* state = ThreadStateFor<ThreadingTrait<T>::Affinity>::state(); |
- ASSERT(state->checkThread()); |
+ DCHECK(state->checkThread()); |
m_persistentNode = state->getPersistentRegion()->allocatePersistentNode( |
this, traceCallback); |
-#if ENABLE(ASSERT) |
+#if DCHECK_IS_ON() |
m_state = state; |
#endif |
} |
@@ -249,9 +249,9 @@ class PersistentBase { |
if (!m_persistentNode) |
return; |
ThreadState* state = ThreadStateFor<ThreadingTrait<T>::Affinity>::state(); |
- ASSERT(state->checkThread()); |
+ DCHECK(state->checkThread()); |
// Persistent handle must be created and destructed in the same thread. |
- ASSERT(m_state == state); |
+ DCHECK(m_state == state); |
state->freePersistentNode(m_persistentNode); |
m_persistentNode = nullptr; |
} |
@@ -314,7 +314,7 @@ class PersistentBase { |
// m_raw is accessed most, so put it at the first field. |
T* m_raw; |
PersistentNode* m_persistentNode = nullptr; |
-#if ENABLE(ASSERT) |
+#if DCHECK_IS_ON() |
ThreadState* m_state = nullptr; |
#endif |
#if DCHECK_IS_ON() |
@@ -582,7 +582,7 @@ class PersistentHeapCollectionBase : public Collection { |
// See PersistentBase::registerAsStaticReference() comment. |
PersistentHeapCollectionBase* registerAsStaticReference() { |
if (m_persistentNode) { |
- ASSERT(ThreadState::current()); |
+ DCHECK(ThreadState::current()); |
ThreadState::current()->registerStaticPersistentNode( |
m_persistentNode, |
&PersistentHeapCollectionBase<Collection>::clearPersistentNode); |
@@ -611,13 +611,13 @@ class PersistentHeapCollectionBase : public Collection { |
void initialize() { |
// FIXME: Derive affinity based on the collection. |
ThreadState* state = ThreadState::current(); |
- ASSERT(state->checkThread()); |
+ DCHECK(state->checkThread()); |
m_persistentNode = state->getPersistentRegion()->allocatePersistentNode( |
this, |
TraceMethodDelegate<PersistentHeapCollectionBase<Collection>, |
&PersistentHeapCollectionBase< |
Collection>::tracePersistent>::trampoline); |
-#if ENABLE(ASSERT) |
+#if DCHECK_IS_ON() |
m_state = state; |
#endif |
} |
@@ -626,15 +626,15 @@ class PersistentHeapCollectionBase : public Collection { |
if (!m_persistentNode) |
return; |
ThreadState* state = ThreadState::current(); |
- ASSERT(state->checkThread()); |
+ DCHECK(state->checkThread()); |
// Persistent handle must be created and destructed in the same thread. |
- ASSERT(m_state == state); |
+ DCHECK(m_state == state); |
state->freePersistentNode(m_persistentNode); |
m_persistentNode = nullptr; |
} |
PersistentNode* m_persistentNode; |
-#if ENABLE(ASSERT) |
+#if DCHECK_IS_ON() |
ThreadState* m_state; |
#endif |
}; |