OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "mojo/public/cpp/bindings/lib/message_builder.h" | 5 #include "mojo/public/cpp/bindings/lib/message_builder.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 #include <stdint.h> |
| 9 |
7 #include "mojo/public/cpp/bindings/lib/bindings_serialization.h" | 10 #include "mojo/public/cpp/bindings/lib/bindings_serialization.h" |
8 #include "mojo/public/cpp/bindings/message.h" | 11 #include "mojo/public/cpp/bindings/message.h" |
9 | 12 |
10 namespace mojo { | 13 namespace mojo { |
11 namespace internal { | 14 namespace internal { |
12 | 15 |
13 template <typename Header> | 16 template <typename Header> |
14 void Allocate(Buffer* buf, Header** header) { | 17 void Allocate(Buffer* buf, Header** header) { |
15 *header = static_cast<Header*>(buf->Allocate(sizeof(Header))); | 18 *header = static_cast<Header*>(buf->Allocate(sizeof(Header))); |
16 (*header)->num_bytes = sizeof(Header); | 19 (*header)->num_bytes = sizeof(Header); |
(...skipping 27 matching lines...) Expand all Loading... |
44 MessageHeaderWithRequestID* header; | 47 MessageHeaderWithRequestID* header; |
45 Allocate(message_.buffer(), &header); | 48 Allocate(message_.buffer(), &header); |
46 header->version = 1; | 49 header->version = 1; |
47 header->name = name; | 50 header->name = name; |
48 header->flags = flags; | 51 header->flags = flags; |
49 header->request_id = request_id; | 52 header->request_id = request_id; |
50 } | 53 } |
51 | 54 |
52 } // namespace internal | 55 } // namespace internal |
53 } // namespace mojo | 56 } // namespace mojo |
OLD | NEW |