Issue #1742 - Part 1: Refactor rooting base class templates

Based on Bug 1325406
This commit is contained in:
Moonchild 2022-05-24 06:51:11 +00:00 committed by roytam1
commit 80d7d43961
24 changed files with 239 additions and 512 deletions

View file

@ -126,15 +126,15 @@ struct IsHeapConstructibleType<nsXBLMaybeCompiled<T>>
static const bool value = true;
};
template <class UncompiledT>
class HeapBase<nsXBLMaybeCompiled<UncompiledT>>
template <class UncompiledT, class Wrapper>
class HeapBase<nsXBLMaybeCompiled<UncompiledT>, Wrapper>
{
const JS::Heap<nsXBLMaybeCompiled<UncompiledT>>& wrapper() const {
return *static_cast<const JS::Heap<nsXBLMaybeCompiled<UncompiledT>>*>(this);
const Wrapper& wrapper() const {
return *static_cast<const Wrapper*>(this);
}
JS::Heap<nsXBLMaybeCompiled<UncompiledT>>& wrapper() {
return *static_cast<JS::Heap<nsXBLMaybeCompiled<UncompiledT>>*>(this);
Wrapper& wrapper() {
return *static_cast<Wrapper*>(this);
}
const nsXBLMaybeCompiled<UncompiledT>* extract() const {