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

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

Issue 1701423002: Mojo C++ bindings: support sync methods - part 1. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 {%- macro declare_params(prefix, parameters) %} 1 {%- macro declare_params(prefix, parameters) %}
2 {%- for param in parameters -%} 2 {%- for param in parameters -%}
3 {{param.kind|cpp_const_wrapper_type}} {{prefix}}{{param.name}} 3 {{param.kind|cpp_const_wrapper_type}} {{prefix}}{{param.name}}
4 {%- if not loop.last %}, {% endif %} 4 {%- if not loop.last %}, {% endif %}
5 {%- endfor %} 5 {%- endfor %}
6 {%- endmacro %} 6 {%- endmacro %}
7 7
8 {%- macro declare_callback(method) -%} 8 {%- macro declare_callback(method) -%}
9 mojo::Callback<void( 9 mojo::Callback<void(
10 {%- for param in method.response_parameters -%} 10 {%- for param in method.response_parameters -%}
11 {{param.kind|cpp_result_type}} 11 {{param.kind|cpp_result_type}}
12 {%- if not loop.last %}, {% endif %} 12 {%- if not loop.last %}, {% endif %}
13 {%- endfor -%} 13 {%- endfor -%}
14 )> 14 )>
15 {%- endmacro -%} 15 {%- endmacro -%}
16 16
17 {%- macro declare_request_params(prefix, method) -%} 17 {%- macro declare_request_params(prefix, method) -%}
18 {{declare_params(prefix, method.parameters)}} 18 {{declare_params(prefix, method.parameters)}}
19 {%- if method.response_parameters != None -%} 19 {%- if method.response_parameters != None -%}
20 {%- if method.parameters %}, {% endif -%} 20 {%- if method.parameters %}, {% endif -%}
21 const {{method.name}}Callback& callback 21 const {{method.name}}Callback& callback
22 {%- endif -%} 22 {%- endif -%}
23 {%- endmacro -%} 23 {%- endmacro -%}
24
25 {%- macro declare_sync_method_params(prefix, method) -%}
26 {{declare_params(prefix, method.parameters)}}
27 {%- if method.response_parameters %}
28 {%- if method.parameters %}, {% endif %}
29 {%- for param in method.response_parameters -%}
30 {{param.kind|cpp_wrapper_type}}* {{prefix}}{{param.name}}
31 {%- if not loop.last %}, {% endif %}
32 {%- endfor %}
33 {%- endif -%}
34 {%- endmacro -%}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698