OLD | NEW |
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_wrapper_param_type}} {{prefix}}{{param.name}} | 3 {{param.kind|cpp_wrapper_param_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_responder_params(prefix, parameters, for_blink) %} |
| 9 {%- for param in parameters -%} |
| 10 {%- if (not param.kind|is_string_kind) or for_blink -%} |
| 11 {{param.kind|cpp_wrapper_param_type}} {{prefix}}{{param.name}} |
| 12 {%- else %} |
| 13 mojo::String {{prefix}}{{param.name}} |
| 14 {%- endif %} |
| 15 {%- if not loop.last %}, {% endif %} |
| 16 {%- endfor %} |
| 17 {%- endmacro %} |
| 18 |
8 {%- macro declare_callback(method, for_blink) -%} | 19 {%- macro declare_callback(method, for_blink) -%} |
9 mojo::Callback<void( | 20 mojo::Callback<void( |
10 {%- for param in method.response_parameters -%} | 21 {%- for param in method.response_parameters -%} |
11 {#- TODO(yzshen): For historical reasons, we use mojo::String here (instead of | 22 {#- TODO(yzshen): For historical reasons, we use mojo::String here (instead of |
12 const mojo::String&) inconsistently. Preserve the behavior temporarily. #} | 23 const mojo::String&) inconsistently. Preserve the behavior temporarily. #} |
13 {%- if (not param.kind|is_string_kind) or for_blink -%} | 24 {%- if (not param.kind|is_string_kind) or for_blink -%} |
14 {{param.kind|cpp_wrapper_param_type}} | 25 {{param.kind|cpp_wrapper_param_type}} |
15 {%- else -%} | 26 {%- else -%} |
16 mojo::String | 27 mojo::String |
17 {%- endif %} | 28 {%- endif %} |
(...skipping 13 matching lines...) Expand all Loading... |
31 {%- macro declare_sync_method_params(prefix, method) -%} | 42 {%- macro declare_sync_method_params(prefix, method) -%} |
32 {{declare_params(prefix, method.parameters)}} | 43 {{declare_params(prefix, method.parameters)}} |
33 {%- if method.response_parameters %} | 44 {%- if method.response_parameters %} |
34 {%- if method.parameters %}, {% endif %} | 45 {%- if method.parameters %}, {% endif %} |
35 {%- for param in method.response_parameters -%} | 46 {%- for param in method.response_parameters -%} |
36 {{param.kind|cpp_wrapper_type}}* {{prefix}}{{param.name}} | 47 {{param.kind|cpp_wrapper_type}}* {{prefix}}{{param.name}} |
37 {%- if not loop.last %}, {% endif %} | 48 {%- if not loop.last %}, {% endif %} |
38 {%- endfor %} | 49 {%- endfor %} |
39 {%- endif -%} | 50 {%- endif -%} |
40 {%- endmacro -%} | 51 {%- endmacro -%} |
OLD | NEW |