OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 // IPC messages for the P2P Transport API. | 5 // IPC messages for the P2P Transport API. |
6 // Multiply-included message file, hence no include guard. | 6 // Multiply-included message file, hence no include guard. |
7 | 7 |
8 #include "content/common/p2p_sockets.h" | 8 #include "content/common/p2p_sockets.h" |
9 #include "ipc/ipc_message_macros.h" | 9 #include "ipc/ipc_message_macros.h" |
| 10 #include "net/base/ip_endpoint.h" |
10 | 11 |
11 #define IPC_MESSAGE_START P2PMsgStart | 12 #define IPC_MESSAGE_START P2PMsgStart |
12 | 13 |
13 IPC_STRUCT_TRAITS_BEGIN(P2PSocketAddress) | |
14 IPC_STRUCT_TRAITS_MEMBER(address) | |
15 IPC_STRUCT_TRAITS_MEMBER(port) | |
16 IPC_STRUCT_TRAITS_END() | |
17 | |
18 IPC_ENUM_TRAITS(P2PSocketType) | 14 IPC_ENUM_TRAITS(P2PSocketType) |
19 | 15 |
20 // P2P Socket messages sent from the browser to the renderer. | 16 // P2P Socket messages sent from the browser to the renderer. |
21 | 17 |
22 IPC_MESSAGE_ROUTED2(P2PMsg_OnSocketCreated, | 18 IPC_MESSAGE_ROUTED2(P2PMsg_OnSocketCreated, |
23 int /* socket_id */, | 19 int /* socket_id */, |
24 P2PSocketAddress /* socket_address */) | 20 net::IPEndPoint /* socket_address */) |
25 | 21 |
26 IPC_MESSAGE_ROUTED1(P2PMsg_OnError, | 22 IPC_MESSAGE_ROUTED1(P2PMsg_OnError, |
27 int /* socket_id */) | 23 int /* socket_id */) |
28 | 24 |
29 IPC_MESSAGE_ROUTED3(P2PMsg_OnDataReceived, | 25 IPC_MESSAGE_ROUTED3(P2PMsg_OnDataReceived, |
30 int /* socket_id */, | 26 int /* socket_id */, |
31 P2PSocketAddress /* socket_address */, | 27 net::IPEndPoint /* socket_address */, |
32 std::vector<char> /* data */) | 28 std::vector<char> /* data */) |
33 | 29 |
34 // P2P Socket messages sent from the renderer to the browser. | 30 // P2P Socket messages sent from the renderer to the browser. |
35 | 31 |
36 IPC_MESSAGE_ROUTED3(P2PHostMsg_CreateSocket, | 32 IPC_MESSAGE_ROUTED3(P2PHostMsg_CreateSocket, |
37 P2PSocketType /* type */, | 33 P2PSocketType /* type */, |
38 int /* socket_id */, | 34 int /* socket_id */, |
39 P2PSocketAddress /* remote_address */) | 35 net::IPEndPoint /* remote_address */) |
40 | 36 |
41 // TODO(sergeyu): Use shared memory to pass the data. | 37 // TODO(sergeyu): Use shared memory to pass the data. |
42 IPC_MESSAGE_ROUTED3(P2PHostMsg_Send, | 38 IPC_MESSAGE_ROUTED3(P2PHostMsg_Send, |
43 int /* socket_id */, | 39 int /* socket_id */, |
44 P2PSocketAddress /* socket_address */, | 40 net::IPEndPoint /* socket_address */, |
45 std::vector<char> /* data */) | 41 std::vector<char> /* data */) |
46 | 42 |
47 IPC_MESSAGE_ROUTED1(P2PHostMsg_DestroySocket, | 43 IPC_MESSAGE_ROUTED1(P2PHostMsg_DestroySocket, |
48 int /* socket_id */) | 44 int /* socket_id */) |
OLD | NEW |