Commit 0e1dbc25 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

WTF::Vector: Avoid use of blink::Visitor

Avoid using blink::* types in WTF where easily possible.

Bug: chromium:1056170
Change-Id: I78da26f10a3e1f0b049aff00f5ab064273fe9ff9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2527422
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825576}
parent 94044c52
...@@ -2137,6 +2137,16 @@ void TraceInlinedBuffer(VisitorDispatcher visitor, ...@@ -2137,6 +2137,16 @@ void TraceInlinedBuffer(VisitorDispatcher visitor,
Allocator::template Trace<T, VectorTraits<T>>(visitor, *buffer_entry); Allocator::template Trace<T, VectorTraits<T>>(visitor, *buffer_entry);
} }
} }
template <typename Allocator,
typename VisitorDispatcher,
typename T,
wtf_size_t inlineCapacity>
void DeferredTraceImpl(VisitorDispatcher visitor, const void* object) {
internal::TraceInlinedBuffer<Allocator>(
visitor, reinterpret_cast<const T*>(object), inlineCapacity);
}
} // namespace internal } // namespace internal
// Only defined for HeapAllocator. Used when visiting vector object. // Only defined for HeapAllocator. Used when visiting vector object.
...@@ -2169,12 +2179,8 @@ Vector<T, inlineCapacity, Allocator>::Trace(VisitorDispatcher visitor) const { ...@@ -2169,12 +2179,8 @@ Vector<T, inlineCapacity, Allocator>::Trace(VisitorDispatcher visitor) const {
// Bail out for concurrent marking. // Bail out for concurrent marking.
if (!VectorTraits<T>::kCanTraceConcurrently) { if (!VectorTraits<T>::kCanTraceConcurrently) {
if (visitor->DeferredTraceIfConcurrent( if (visitor->DeferredTraceIfConcurrent(
{buffer, {buffer, internal::DeferredTraceImpl<Allocator, VisitorDispatcher,
[](blink::Visitor* visitor, const void* object) { T, inlineCapacity>},
const T* buffer = reinterpret_cast<const T*>(object);
internal::TraceInlinedBuffer<Allocator>(visitor, buffer,
inlineCapacity);
}},
inlineCapacity * sizeof(T))) inlineCapacity * sizeof(T)))
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment