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

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

Issue 198343002: Mojo: request/response bindings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 9 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 "struct_macros.tmpl" as struct_macros %} 1 {%- import "struct_macros.tmpl" as struct_macros %}
2 {%- set class_name = struct.name ~ "_Data" %} 2 {%- set class_name = struct.name ~ "_Data" %}
3 {%- set method_name = "k%s_%s_Name"|format(interface.name, method.name) %}
4 const uint32_t {{method_name}} = {{method.ordinal}};
5 class {{class_name}} { 3 class {{class_name}} {
6 public: 4 public:
7 static {{class_name}}* New(mojo::Buffer* buf) { 5 static {{class_name}}* New(mojo::Buffer* buf) {
8 return new (buf->Allocate(sizeof({{class_name}}))) 6 return new (buf->Allocate(sizeof({{class_name}})))
9 {{class_name}}(); 7 {{class_name}}();
10 } 8 }
11 9
12 {#--- Setters -#} 10 {#--- Setters -#}
13 {{ struct_macros.setters(struct) }} 11 {{ struct_macros.setters(struct) }}
14 12
(...skipping 20 matching lines...) Expand all
35 {{class_name}}() { 33 {{class_name}}() {
36 _header_.num_bytes = sizeof(*this); 34 _header_.num_bytes = sizeof(*this);
37 _header_.num_fields = 3; 35 _header_.num_fields = 3;
38 } 36 }
39 37
40 mojo::internal::StructHeader _header_; 38 mojo::internal::StructHeader _header_;
41 {{ struct_macros.fields(struct) }} 39 {{ struct_macros.fields(struct) }}
42 }; 40 };
43 MOJO_COMPILE_ASSERT(sizeof({{class_name}}) == {{struct.packed|struct_size}}, 41 MOJO_COMPILE_ASSERT(sizeof({{class_name}}) == {{struct.packed|struct_size}},
44 bad_sizeof_{{class_name}}); 42 bad_sizeof_{{class_name}});
OLDNEW
« no previous file with comments | « mojo/public/bindings/generators/cpp_templates/module.h.tmpl ('k') | mojo/public/bindings/generators/mojom_cpp_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698