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

Unified Diff: mojo/public/tools/bindings/generators/cpp_templates/interface_macros.tmpl

Issue 2136733002: Mojo C++ bindings: add a new mode to generator to use native STL/WTF types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@67_new
Patch Set: . Created 4 years, 5 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: mojo/public/tools/bindings/generators/cpp_templates/interface_macros.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/interface_macros.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/interface_macros.tmpl
index c996adc3f2bb618e541a0478c942a2ce18ec6430..4bec4c64f5977537f4bce8ae8a2cf01c5db8be91 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/interface_macros.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/interface_macros.tmpl
@@ -5,9 +5,10 @@
{%- endfor %}
{%- endmacro %}
-{%- macro declare_responder_params(prefix, parameters, for_blink) %}
+{%- macro declare_responder_params(prefix, parameters, for_blink, use_new_wrapper_types) %}
{%- for param in parameters -%}
-{%- if (not param.kind|is_string_kind) or for_blink -%}
+{%- if (not param.kind|is_string_kind) or for_blink or
+ use_new_wrapper_types -%}
{{param.kind|cpp_wrapper_param_type}} {{prefix}}{{param.name}}
{%- else %}
mojo::String {{prefix}}{{param.name}}
@@ -16,17 +17,18 @@ mojo::String {{prefix}}{{param.name}}
{%- endfor %}
{%- endmacro %}
-{%- macro declare_callback(method, for_blink) -%}
+{%- macro declare_callback(method, for_blink, use_new_wrapper_types) -%}
base::Callback<void(
{%- for param in method.response_parameters -%}
{#- TODO(yzshen): For historical reasons, we use mojo::String here (instead of
const mojo::String&) inconsistently. Preserve the behavior temporarily. #}
-{%- if (not param.kind|is_string_kind) or for_blink -%}
+{%- if (not param.kind|is_string_kind) or for_blink or
+ use_new_wrapper_types -%}
{{param.kind|cpp_wrapper_param_type}}
-{%- else -%}
+{%- else -%}
mojo::String
-{%- endif %}
-{%- if not loop.last %}, {% endif %}
+{%- endif %}
+{%- if not loop.last %}, {% endif %}
{%- endfor -%}
)>
{%- endmacro -%}

Powered by Google App Engine
This is Rietveld 408576698