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

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

Issue 1089763002: Oilpan: assert that new Persistents belong to Oilpan threads. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | 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 83e4bff467c72d9deea4dfffdc38bd29b01880a8..dce2e0cbaf73f0f5e07520b8f310f7645e56fca3 100644
--- a/Source/platform/heap/Handle.h
+++ b/Source/platform/heap/Handle.h
@@ -163,6 +163,7 @@ class PersistentBase : public PersistentNode {
public:
~PersistentBase()
{
+ ASSERT(ThreadState::current());
sof 2015/04/16 11:08:46 The assert in the dtor cannot be used, as the Thre
typename RootsAccessor::Lock lock;
ASSERT(m_roots == RootsAccessor::roots()); // Check that the thread is using the same roots list.
ASSERT(isHeapObjectAlive());
@@ -179,6 +180,8 @@ protected:
, m_roots(RootsAccessor::roots())
#endif
{
+ // Persistent must belong to a thread that will GC it.
+ ASSERT(m_roots == GlobalPersistents::roots() || ThreadState::current());
typename RootsAccessor::Lock lock;
m_prev = RootsAccessor::roots();
m_next = m_prev->m_next;
@@ -192,6 +195,7 @@ protected:
, m_roots(RootsAccessor::roots())
#endif
{
+ ASSERT(m_roots == GlobalPersistents::roots() || ThreadState::current());
// We don't support allocation of thread local Persistents while doing
// thread shutdown/cleanup.
ASSERT(!ThreadState::current()->isTerminating());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698