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

Unified Diff: Source/heap/Handle.h

Issue 196513007: Oilpan: Reapply: Remove all the RefPtrs and most of the raw pointers to style (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix assertion for global persistents Created 6 years, 9 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 | « Source/core/xml/XSLTProcessorLibxslt.cpp ('k') | Source/heap/Heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/heap/Handle.h
diff --git a/Source/heap/Handle.h b/Source/heap/Handle.h
index 6528f37a9869384b272e0c7365ff8817697fa06c..448f3f973144504d50f1099ba5b64889c7e57bed 100644
--- a/Source/heap/Handle.h
+++ b/Source/heap/Handle.h
@@ -251,6 +251,13 @@ public:
Persistent(T* raw) : m_raw(raw)
{
COMPILE_ASSERT_IS_GARBAGE_COLLECTED(T, NonGarbageCollectedObjectInPersistent);
+#ifndef NDEBUG
+ // For global persistent handles we cannot check that the
+ // pointer is in the heap because that would involve
+ // inspecting the heap of running threads.
+ bool isGlobalPersistent = WTF::IsSubclass<RootsAccessor, GlobalPersistents>::value;
+ ASSERT(!raw || isGlobalPersistent || ThreadStateFor<ThreadingTrait<T>::Affinity>::state()->contains(raw));
+#endif
}
Persistent(const Persistent& other) : m_raw(other)
@@ -423,6 +430,7 @@ public:
Member(T* raw) : m_raw(raw)
{
COMPILE_ASSERT_IS_GARBAGE_COLLECTED(T, NonGarbageCollectedObjectInMember);
+ ASSERT(!raw || ThreadStateFor<ThreadingTrait<T>::Affinity>::state()->contains(raw));
}
Member(WTF::HashTableDeletedValueType) : m_raw(reinterpret_cast<T*>(-1))
« no previous file with comments | « Source/core/xml/XSLTProcessorLibxslt.cpp ('k') | Source/heap/Heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698