1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "mojo/public/bindings/sample/generated/sample_service_serialization.h"
11 Service_Frobinate_Params* Service_Frobinate_Params::New(mojo::Buffer* buf) {
12 return new (buf->Allocate(sizeof(Service_Frobinate_Params)))
13 Service_Frobinate_Params();
16 Service_Frobinate_Params::Service_Frobinate_Params() {
17 _header_.num_bytes = sizeof(*this);
18 _header_.num_fields = 3;
21 } // namespace internal
28 void ObjectTraits<sample::internal::Service_Frobinate_Params>::
29 EncodePointersAndHandles(
30 sample::internal::Service_Frobinate_Params* params,
31 std::vector<mojo::Handle>* handles) {
32 Encode(¶ms->foo_, handles);
33 EncodeHandle(¶ms->port_, handles);
37 bool ObjectTraits<sample::internal::Service_Frobinate_Params>::
38 DecodePointersAndHandles(
39 sample::internal::Service_Frobinate_Params* params,
40 const mojo::Message& message) {
41 if (!Decode(¶ms->foo_, message))
43 if (params->_header_.num_fields >= 3) {
44 if (!DecodeHandle(¶ms->port_, message.handles))
52 } // namespace internal