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

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

Issue 2829213002: Clean up ComputedStyle field templates. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/build/scripts/templates/fields/external.tmpl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 {% from 'fields/field.tmpl' import encode, decode, return_type, argument_type %} 1 {% from 'fields/field.tmpl' import encode, decode, const_ref, nonconst_ref %}
2 {% macro decl_public_methods(field) -%} 2
3 inline static {{return_type(field)}} {{field.initial_method_name}}() { 3 {% macro decl_initial_method(field) -%}
4 inline static {{field.type_name}} {{field.initial_method_name}}() {
4 return {{field.default_value}}; 5 return {{field.default_value}};
5 } 6 }
6 {{return_type(field)}} {{field.getter_method_name}}() const { 7 {%- endmacro %}
8
9 {% macro decl_getter_method(field) -%}
10 {{const_ref(field)}} {{field.getter_method_name}}() const {
7 return {{decode(field, field.name)}}; 11 return {{decode(field, field.name)}};
8 } 12 }
9 void {{field.setter_method_name}}({{argument_type(field)}} v) { 13 {%- endmacro %}
14
15 {% macro decl_setter_method(field) -%}
16 void {{field.setter_method_name}}({{const_ref(field)}} v) {
10 {{field.name}} = {{encode(field, "v")}}; 17 {{field.name}} = {{encode(field, "v")}};
11 } 18 }
19 {%- endmacro %}
20
21 {% macro decl_resetter_method(field) -%}
12 inline void {{field.resetter_method_name}}() { 22 inline void {{field.resetter_method_name}}() {
13 {{field.name}} = {{encode(field, field.default_value)}}; 23 {{field.name}} = {{encode(field, field.default_value)}};
14 } 24 }
15 {%- endmacro %} 25 {%- endmacro %}
16 26
17 {% macro decl_protected_methods(field) -%} 27 {% macro decl_mutable_method(field) -%}
18 {{return_type(field)}} {{field.internal_getter_method_name}}() const { 28 {{nonconst_ref(field)}} {{field.mutable_method_name}}() const {
19 return {{decode(field, field.name)}}; 29 return {{decode(field, field.name)}};
20 } 30 }
21 void {{field.internal_setter_method_name}}({{argument_type(field)}} v) { 31 {%- endmacro %}
32
33 {% macro decl_internal_getter_method(field) -%}
34 {{const_ref(field)}} {{field.internal_getter_method_name}}() const {
35 return {{decode(field, field.name)}};
36 }
37 {%- endmacro %}
38
39 {% macro decl_internal_setter_method(field) -%}
40 void {{field.internal_setter_method_name}}({{const_ref(field)}} v) {
22 {{field.name}} = {{encode(field, "v")}}; 41 {{field.name}} = {{encode(field, "v")}};
23 } 42 }
24 {%- endmacro %} 43 {%- endmacro %}
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/build/scripts/templates/fields/external.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698