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

Unified Diff: mojo/public/bindings/generators/cpp_templates/interface_definition.tmpl

Issue 163113002: Mojo: Prefix user-defined parameter names to avoid conflicts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/bindings/generators/cpp_templates/interface_definition.tmpl
diff --git a/mojo/public/bindings/generators/cpp_templates/interface_definition.tmpl b/mojo/public/bindings/generators/cpp_templates/interface_definition.tmpl
index 713939ae1d0f68ce745b928dfc34b5394d3b7885..fc6c17a1f820414f4e08624741b643543958d5cb 100644
--- a/mojo/public/bindings/generators/cpp_templates/interface_definition.tmpl
+++ b/mojo/public/bindings/generators/cpp_templates/interface_definition.tmpl
@@ -8,7 +8,7 @@
{#--- Proxy definitions #}
{%- macro params_list(method) %}
{%- for param in method.parameters -%}
-{{param.kind|cpp_const_wrapper_type}} {{param.name}}
+{{param.kind|cpp_const_wrapper_type}} in_{{param.name}}
{%- if not loop.last %}, {% endif %}
{%- endfor %}
{%- endmacro %}
@@ -23,8 +23,8 @@ void {{proxy_name}}::{{method.name}}({{params_list(method)}}) {
{#--- Computes #}
{%- for param in method.parameters %}
{%- if param.kind|is_object_kind %}
- if (!{{param.name}}.is_null())
- payload_size += mojo::internal::Unwrap({{param.name}})->ComputeSize();
+ if (!in_{{param.name}}.is_null())
+ payload_size += mojo::internal::Unwrap(in_{{param.name}})->ComputeSize();
{%- endif %}
{%- endfor %}
@@ -36,13 +36,13 @@ void {{proxy_name}}::{{method.name}}({{params_list(method)}}) {
{#--- Sets #}
{% for param in method.parameters %}
{%- if param.kind|is_object_kind %}
- if (!{{param.name}}.is_null())
+ if (!in_{{param.name}}.is_null())
params->set_{{param.name}}(
- mojo::internal::Unwrap({{param.name}})->Clone(builder.buffer()));
+ mojo::internal::Unwrap(in_{{param.name}})->Clone(builder.buffer()));
{%- elif param.kind|is_handle_kind %}
- params->set_{{param.name}}({{param.name}}.release());
+ params->set_{{param.name}}(in_{{param.name}}.release());
{%- else %}
- params->set_{{param.name}}({{param.name}});
+ params->set_{{param.name}}(in_{{param.name}});
{%- endif %}
{%- endfor %}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698