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

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

Issue 1491253004: Release Oilpan heap singletons prior to LSan leak detection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address non-LSan Oilpan compilation failure Created 5 years 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
« no previous file with comments | « third_party/WebKit/Source/platform/heap/ThreadState.h ('k') | third_party/WebKit/Source/web/WebKit.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/ThreadState.cpp
diff --git a/third_party/WebKit/Source/platform/heap/ThreadState.cpp b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
index 5dade81422fb90875c853471da1f73fa91d9e779..1d476723a36e1c3bc1dea8a0f526dae1cccfa823 100644
--- a/third_party/WebKit/Source/platform/heap/ThreadState.cpp
+++ b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
@@ -104,6 +104,9 @@ ThreadState::ThreadState()
#if defined(ADDRESS_SANITIZER)
, m_asanFakeStack(__asan_get_current_fake_stack())
#endif
+#if defined(LEAK_SANITIZER)
+ , m_disabledStaticPersistentsRegistration(0)
+#endif
{
ASSERT(checkThread());
ASSERT(!**s_threadSpecific);
@@ -1317,6 +1320,36 @@ void ThreadState::removeInterruptor(BlinkGCInterruptor* interruptor)
}
}
+#if defined(LEAK_SANITIZER)
+void ThreadState::registerStaticPersistentNode(PersistentNode* node)
+{
+ if (m_disabledStaticPersistentsRegistration)
+ return;
+
+ ASSERT(!m_staticPersistents.contains(node));
+ m_staticPersistents.add(node);
+}
+
+void ThreadState::releaseStaticPersistentNodes()
+{
+ for (PersistentNode* node : m_staticPersistents)
+ persistentRegion()->freePersistentNode(node);
+
+ m_staticPersistents.clear();
+}
+
+void ThreadState::enterStaticReferenceRegistrationDisabledScope()
+{
+ m_disabledStaticPersistentsRegistration++;
+}
+
+void ThreadState::leaveStaticReferenceRegistrationDisabledScope()
+{
+ ASSERT(m_disabledStaticPersistentsRegistration);
+ m_disabledStaticPersistentsRegistration--;
+}
+#endif
+
ThreadState::AttachedThreadStateSet& ThreadState::attachedThreads()
{
DEFINE_STATIC_LOCAL(AttachedThreadStateSet, threads, ());
« no previous file with comments | « third_party/WebKit/Source/platform/heap/ThreadState.h ('k') | third_party/WebKit/Source/web/WebKit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698