OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 #ifndef MOJO_PUBLIC_BINDINGS_LIB_MESSAGE_H_ | |
6 #define MOJO_PUBLIC_BINDINGS_LIB_MESSAGE_H_ | |
7 | |
8 #include <vector> | |
9 | |
10 #include "mojo/public/system/core.h" | |
11 | |
12 namespace mojo { | |
13 | |
14 struct MessageHeader { | |
15 uint32_t num_bytes; | |
16 uint32_t name; | |
17 }; | |
18 | |
19 struct MessageData { | |
20 MessageHeader header; | |
21 uint8_t payload[1]; | |
22 }; | |
23 | |
24 struct Message { | |
25 Message(); | |
26 ~Message(); | |
27 | |
28 MessageData* data; // Heap-allocated. | |
29 std::vector<Handle> handles; | |
30 }; | |
31 | |
32 class MessageReceiver { | |
33 public: | |
34 // The receiver may mutate the given message or take ownership of the its | |
dmichael (off chromium)
2013/10/14 22:41:19
"the its"->"its"
| |
35 // contents. Upon return, if message->data is non-null, then the caller | |
36 // regains ownership of the Message and should be responsible for freeing its | |
dmichael (off chromium)
2013/10/14 22:41:19
s/regains/retains?
s/should be/is?
| |
37 // data member. | |
38 virtual bool Accept(Message* message) = 0; | |
39 }; | |
40 | |
41 } // namespace mojo | |
42 | |
43 #endif // MOJO_PUBLIC_BINDINGS_LIB_MESSAGE_H_ | |
OLD | NEW |