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

Unified Diff: mojo/public/bindings/generators/cpp_templates/params_definition

Issue 65933002: Mojo: Unify the disparate source and header files into 3 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mistaken /n's Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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});

Powered by Google App Engine
This is Rietveld 408576698