Commit 1d9e0b92 authored by shend's avatar shend Committed by Commit bot

Make generated field groups inherit from RefCountedCopyable.

Currently generated groups such as StyleSurroundData inherit from
RefCounted, which means we have to explicitly specify a copy
constructor. Inheriting from RefCountedCopyable instead means we can
just use the compiler generated copy constructor.

Diff of generated files:


Cr-Commit-Position: refs/heads/master@{#467262}
parent 04c5a199
{% from 'fields/field.tmpl' import encode, declare_storage %}
{% from 'macros.tmpl' import print_if %}
{% macro define_field_group_class(group): -%}
class {{group.type_name}} : public RefCounted<{{group.type_name}}> {
class {{group.type_name}} : public RefCountedCopyable<{{group.type_name}}> {
static PassRefPtr<{{group.type_name}}> Create() {
return AdoptRef(new {{group.type_name}});
......@@ -30,11 +30,6 @@ class {{group.type_name}} : public RefCounted<{{group.type_name}}> {
{% endfor %}
ALWAYS_INLINE {{group.type_name}}(const {{group.type_name}}& other) :
{% for field in group.fields %}
{{}}(other.{{}}){{print_if(not loop.last, ',')}}
{% endfor %}
{{group.type_name}}(const {{group.type_name}}&) = default;
{%- endmacro %}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment