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

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

Issue 304273004: Add name to services (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Get chrome to build 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 5
5 {%- macro alloc_params(parameters) %} 6 {%- macro alloc_params(parameters) %}
6 {%- for param in parameters %} 7 {%- for param in parameters %}
7 {%- if param.kind|is_object_kind %} 8 {%- if param.kind|is_object_kind %}
8 {{param.kind|cpp_result_type}} p{{loop.index}}; 9 {{param.kind|cpp_result_type}} p{{loop.index}};
9 Deserialize_(params->{{param.name}}.ptr, &p{{loop.index}}); 10 Deserialize_(params->{{param.name}}.ptr, &p{{loop.index}});
10 {% endif -%} 11 {% endif -%}
11 {%- endfor %} 12 {%- endfor %}
12 {%- endmacro %} 13 {%- endmacro %}
13 14
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 {%- else %} 66 {%- else %}
66 params->{{param.name}} = in_{{param.name}}; 67 params->{{param.name}} = in_{{param.name}};
67 {%- endif %} 68 {%- endif %}
68 {%- endfor %} 69 {%- endfor %}
69 mojo::Message message; 70 mojo::Message message;
70 params->EncodePointersAndHandles(message.mutable_handles()); 71 params->EncodePointersAndHandles(message.mutable_handles());
71 builder.Finish(&message); 72 builder.Finish(&message);
72 {%- endmacro %} 73 {%- endmacro %}
73 74
74 {#--- Begin #} 75 {#--- Begin #}
75 76 const char* {{class_name}}::Name_ = "{{namespace_as_string}}::{{class_name}}";
76 {#--- Constants #} 77 {#--- Constants #}
77 {% for constant in interface.constants %} 78 {% for constant in interface.constants %}
78 const {{constant.kind|cpp_pod_type}} {{interface.name}}::{{constant.name}} = {{c onstant.value|expression_to_text(module)}}; 79 const {{constant.kind|cpp_pod_type}} {{interface.name}}::{{constant.name}} = {{c onstant.value|expression_to_text(module)}};
79 {%- endfor %} 80 {%- endfor %}
80 81
81 {#--- ForwardToCallback definition #} 82 {#--- ForwardToCallback definition #}
82 {%- for method in interface.methods -%} 83 {%- for method in interface.methods -%}
83 {%- if method.response_parameters != None %} 84 {%- if method.response_parameters != None %}
84 class {{class_name}}_{{method.name}}_ForwardToCallback 85 class {{class_name}}_{{method.name}}_ForwardToCallback
85 : public mojo::MessageReceiver { 86 : public mojo::MessageReceiver {
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 {% if interface|has_callbacks %} 266 {% if interface|has_callbacks %}
266 {{class_name}}ResponseValidator::{{class_name}}ResponseValidator( 267 {{class_name}}ResponseValidator::{{class_name}}ResponseValidator(
267 mojo::MessageReceiver* sink) : MessageFilter(sink) { 268 mojo::MessageReceiver* sink) : MessageFilter(sink) {
268 } 269 }
269 270
270 bool {{class_name}}ResponseValidator::Accept(mojo::Message* message) { 271 bool {{class_name}}ResponseValidator::Accept(mojo::Message* message) {
271 // TODO(yzshen): implement validation logic. 272 // TODO(yzshen): implement validation logic.
272 return sink_->Accept(message); 273 return sink_->Accept(message);
273 } 274 }
274 {%- endif -%} 275 {%- endif -%}
OLDNEW
« no previous file with comments | « mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl ('k') | mojo/service_manager/service_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698