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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/build/scripts/templates/fields/base.tmpl
diff --git a/third_party/WebKit/Source/build/scripts/templates/fields/base.tmpl b/third_party/WebKit/Source/build/scripts/templates/fields/base.tmpl
index d0a9ee14a3e08f26bdd3e9aa06ff1ca95aa50281..82ecd9e49f81d3128684819af5ae289625e9e82d 100644
--- a/third_party/WebKit/Source/build/scripts/templates/fields/base.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/fields/base.tmpl
@@ -1,24 +1,43 @@
-{% from 'fields/field.tmpl' import encode, decode, return_type, argument_type %}
-{% macro decl_public_methods(field) -%}
-inline static {{return_type(field)}} {{field.initial_method_name}}() {
+{% from 'fields/field.tmpl' import encode, decode, const_ref, nonconst_ref %}
+
+{% macro decl_initial_method(field) -%}
+inline static {{field.type_name}} {{field.initial_method_name}}() {
return {{field.default_value}};
}
-{{return_type(field)}} {{field.getter_method_name}}() const {
+{%- endmacro %}
+
+{% macro decl_getter_method(field) -%}
+{{const_ref(field)}} {{field.getter_method_name}}() const {
return {{decode(field, field.name)}};
}
-void {{field.setter_method_name}}({{argument_type(field)}} v) {
+{%- endmacro %}
+
+{% macro decl_setter_method(field) -%}
+void {{field.setter_method_name}}({{const_ref(field)}} v) {
{{field.name}} = {{encode(field, "v")}};
}
+{%- endmacro %}
+
+{% macro decl_resetter_method(field) -%}
inline void {{field.resetter_method_name}}() {
{{field.name}} = {{encode(field, field.default_value)}};
}
{%- endmacro %}
-{% macro decl_protected_methods(field) -%}
-{{return_type(field)}} {{field.internal_getter_method_name}}() const {
+{% macro decl_mutable_method(field) -%}
+{{nonconst_ref(field)}} {{field.mutable_method_name}}() const {
return {{decode(field, field.name)}};
}
-void {{field.internal_setter_method_name}}({{argument_type(field)}} v) {
+{%- endmacro %}
+
+{% macro decl_internal_getter_method(field) -%}
+{{const_ref(field)}} {{field.internal_getter_method_name}}() const {
+ return {{decode(field, field.name)}};
+}
+{%- endmacro %}
+
+{% macro decl_internal_setter_method(field) -%}
+void {{field.internal_setter_method_name}}({{const_ref(field)}} v) {
{{field.name}} = {{encode(field, "v")}};
}
{%- endmacro %}
« 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