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

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

Issue 332653002: Mojo: Fix the C++ bindings generator for methods taking imported interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 {%- import "interface_macros.tmpl" as interface_macros %} 1 {%- import "interface_macros.tmpl" as interface_macros %}
2 {%- set class_name = interface.name %} 2 {%- set class_name = interface.name %}
3 {%- set proxy_name = interface.name ~ "Proxy" %} 3 {%- set proxy_name = interface.name ~ "Proxy" %}
4 {%- set namespace_as_string = "%s"|format(namespace|replace(".","::")) %} 4 {%- set namespace_as_string = "%s"|format(namespace|replace(".","::")) %}
5 5
6 {%- macro alloc_params(parameters) %} 6 {%- macro alloc_params(parameters) %}
7 {%- for param in parameters %} 7 {%- for param in parameters %}
8 {%- if param.kind|is_object_kind %} 8 {%- if param.kind|is_object_kind %}
9 {{param.kind|cpp_result_type}} p{{loop.index}}; 9 {{param.kind|cpp_result_type}} p{{loop.index}};
10 Deserialize_(params->{{param.name}}.ptr, &p{{loop.index}}); 10 Deserialize_(params->{{param.name}}.ptr, &p{{loop.index}});
11 {% endif -%} 11 {% endif -%}
12 {%- endfor %} 12 {%- endfor %}
13 {%- endmacro %} 13 {%- endmacro %}
14 14
15 {%- macro pass_params(parameters) %} 15 {%- macro pass_params(parameters) %}
16 {%- for param in parameters %} 16 {%- for param in parameters %}
17 {%- if param.kind|is_string_kind -%} 17 {%- if param.kind|is_string_kind -%}
18 p{{loop.index}} 18 p{{loop.index}}
19 {%- elif param.kind|is_object_kind -%} 19 {%- elif param.kind|is_object_kind -%}
20 p{{loop.index}}.Pass() 20 p{{loop.index}}.Pass()
21 {%- elif param.kind|is_interface_kind -%} 21 {%- elif param.kind|is_interface_kind -%}
22 mojo::MakeProxy<{{param.kind.name}}>(mojo::MakeScopedHandle(mojo::internal::Fetc hAndReset(&params->{{param.name}}))) 22 mojo::MakeProxy<{{param.kind|get_name_for_kind}}>(mojo::MakeScopedHandle(mojo::i nternal::FetchAndReset(&params->{{param.name}})))
23 {%- elif param.kind|is_interface_request_kind -%} 23 {%- elif param.kind|is_interface_request_kind -%}
24 mojo::MakeRequest<{{param.kind.kind.name}}>(mojo::MakeScopedHandle(mojo::interna l::FetchAndReset(&params->{{param.name}}))) 24 mojo::MakeRequest<{{param.kind.kind|get_name_for_kind}}>(mojo::MakeScopedHandle( mojo::internal::FetchAndReset(&params->{{param.name}})))
25 {%- elif param.kind|is_handle_kind -%} 25 {%- elif param.kind|is_handle_kind -%}
26 mojo::MakeScopedHandle(mojo::internal::FetchAndReset(&params->{{param.name}})) 26 mojo::MakeScopedHandle(mojo::internal::FetchAndReset(&params->{{param.name}}))
27 {%- elif param.kind|is_enum_kind -%} 27 {%- elif param.kind|is_enum_kind -%}
28 static_cast<{{param.kind|cpp_wrapper_type}}>(params->{{param.name}}) 28 static_cast<{{param.kind|cpp_wrapper_type}}>(params->{{param.name}})
29 {%- else -%} 29 {%- else -%}
30 params->{{param.name}} 30 params->{{param.name}}
31 {%- endif -%} 31 {%- endif -%}
32 {%- if not loop.last %}, {% endif %} 32 {%- if not loop.last %}, {% endif %}
33 {%- endfor %} 33 {%- endfor %}
34 {%- endmacro %} 34 {%- endmacro %}
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 } 306 }
307 break; 307 break;
308 } 308 }
309 {%- endfor %} 309 {%- endfor %}
310 } 310 }
311 {%- endif %} 311 {%- endif %}
312 312
313 return sink_->Accept(message); 313 return sink_->Accept(message);
314 } 314 }
315 {%- endif -%} 315 {%- endif -%}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698