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

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

Issue 2080083002: Revert of Deletes mojo::Callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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_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) %} 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 -%} 10 {%- if (not param.kind|is_string_kind) or for_blink -%}
11 {{param.kind|cpp_wrapper_param_type}} {{prefix}}{{param.name}} 11 {{param.kind|cpp_wrapper_param_type}} {{prefix}}{{param.name}}
12 {%- else %} 12 {%- else %}
13 mojo::String {{prefix}}{{param.name}} 13 mojo::String {{prefix}}{{param.name}}
14 {%- endif %} 14 {%- endif %}
15 {%- if not loop.last %}, {% endif %} 15 {%- if not loop.last %}, {% endif %}
16 {%- endfor %} 16 {%- endfor %}
17 {%- endmacro %} 17 {%- endmacro %}
18 18
19 {%- macro declare_callback(method, for_blink) -%} 19 {%- macro declare_callback(method, for_blink) -%}
20 base::Callback<void( 20 mojo::Callback<void(
21 {%- for param in method.response_parameters -%} 21 {%- for param in method.response_parameters -%}
22 {#- 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
23 const mojo::String&) inconsistently. Preserve the behavior temporarily. #} 23 const mojo::String&) inconsistently. Preserve the behavior temporarily. #}
24 {%- if (not param.kind|is_string_kind) or for_blink -%} 24 {%- if (not param.kind|is_string_kind) or for_blink -%}
25 {{param.kind|cpp_wrapper_param_type}} 25 {{param.kind|cpp_wrapper_param_type}}
26 {%- else -%} 26 {%- else -%}
27 mojo::String 27 mojo::String
28 {%- endif %} 28 {%- endif %}
29 {%- if not loop.last %}, {% endif %} 29 {%- if not loop.last %}, {% endif %}
30 {%- endfor -%} 30 {%- endfor -%}
(...skipping 11 matching lines...) Expand all
42 {%- macro declare_sync_method_params(prefix, method) -%} 42 {%- macro declare_sync_method_params(prefix, method) -%}
43 {{declare_params(prefix, method.parameters)}} 43 {{declare_params(prefix, method.parameters)}}
44 {%- if method.response_parameters %} 44 {%- if method.response_parameters %}
45 {%- if method.parameters %}, {% endif %} 45 {%- if method.parameters %}, {% endif %}
46 {%- for param in method.response_parameters -%} 46 {%- for param in method.response_parameters -%}
47 {{param.kind|cpp_wrapper_type}}* {{prefix}}{{param.name}} 47 {{param.kind|cpp_wrapper_type}}* {{prefix}}{{param.name}}
48 {%- if not loop.last %}, {% endif %} 48 {%- if not loop.last %}, {% endif %}
49 {%- endfor %} 49 {%- endfor %}
50 {%- endif -%} 50 {%- endif -%}
51 {%- endmacro -%} 51 {%- endmacro -%}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698