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

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

Issue 2826653002: Generate getters/setters for some fields on groups in ComputedStyle (Closed)
Patch Set: suzyh@'s comments 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
Index: third_party/WebKit/Source/build/scripts/templates/fields/external.tmpl
diff --git a/third_party/WebKit/Source/build/scripts/templates/fields/external.tmpl b/third_party/WebKit/Source/build/scripts/templates/fields/external.tmpl
index b5753c26a001eebabd14697eafbff861b33a901b..a969e7600d450addef4d2674a04ad9970f3df94b 100644
--- a/third_party/WebKit/Source/build/scripts/templates/fields/external.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/fields/external.tmpl
@@ -1,8 +1,14 @@
{% import 'fields/base.tmpl' as base %}
{% from 'fields/field.tmpl' import decode %}
-{% macro decl_methods(field) %}
-{{base.decl_methods(field)}}
+{% macro decl_public_methods(field) %}
+{{base.decl_public_methods(field)}}
void {{field.setter_method_name}}({{field.type_name}}&& v) {
{{field.name}} = std::move({{decode(field, "v")}});
}
{% endmacro %}
+
+{% macro decl_protected_methods(field) -%}
+{{return_type}} {{field.internal_mutable_method_name}}() {
shend 2017/04/20 03:57:55 I think this one can stay as {{field.type_name}}&.
nainar 2017/04/20 05:15:58 Done.
+ return {{decode(field, field.name)}};
+}
+{%- endmacro %}

Powered by Google App Engine
This is Rietveld 408576698