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

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

Issue 1881933005: Oilpan: Add ThreadState cleanup callbacks for static thread-specific persistent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unit test Created 4 years, 8 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/ThreadState.h
diff --git a/third_party/WebKit/Source/platform/heap/ThreadState.h b/third_party/WebKit/Source/platform/heap/ThreadState.h
index 6d3bd0a7d0a3e62ecad62489ccb30a7c70f8ea5b..01ba1b070c4112653d9de69fd7771400410bc1fb 100644
--- a/third_party/WebKit/Source/platform/heap/ThreadState.h
+++ b/third_party/WebKit/Source/platform/heap/ThreadState.h
@@ -39,6 +39,7 @@
#include "wtf/AddressSanitizer.h"
#include "wtf/Allocator.h"
#include "wtf/Forward.h"
+#include "wtf/Functional.h"
#include "wtf/HashMap.h"
#include "wtf/HashSet.h"
#include "wtf/ThreadSpecific.h"
@@ -505,6 +506,11 @@ public:
size_t threadStackSize();
#endif
+ // Registers a closure that will be called while the thread is shutting down
+ // (i.e. ThreadState::isTerminating will be true), in order to allow for any
+ // persistent handles that should be cleared.
+ void registerCleanupHook(PassOwnPtr<SameThreadClosure>);
haraken 2016/04/14 23:46:15 registerCleanupHook => registerThreadShutdownHooks
+
#if defined(LEAK_SANITIZER)
void registerStaticPersistentNode(PersistentNode*);
void releaseStaticPersistentNodes();
@@ -658,6 +664,10 @@ private:
v8::Isolate* m_isolate;
void (*m_traceDOMWrappers)(v8::Isolate*, Visitor*);
+ // Invoked while the thread is terminating. Intended to be used to free
+ // persistent pointers into the thread's heap.
+ Vector<OwnPtr<SameThreadClosure>> m_cleanupHooks;
haraken 2016/04/14 23:46:15 m_cleanupHooks => m_threadShutdownHooks
+
#if defined(ADDRESS_SANITIZER)
void* m_asanFakeStack;
#endif
« no previous file with comments | « third_party/WebKit/Source/platform/heap/HeapTest.cpp ('k') | third_party/WebKit/Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698