| 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, use_new_wrappe
r_types) %} | 8 {%- macro declare_responder_params(prefix, parameters, for_blink) %} |
| 9 {%- for param in parameters -%} | 9 {%- for param in parameters -%} |
| 10 {%- if (not param.kind|is_string_kind) or for_blink or | |
| 11 use_new_wrapper_types -%} | |
| 12 {{param.kind|cpp_wrapper_param_type}} {{prefix}}{{param.name}} | 10 {{param.kind|cpp_wrapper_param_type}} {{prefix}}{{param.name}} |
| 13 {%- else %} | |
| 14 mojo::String {{prefix}}{{param.name}} | |
| 15 {%- endif %} | |
| 16 {%- if not loop.last %}, {% endif %} | 11 {%- if not loop.last %}, {% endif %} |
| 17 {%- endfor %} | 12 {%- endfor %} |
| 18 {%- endmacro %} | 13 {%- endmacro %} |
| 19 | 14 |
| 20 {%- macro declare_callback(method, for_blink, use_new_wrapper_types, use_once_ca
llback) -%} | 15 {%- macro declare_callback(method, for_blink, use_once_callback) -%} |
| 21 {%- if use_once_callback -%} | 16 {%- if use_once_callback -%} |
| 22 base::OnceCallback<void( | 17 base::OnceCallback<void( |
| 23 {%- else -%} | 18 {%- else -%} |
| 24 base::Callback<void( | 19 base::Callback<void( |
| 25 {%- endif -%} | 20 {%- endif -%} |
| 26 {%- for param in method.response_parameters -%} | 21 {%- for param in method.response_parameters -%} |
| 27 {#- TODO(yzshen): For historical reasons, we use mojo::String here (instead of | |
| 28 const mojo::String&) inconsistently. Preserve the behavior temporarily. #} | |
| 29 {%- if (not param.kind|is_string_kind) or for_blink or | |
| 30 use_new_wrapper_types -%} | |
| 31 {{param.kind|cpp_wrapper_param_type}} | 22 {{param.kind|cpp_wrapper_param_type}} |
| 32 {%- else -%} | |
| 33 mojo::String | |
| 34 {%- endif %} | |
| 35 {%- if not loop.last %}, {% endif %} | 23 {%- if not loop.last %}, {% endif %} |
| 36 {%- endfor -%} | 24 {%- endfor -%} |
| 37 )> | 25 )> |
| 38 {%- endmacro -%} | 26 {%- endmacro -%} |
| 39 | 27 |
| 40 {%- macro declare_request_params(prefix, method, use_once_callback) -%} | 28 {%- macro declare_request_params(prefix, method, use_once_callback) -%} |
| 41 {{declare_params(prefix, method.parameters)}} | 29 {{declare_params(prefix, method.parameters)}} |
| 42 {%- if method.response_parameters != None -%} | 30 {%- if method.response_parameters != None -%} |
| 43 {%- if method.parameters %}, {% endif -%} | 31 {%- if method.parameters %}, {% endif -%} |
| 44 {%- if use_once_callback -%} | 32 {%- if use_once_callback -%} |
| 45 {{method.name}}Callback callback | 33 {{method.name}}Callback callback |
| 46 {%- else -%} | 34 {%- else -%} |
| 47 const {{method.name}}Callback& callback | 35 const {{method.name}}Callback& callback |
| 48 {%- endif -%} | 36 {%- endif -%} |
| 49 {%- endif -%} | 37 {%- endif -%} |
| 50 {%- endmacro -%} | 38 {%- endmacro -%} |
| 51 | 39 |
| 52 {%- macro declare_sync_method_params(prefix, method) -%} | 40 {%- macro declare_sync_method_params(prefix, method) -%} |
| 53 {{declare_params(prefix, method.parameters)}} | 41 {{declare_params(prefix, method.parameters)}} |
| 54 {%- if method.response_parameters %} | 42 {%- if method.response_parameters %} |
| 55 {%- if method.parameters %}, {% endif %} | 43 {%- if method.parameters %}, {% endif %} |
| 56 {%- for param in method.response_parameters -%} | 44 {%- for param in method.response_parameters -%} |
| 57 {{param.kind|cpp_wrapper_type}}* {{prefix}}{{param.name}} | 45 {{param.kind|cpp_wrapper_type}}* {{prefix}}{{param.name}} |
| 58 {%- if not loop.last %}, {% endif %} | 46 {%- if not loop.last %}, {% endif %} |
| 59 {%- endfor %} | 47 {%- endfor %} |
| 60 {%- endif -%} | 48 {%- endif -%} |
| 61 {%- endmacro -%} | 49 {%- endmacro -%} |
| OLD | NEW |