cppgc: Provide TraceTraitBase that users can inherit from

The TraceTrait for JSMember is currently missing GetTraceDescriptor.
We missed it because we don't have proper tests for JSMember, but it
would fail to build if it was ever actually traced.

Bug: chromium:1056170
Change-Id: I45fd2c7c666e791f866813f762b488958f65f3cf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2460815
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70413}
This commit is contained in:
Omer Katz 2020-10-08 20:01:07 +02:00 committed by Commit Bot
parent 65bec1aa79
commit 0b96f711cb

View File

@ -55,8 +55,6 @@ struct V8_EXPORT TraceTraitFromInnerAddressImpl {
static TraceDescriptor GetTraceDescriptor(const void* address);
};
} // namespace internal
/**
* Trait specifying how the garbage collector processes an object of type T.
*
@ -64,7 +62,7 @@ struct V8_EXPORT TraceTraitFromInnerAddressImpl {
* type.
*/
template <typename T>
struct TraceTrait {
struct TraceTraitBase {
static_assert(internal::IsTraceableV<T>, "T must have a Trace() method");
/**
@ -89,6 +87,11 @@ struct TraceTrait {
}
};
} // namespace internal
template <typename T>
struct TraceTrait : public internal::TraceTraitBase<T> {};
namespace internal {
template <typename T>