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

Unified Diff: Source/platform/heap/PersistentNode.cpp

Issue 1338573003: Restrict registered PersistentNodes to non-empty ones. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add back missing m_raw nullcheck that ps#3 incorrectly dropped Created 5 years, 3 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/platform/heap/Handle.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/PersistentNode.cpp
diff --git a/Source/platform/heap/PersistentNode.cpp b/Source/platform/heap/PersistentNode.cpp
index 6271f7d6ea72c36c01868d2a242d3f18b4db3406..2e986858b4579d76d6fa38937409518a711f09c6 100644
--- a/Source/platform/heap/PersistentNode.cpp
+++ b/Source/platform/heap/PersistentNode.cpp
@@ -92,6 +92,13 @@ void PersistentRegion::tracePersistentNodes(Visitor* visitor)
ASSERT(persistentCount == m_persistentCount);
}
+namespace {
+class GCObject final : public GarbageCollected<GCObject> {
+public:
+ DEFINE_INLINE_TRACE() { }
+};
+}
+
void CrossThreadPersistentRegion::prepareForThreadStateTermination(ThreadState* threadState)
{
// For heaps belonging to a thread that's detaching, any cross-thread persistents
@@ -99,9 +106,6 @@ void CrossThreadPersistentRegion::prepareForThreadStateTermination(ThreadState*
// heap reference.
MutexLocker lock(m_mutex);
- class Object;
- using GCObject = GarbageCollected<Object>;
-
// TODO(sof): consider ways of reducing overhead. (e.g., tracking number of active
// CrossThreadPersistent<>s pointing into the heaps of each ThreadState and use that
// count to bail out early.)
« no previous file with comments | « Source/platform/heap/Handle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698