| 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 cb47bcf10b39766b61a1f4f99d3d733d0381e78f..30e077e4f1a47b638be214c8dee42c31db6f52db 100644
|
| --- a/third_party/WebKit/Source/platform/heap/PersistentNode.cpp
|
| +++ b/third_party/WebKit/Source/platform/heap/PersistentNode.cpp
|
| @@ -117,7 +117,9 @@ void PersistentRegion::tracePersistentNodes(Visitor* visitor,
|
| slots = slots->m_next;
|
| }
|
| }
|
| - ASSERT(persistentCount == m_persistentCount);
|
| +#if DCHECK_IS_ON()
|
| + DCHECK_EQ(persistentCount, m_persistentCount);
|
| +#endif
|
| }
|
|
|
| bool CrossThreadPersistentRegion::shouldTracePersistentNode(
|
| @@ -173,4 +175,25 @@ void CrossThreadPersistentRegion::prepareForThreadStateTermination(
|
| }
|
| }
|
|
|
| +#if defined(ADDRESS_SANITIZER)
|
| +void CrossThreadPersistentRegion::unpoisonCrossThreadPersistents() {
|
| + MutexLocker lock(m_mutex);
|
| + int persistentCount = 0;
|
| + for (PersistentNodeSlots* slots = m_persistentRegion->m_slots; slots;
|
| + slots = slots->m_next) {
|
| + for (int i = 0; i < PersistentNodeSlots::slotCount; ++i) {
|
| + const PersistentNode& node = slots->m_slot[i];
|
| + if (!node.isUnused()) {
|
| + ASAN_UNPOISON_MEMORY_REGION(node.self(),
|
| + sizeof(CrossThreadPersistent<void*>));
|
| + ++persistentCount;
|
| + }
|
| + }
|
| + }
|
| +#if DCHECK_IS_ON()
|
| + DCHECK_EQ(persistentCount, m_persistentRegion->m_persistentCount);
|
| +#endif
|
| +}
|
| +#endif
|
| +
|
| } // namespace blink
|
|
|