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

Unified Diff: third_party/WebKit/Source/platform/heap/PersistentNode.h

Issue 1477023003: Refactor the Heap into ThreadHeap to prepare for per thread heaps Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
Index: third_party/WebKit/Source/platform/heap/PersistentNode.h
diff --git a/third_party/WebKit/Source/platform/heap/PersistentNode.h b/third_party/WebKit/Source/platform/heap/PersistentNode.h
index 62d176d18f1ff5cc9fd0b762e6645167223de631..42147dd3a9e0818aba90d12307880d5a4fa80837 100644
--- a/third_party/WebKit/Source/platform/heap/PersistentNode.h
+++ b/third_party/WebKit/Source/platform/heap/PersistentNode.h
@@ -149,7 +149,8 @@ public:
--m_persistentCount;
#endif
}
- void tracePersistentNodes(Visitor*);
+ using ShouldTraceCallback = bool (*)(Visitor*, PersistentNode*);
+ void tracePersistentNodes(Visitor*, ShouldTraceCallback = nullptr);
int numberOfPersistents();
private:
@@ -184,11 +185,13 @@ public:
void tracePersistentNodes(Visitor* visitor)
{
MutexLocker lock(m_mutex);
- m_persistentRegion->tracePersistentNodes(visitor);
+ m_persistentRegion->tracePersistentNodes(visitor, CrossThreadPersistentRegion::shouldTracePersistentNode);
}
void prepareForThreadStateTermination(ThreadState*);
+ static bool shouldTracePersistentNode(Visitor*, PersistentNode*);
+
private:
// We don't make CrossThreadPersistentRegion inherit from PersistentRegion
// because we don't want to virtualize performance-sensitive methods

Powered by Google App Engine
This is Rietveld 408576698