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

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

Issue 2415363002: Unpoison CrossThreadPersistents (Closed)
Patch Set: fix Created 4 years, 2 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 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
« no previous file with comments | « third_party/WebKit/Source/platform/heap/PersistentNode.h ('k') | third_party/WebKit/Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698