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

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

Issue 2060683002: Make trace() over persistents private. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sof-fix-unit-css
Patch Set: rebased Created 4 years, 6 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: third_party/WebKit/Source/platform/heap/Persistent.h
diff --git a/third_party/WebKit/Source/platform/heap/Persistent.h b/third_party/WebKit/Source/platform/heap/Persistent.h
index 62ae0943988b600eeec328b449920b31dc98c31e..4bee328aa34193b31aff00a2a46dd51b657479ac 100644
--- a/third_party/WebKit/Source/platform/heap/Persistent.h
+++ b/third_party/WebKit/Source/platform/heap/Persistent.h
@@ -91,18 +91,6 @@ public:
bool isHashTableDeletedValue() const { return m_raw == reinterpret_cast<T*>(-1); }
- template<typename VisitorDispatcher>
- void trace(VisitorDispatcher visitor)
- {
- static_assert(sizeof(T), "T must be fully defined");
- static_assert(IsGarbageCollectedType<T>::value, "T needs to be a garbage collected object");
- if (weaknessConfiguration == WeakPersistentConfiguration) {
- visitor->registerWeakCell(&m_raw);
- } else {
- visitor->mark(m_raw);
- }
- }
-
T* release()
{
T* result = m_raw;
@@ -188,6 +176,18 @@ private:
uninitialize();
}
+ template<typename VisitorDispatcher>
+ void tracePersistent(VisitorDispatcher visitor)
+ {
+ static_assert(sizeof(T), "T must be fully defined");
+ static_assert(IsGarbageCollectedType<T>::value, "T needs to be a garbage collected object");
+ if (weaknessConfiguration == WeakPersistentConfiguration) {
+ visitor->registerWeakCell(&m_raw);
+ } else {
+ visitor->mark(m_raw);
+ }
+ }
+
NO_LAZY_SWEEP_SANITIZE_ADDRESS
void initialize()
{
@@ -195,7 +195,7 @@ private:
if (!m_raw || isHashTableDeletedValue())
return;
- TraceCallback traceCallback = TraceMethodDelegate<PersistentBase<T, weaknessConfiguration, crossThreadnessConfiguration>, &PersistentBase<T, weaknessConfiguration, crossThreadnessConfiguration>::trace>::trampoline;
+ TraceCallback traceCallback = TraceMethodDelegate<PersistentBase<T, weaknessConfiguration, crossThreadnessConfiguration>, &PersistentBase<T, weaknessConfiguration, crossThreadnessConfiguration>::tracePersistent>::trampoline;
if (crossThreadnessConfiguration == CrossThreadPersistentConfiguration) {
ProcessHeap::crossThreadPersistentRegion().allocatePersistentNode(m_persistentNode, this, traceCallback);
return;
@@ -497,13 +497,6 @@ public:
uninitialize();
}
- template<typename VisitorDispatcher>
- void trace(VisitorDispatcher visitor)
- {
- static_assert(sizeof(Collection), "Collection must be fully defined");
- visitor->trace(*static_cast<Collection*>(this));
- }
-
// See PersistentBase::registerAsStaticReference() comment.
PersistentHeapCollectionBase* registerAsStaticReference()
{
@@ -517,6 +510,13 @@ public:
private:
+ template<typename VisitorDispatcher>
+ void tracePersistent(VisitorDispatcher visitor)
+ {
+ static_assert(sizeof(Collection), "Collection must be fully defined");
+ visitor->trace(*static_cast<Collection*>(this));
+ }
+
// Used when the registered PersistentNode of this object is
// released during ThreadState shutdown, clearing the association.
static void clearPersistentNode(void *self)
@@ -532,7 +532,7 @@ private:
// FIXME: Derive affinity based on the collection.
ThreadState* state = ThreadState::current();
ASSERT(state->checkThread());
- m_persistentNode = state->getPersistentRegion()->allocatePersistentNode(this, TraceMethodDelegate<PersistentHeapCollectionBase<Collection>, &PersistentHeapCollectionBase<Collection>::trace>::trampoline);
+ m_persistentNode = state->getPersistentRegion()->allocatePersistentNode(this, TraceMethodDelegate<PersistentHeapCollectionBase<Collection>, &PersistentHeapCollectionBase<Collection>::tracePersistent>::trampoline);
#if ENABLE(ASSERT)
m_state = state;
#endif
« 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