Chromium Code Reviews| 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()); |