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

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

Issue 1787623003: Move LSan-specific shutdown code to ThreadState::cleanupMainThread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | 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 beaaf3042c88d209bcfb248d590ff952b36e8035..6c5c2fdcb6b5d514fc8abb9aff2bb39c36bca868 100644
--- a/third_party/WebKit/Source/platform/heap/ThreadState.cpp
+++ b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
@@ -213,6 +213,18 @@ void ThreadState::cleanupMainThread()
{
ASSERT(isMainThread());
+#if defined(LEAK_SANITIZER)
+ // If LSan is about to perform leak detection, release all the registered
+ // static Persistent<> root references to global caches that Blink keeps,
+ // followed by GCs to clear out all they referred to.
haraken 2016/03/11 09:18:05 I forgot the details about this. Why is it okay t
sof 2016/03/11 09:36:18 For the purposes of overall leak detection, we are
+ //
+ // This is not needed for caches over non-Oilpan objects, as they're
+ // not scanned by LSan due to being held in non-global storage
+ // ("static" references inside functions/methods.)
+ releaseStaticPersistentNodes();
+ Heap::collectAllGarbage();
+#endif
+
// Finish sweeping before shutting down V8. Otherwise, some destructor
// may access V8 and cause crashes.
completeSweep();
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/WebKit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698