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

Unified Diff: mojo/public/bindings/generators/module_struct.cc

Issue 52973003: mojo: break struct headers into headers and source (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add missing files Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: mojo/public/bindings/generators/module_struct.cc
diff --git a/mojo/public/bindings/generators/module_struct.cc b/mojo/public/bindings/generators/module_struct.cc
new file mode 100644
index 0000000000000000000000000000000000000000..04b16308be4df7916f7ef63252890c76f7009921
--- /dev/null
+++ b/mojo/public/bindings/generators/module_struct.cc
@@ -0,0 +1,19 @@
+// Copyright $YEAR The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "$HEADER"
+
+namespace $NAMESPACE {
+
+// static
+$CLASS* $CLASS::New(mojo::Buffer* buf) {
+ return new (buf->Allocate(sizeof($CLASS))) $CLASS();
+}
+
+$CLASS::$CLASS() {
+ _header_.num_bytes = sizeof(*this);
+ _header_.num_fields = $NUM_FIELDS;
+}
+
+} // namespace $NAMESPACE

Powered by Google App Engine
This is Rietveld 408576698