Chromium Code Reviews| 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..eed3b9ac39f136e44721de494d00f6d15ccae111 100644 |
| --- a/third_party/WebKit/Source/platform/heap/PersistentNode.cpp |
| +++ b/third_party/WebKit/Source/platform/heap/PersistentNode.cpp |
| @@ -117,7 +117,7 @@ void PersistentRegion::tracePersistentNodes(Visitor* visitor, |
| slots = slots->m_next; |
| } |
| } |
| - ASSERT(persistentCount == m_persistentCount); |
| + DCHECK_EQ(persistentCount, m_persistentCount); |
| } |
| bool CrossThreadPersistentRegion::shouldTracePersistentNode( |
| @@ -173,4 +173,23 @@ 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) { |
|
haraken
2016/10/17 07:32:40
Maybe can you simply unpoison m_slot[0 : slotCount
keishi
2016/10/17 07:43:00
We are unpoisoning the persistents, not the persis
haraken
2016/10/17 07:49:04
Ah, thanks, makes sense.
|
| + const PersistentNode& node = slots->m_slot[i]; |
| + if (!node.isUnused()) { |
| + ASAN_UNPOISON_MEMORY_REGION(node.self(), |
| + sizeof(CrossThreadPersistent<void*>)); |
| + ++persistentCount; |
| + } |
| + } |
| + } |
| + DCHECK_EQ(persistentCount, m_persistentRegion->m_persistentCount); |
| +} |
| +#endif |
| + |
| } // namespace blink |