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..23374121254a906f191feb2607a3b5e259358b6f 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_disabledStaticPersistentsCount(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_disabledStaticPersistentsCount) |
+ 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::enterDisabledStaticReferenceRegistrationScope() |
haraken
2015/12/06 23:56:21
enterRecordStaticPersistentsScope ?
|
+{ |
+ m_disabledStaticPersistentsCount++; |
haraken
2015/12/06 23:56:21
m_recordStaticPersistentsScopeCount ?
|
+} |
+ |
+void ThreadState::exitDisabledStaticReferenceRegistrationScope() |
haraken
2015/12/06 23:56:21
leaveRecordStaticPersistentsScope ?
|
+{ |
+ ASSERT(m_disabledStaticPersistentsCount); |
+ m_disabledStaticPersistentsCount--; |
+} |
+#endif |
+ |
ThreadState::AttachedThreadStateSet& ThreadState::attachedThreads() |
{ |
DEFINE_STATIC_LOCAL(AttachedThreadStateSet, threads, ()); |