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

Unified Diff: Source/platform/heap/Handle.h

Issue 393823003: Revert "Revert "[oilpan]: Make thread shutdown more robust."" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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 | Source/platform/heap/Heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Handle.h
diff --git a/Source/platform/heap/Handle.h b/Source/platform/heap/Handle.h
index 039942a967d4975a076a205fe34e5feb3aa66aea..f02e95c58106ce8483d4caa00cf76009632346aa 100644
--- a/Source/platform/heap/Handle.h
+++ b/Source/platform/heap/Handle.h
@@ -220,6 +220,9 @@ protected:
, m_roots(RootsAccessor::roots())
#endif
{
+ // We don't support allocation of thread local Persistents while doing
+ // thread shutdown/cleanup.
+ ASSERT(!ThreadState::current()->isTerminating());
typename RootsAccessor::Lock lock;
ASSERT(otherref.m_roots == m_roots); // Handles must belong to the same list.
PersistentBase* other = const_cast<PersistentBase*>(&otherref);
@@ -247,6 +250,14 @@ public:
current->trace(visitor);
}
+ int numberOfPersistents()
+ {
+ int numberOfPersistents = 0;
+ for (PersistentNode* current = m_next; current != this; current = current->m_next)
+ ++numberOfPersistents;
+ return numberOfPersistents;
+ }
+
virtual ~PersistentAnchor()
{
// FIXME: oilpan: Ideally we should have no left-over persistents at this point. However currently there is a
« no previous file with comments | « no previous file | Source/platform/heap/Heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698