Index: mojo/public/bindings/generators/cpp_templates/params_definition |
diff --git a/mojo/public/bindings/generators/cpp_templates/params_definition b/mojo/public/bindings/generators/cpp_templates/params_definition |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b0d646b6793b348b3d83e0e9806b7a75cd87cd9b |
--- /dev/null |
+++ b/mojo/public/bindings/generators/cpp_templates/params_definition |
@@ -0,0 +1,25 @@ |
+const uint32_t $METHOD_NAME = $METHOD_ID; |
+class $CLASS { |
+ public: |
+ static $CLASS* New(mojo::Buffer* buf) { |
+ return new (buf->Allocate(sizeof($CLASS))) |
+ $CLASS(); |
+ } |
+ |
+$SETTERS |
+ |
+$GETTERS |
+ |
+ private: |
+ friend class mojo::internal::ObjectTraits<$CLASS>; |
+ |
+ $CLASS() { |
+ _header_.num_bytes = sizeof(*this); |
+ _header_.num_fields = 3; |
+ } |
+ |
+ mojo::internal::StructHeader _header_; |
+$FIELDS |
+}; |
+MOJO_COMPILE_ASSERT(sizeof($CLASS) == $SIZE, |
+ bad_sizeof_${CLASS}); |