OLD | NEW |
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}}); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 {{interface_macros.declare_params("in_", method.response_parameters)}}) cons
t { | 195 {{interface_macros.declare_params("in_", method.response_parameters)}}) cons
t { |
196 {{compute_payload_size(params_name, method.response_parameters)}} | 196 {{compute_payload_size(params_name, method.response_parameters)}} |
197 mojo::internal::ResponseMessageBuilder builder( | 197 mojo::internal::ResponseMessageBuilder builder( |
198 {{message_name}}, payload_size, request_id_); | 198 {{message_name}}, payload_size, request_id_); |
199 {{build_message(params_name, method.response_parameters, params_description)}} | 199 {{build_message(params_name, method.response_parameters, params_description)}} |
200 bool ok MOJO_ALLOW_UNUSED = responder_->Accept(&message); | 200 bool ok MOJO_ALLOW_UNUSED = responder_->Accept(&message); |
201 // TODO(darin): !ok returned here indicates a malformed message, and that may | 201 // TODO(darin): !ok returned here indicates a malformed message, and that may |
202 // be good reason to close the connection. However, we don't have a way to do | 202 // be good reason to close the connection. However, we don't have a way to do |
203 // that from here. We should add a way. | 203 // that from here. We should add a way. |
204 delete responder_; | 204 delete responder_; |
205 responder_ = NULL; | 205 responder_ = nullptr; |
206 } | 206 } |
207 {%- endif -%} | 207 {%- endif -%} |
208 {%- endfor %} | 208 {%- endfor %} |
209 | 209 |
210 {{class_name}}Stub::{{class_name}}Stub() | 210 {{class_name}}Stub::{{class_name}}Stub() |
211 : sink_(NULL) { | 211 : sink_(nullptr) { |
212 } | 212 } |
213 | 213 |
214 {#--- Stub definition #} | 214 {#--- Stub definition #} |
215 | 215 |
216 bool {{class_name}}Stub::Accept(mojo::Message* message) { | 216 bool {{class_name}}Stub::Accept(mojo::Message* message) { |
217 {%- if interface.methods %} | 217 {%- if interface.methods %} |
218 switch (message->header()->name) { | 218 switch (message->header()->name) { |
219 {%- for method in interface.methods %} | 219 {%- for method in interface.methods %} |
220 case internal::k{{class_name}}_{{method.name}}_Name: { | 220 case internal::k{{class_name}}_{{method.name}}_Name: { |
221 {%- if method.response_parameters == None %} | 221 {%- if method.response_parameters == None %} |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 } | 325 } |
326 break; | 326 break; |
327 } | 327 } |
328 {%- endfor %} | 328 {%- endfor %} |
329 } | 329 } |
330 {%- endif %} | 330 {%- endif %} |
331 | 331 |
332 return sink_->Accept(message); | 332 return sink_->Accept(message); |
333 } | 333 } |
334 {%- endif -%} | 334 {%- endif -%} |
OLD | NEW |