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

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

Issue 1870503002: Making CSSValue Pool thread local (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change based on eugenis's feedback 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.cpp
diff --git a/third_party/WebKit/Source/platform/heap/ThreadState.cpp b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
index 3b3cfd8eea9632f0e7cebc468e075a98360cff40..6baab648e01f46bf7803e2766b6fafd29114c3ee 100644
--- a/third_party/WebKit/Source/platform/heap/ThreadState.cpp
+++ b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
@@ -273,6 +273,15 @@ void ThreadState::cleanupPages()
m_arenas[i]->cleanupPages();
}
+void ThreadState::callThreadShutdownHooks()
+{
+ // Invoke the cleanup hooks. This gives an opportunity to release any
+ // persistent handles that may exist, e.g. in thread-specific static
+ // locals.
+ for (const OwnPtr<SameThreadClosure>& hook : m_threadShutdownHooks)
+ (*hook)();
+}
+
void ThreadState::cleanup()
{
ASSERT(checkThread());
@@ -292,11 +301,7 @@ void ThreadState::cleanup()
// pointers into the heap owned by this thread.
m_isTerminating = true;
- // Invoke the cleanup hooks. This gives an opportunity to release any
- // persistent handles that may exist, e.g. in thread-specific static
- // locals.
- for (const OwnPtr<SameThreadClosure>& hook : m_threadShutdownHooks)
- (*hook)();
+ ThreadState::callThreadShutdownHooks();
// Set the terminate flag on all heap pages of this thread. This is used to
// ensure we don't trace pages on other threads that are not part of the
« no previous file with comments | « third_party/WebKit/Source/platform/heap/ThreadState.h ('k') | third_party/WebKit/Source/web/tests/RunAllTests.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698