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

Side by Side Diff: third_party/WebKit/Source/build/scripts/templates/fields/group.tmpl

Issue 2921543002: Make ComputedStyleBase use MemberCopy when copying pointer fields. (Closed)
Patch Set: Rebase Created 3 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 unified diff | Download patch
OLDNEW
1 {% from 'fields/field.tmpl' import encode, declare_storage, compare %} 1 {% from 'fields/field.tmpl' import encode, declare_storage, compare %}
2 {% from 'macros.tmpl' import print_if %} 2 {% from 'macros.tmpl' import print_if %}
3 {% macro define_field_group_class(group): -%} 3 {% macro define_field_group_class(group): -%}
4 class {{group.type_name}} : public RefCounted<{{group.type_name}}> { 4 class {{group.type_name}} : public RefCounted<{{group.type_name}}> {
5 public: 5 public:
6 static PassRefPtr<{{group.type_name}}> Create() { 6 static PassRefPtr<{{group.type_name}}> Create() {
7 return AdoptRef(new {{group.type_name}}); 7 return AdoptRef(new {{group.type_name}});
8 } 8 }
9 PassRefPtr<{{group.type_name}}> Copy() const { 9 PassRefPtr<{{group.type_name}}> Copy() const {
10 return AdoptRef(new {{group.type_name}}(*this)); 10 return AdoptRef(new {{group.type_name}}(*this));
(...skipping 14 matching lines...) Expand all
25 25
26 private: 26 private:
27 {{group.type_name}}() : 27 {{group.type_name}}() :
28 {% for field in group.fields %} 28 {% for field in group.fields %}
29 {{field.name}}({{encode(field, field.default_value)}}){{print_if(not loop. last, ',')}} 29 {{field.name}}({{encode(field, field.default_value)}}){{print_if(not loop. last, ',')}}
30 {% endfor %} 30 {% endfor %}
31 {} 31 {}
32 32
33 {{group.type_name}}(const {{group.type_name}}& other) : 33 {{group.type_name}}(const {{group.type_name}}& other) :
34 {% for field in group.fields %} 34 {% for field in group.fields %}
35 {% if field.wrapper_pointer_name %}
36 {{field.name}}(MemberCopy(other.{{field.name}})){{print_if(not loop.last, ',')}}
37 {% else %}
35 {{field.name}}(other.{{field.name}}){{print_if(not loop.last, ',')}} 38 {{field.name}}(other.{{field.name}}){{print_if(not loop.last, ',')}}
39 {% endif %}
36 {% endfor %} 40 {% endfor %}
37 {} 41 {}
38 }; 42 };
39 {%- endmacro %} 43 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698