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

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

Issue 1491253004: Release Oilpan heap singletons prior to LSan leak detection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move static-local ref registration to wtf/LeakAnnotations.h 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
Index: third_party/WebKit/Source/platform/heap/ThreadState.h
diff --git a/third_party/WebKit/Source/platform/heap/ThreadState.h b/third_party/WebKit/Source/platform/heap/ThreadState.h
index 576519cdc0cff84f90f21f525cd9f90204948694..2fb2467379e8f402109cfe43c74a4a429aab499f 100644
--- a/third_party/WebKit/Source/platform/heap/ThreadState.h
+++ b/third_party/WebKit/Source/platform/heap/ThreadState.h
@@ -57,6 +57,7 @@ class CrossThreadPersistentRegion;
struct GCInfo;
class GarbageCollectedMixinConstructorMarker;
class HeapObjectHeader;
+class PersistentNode;
class PersistentRegion;
class BaseHeap;
class SafePointAwareMutexLocker;
@@ -509,6 +510,14 @@ public:
size_t threadStackSize();
#endif
+#if defined(LEAK_SANITIZER)
+ void registerStaticPersistentNode(PersistentNode*);
+ void releaseStaticPersistentNodes();
+
+ void enterDisabledStaticReferenceRegistrationScope();
+ void exitDisabledStaticReferenceRegistrationScope();
+#endif
+
private:
enum SnapshotType {
HeapSnapshot,
@@ -651,6 +660,15 @@ private:
void* m_asanFakeStack;
#endif
+#if defined(LEAK_SANITIZER)
+ // PersistentNodes that are stored in static references;
+ // references we have to clear before initiating LSan's leak detection.
+ HashSet<PersistentNode*> m_staticPersistents;
+
+ // Count that controls scoped disabling of persistent registration.
+ size_t m_disabledStaticPersistentsCount;
+#endif
+
// Ideally we want to allocate an array of size |gcInfoTableMax| but it will
// waste memory. Thus we limit the array size to 2^8 and share one entry
// with multiple types of vectors. This won't be an issue in practice,

Powered by Google App Engine
This is Rietveld 408576698