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

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

Issue 2697953004: Add support for generating external types in ComputedStyleBase. (Closed)
Patch Set: remove unused macro Created 3 years, 9 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
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 0685305032939dbdb5da46800e81f9690f020792..2a0bc8e5e521451da029f6877fd9152f260188a9 100644
--- a/third_party/WebKit/Source/build/scripts/templates/fields/base.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/fields/base.tmpl
@@ -1,15 +1,16 @@
+{% from 'fields/field.tmpl' import encode, decode, return_type %}
{% macro decl_methods(field) -%}
-inline static {{field.type_name}} {{field.initial_method_name}}() {
+inline static {{return_type(field)}} {{field.initial_method_name}}() {
return {{field.default_value}};
}
-{{field.type_name}} {{field.getter_method_name}}() const {
- return static_cast<{{field.type_name}}>({{field.name}});
+{{return_type(field)}} {{field.getter_method_name}}() const {
+ return {{decode(field, field.name)}};
}
void {{field.setter_method_name}}({{field.type_name}} v) {
- {{field.name}} = static_cast<unsigned>(v);
+ {{field.name}} = {{encode(field, "v")}};
}
inline void {{field.resetter_method_name}}() {
- {{field.name}} = static_cast<unsigned>({{field.default_value}});
+ {{field.name}} = {{encode(field, field.default_value)}};
}
{%- endmacro %}

Powered by Google App Engine
This is Rietveld 408576698