| 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
|
|
|