OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 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 // IPC messages for the P2P Transport API. | |
6 | |
7 #ifndef CONTENT_COMMON_P2P_MESSAGES_H_ | |
8 #define CONTENT_COMMON_P2P_MESSAGES_H_ | |
9 | |
10 #include "content/common/p2p_sockets.h" | |
11 #include "ipc/ipc_message_macros.h" | |
12 | |
13 #define IPC_MESSAGE_START P2PMsgStart | |
14 | |
15 IPC_MESSAGE_ROUTED2(P2PMsg_OnSocketCreated, | |
jam
2011/03/02 00:39:24
nit: please add comments like the other ipc messag
Sergey Ulanov
2011/03/02 11:00:47
Done.
| |
16 int /* socket_id */, | |
17 P2PSocketAddress /* socket_address */) | |
18 | |
19 IPC_MESSAGE_ROUTED1(P2PMsg_OnError, | |
20 int /* socket_id */) | |
21 | |
22 IPC_MESSAGE_ROUTED3(P2PMsg_OnDataReceived, | |
23 int /* socket_id */, | |
24 P2PSocketAddress /* socket_address */, | |
25 std::vector<char> /* data */) | |
26 | |
27 IPC_MESSAGE_ROUTED3(P2PHostMsg_CreateSocket, | |
28 P2PSocketType /* type */, | |
29 int /* socket_id */, | |
30 P2PSocketAddress /* remote_address */) | |
31 | |
32 // TODO(sergeyu): Use shared memory to pass the data. | |
33 IPC_MESSAGE_ROUTED3(P2PHostMsg_Send, | |
34 int /* socket_id */, | |
35 P2PSocketAddress /* socket_address */, | |
36 std::vector<char> /* data */) | |
37 | |
38 IPC_MESSAGE_ROUTED1(P2PHostMsg_DestroySocket, | |
39 int /* socket_id */) | |
40 | |
41 namespace IPC { | |
42 | |
43 template <> | |
44 struct ParamTraits<P2PSocketAddress> { | |
45 typedef P2PSocketAddress param_type; | |
46 static void Write(Message* m, const param_type& p); | |
47 static bool Read(const Message* m, void** iter, param_type* p); | |
48 static void Log(const param_type& p, std::string* l); | |
49 }; | |
50 | |
51 template <> | |
52 struct SimilarTypeTraits<P2PSocketType> { | |
53 typedef int Type; | |
54 }; | |
55 | |
56 } // namespace IPC | |
57 | |
58 #endif // CONTENT_COMMON_P2P_MESSAGES_H_ | |
OLD | NEW |