| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/content_export.h" | 8 #include "content/common/content_export.h" |
| 9 #include "content/common/p2p_sockets.h" | 9 #include "content/common/p2p_sockets.h" |
| 10 #include "ipc/ipc_message_macros.h" | 10 #include "ipc/ipc_message_macros.h" |
| 11 #include "net/base/ip_endpoint.h" | 11 #include "net/base/ip_endpoint.h" |
| 12 #include "net/base/net_util.h" | 12 #include "net/base/net_util.h" |
| 13 | 13 |
| 14 #undef IPC_MESSAGE_EXPORT | 14 #undef IPC_MESSAGE_EXPORT |
| 15 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 15 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| 16 #define IPC_MESSAGE_START P2PMsgStart | 16 #define IPC_MESSAGE_START P2PMsgStart |
| 17 | 17 |
| 18 IPC_ENUM_TRAITS(content::P2PSocketType) | 18 IPC_ENUM_TRAITS(content::P2PSocketType) |
| 19 | 19 |
| 20 IPC_STRUCT_TRAITS_BEGIN(net::NetworkInterface) | 20 IPC_STRUCT_TRAITS_BEGIN(net::NetworkInterface) |
| 21 IPC_STRUCT_TRAITS_MEMBER(name) | 21 IPC_STRUCT_TRAITS_MEMBER(name) |
| 22 IPC_STRUCT_TRAITS_MEMBER(address) | 22 IPC_STRUCT_TRAITS_MEMBER(address) |
| 23 IPC_STRUCT_TRAITS_END() | 23 IPC_STRUCT_TRAITS_END() |
| 24 | 24 |
| 25 // P2P Socket messages sent from the browser to the renderer. | 25 // P2P Socket messages sent from the browser to the renderer. |
| 26 | 26 |
| 27 IPC_MESSAGE_ROUTED1(P2PMsg_NetworkListChanged, | 27 IPC_MESSAGE_CONTROL1(P2PMsg_NetworkListChanged, |
| 28 net::NetworkInterfaceList /* networks */) | 28 net::NetworkInterfaceList /* networks */) |
| 29 | 29 |
| 30 IPC_MESSAGE_ROUTED2(P2PMsg_GetHostAddressResult, | 30 IPC_MESSAGE_CONTROL2(P2PMsg_GetHostAddressResult, |
| 31 int32 /* request_id */, | 31 int32 /* request_id */, |
| 32 net::IPAddressNumber /* address */) | 32 net::IPAddressNumber /* address */) |
| 33 | 33 |
| 34 IPC_MESSAGE_ROUTED2(P2PMsg_OnSocketCreated, | 34 IPC_MESSAGE_CONTROL2(P2PMsg_OnSocketCreated, |
| 35 int /* socket_id */, | 35 int /* socket_id */, |
| 36 net::IPEndPoint /* socket_address */) | 36 net::IPEndPoint /* socket_address */) |
| 37 | 37 |
| 38 IPC_MESSAGE_ROUTED1(P2PMsg_OnError, | 38 IPC_MESSAGE_CONTROL1(P2PMsg_OnError, |
| 39 int /* socket_id */) | 39 int /* socket_id */) |
| 40 | 40 |
| 41 IPC_MESSAGE_ROUTED2(P2PMsg_OnIncomingTcpConnection, | 41 IPC_MESSAGE_CONTROL2(P2PMsg_OnIncomingTcpConnection, |
| 42 int /* socket_id */, | 42 int /* socket_id */, |
| 43 net::IPEndPoint /* socket_address */) | 43 net::IPEndPoint /* socket_address */) |
| 44 | 44 |
| 45 IPC_MESSAGE_ROUTED3(P2PMsg_OnDataReceived, | 45 IPC_MESSAGE_CONTROL3(P2PMsg_OnDataReceived, |
| 46 int /* socket_id */, | 46 int /* socket_id */, |
| 47 net::IPEndPoint /* socket_address */, | 47 net::IPEndPoint /* socket_address */, |
| 48 std::vector<char> /* data */) | 48 std::vector<char> /* data */) |
| 49 | 49 |
| 50 // P2P Socket messages sent from the renderer to the browser. | 50 // P2P Socket messages sent from the renderer to the browser. |
| 51 | 51 |
| 52 // Start/stop sending P2PMsg_NetworkListChanged messages when network | 52 // Start/stop sending P2PMsg_NetworkListChanged messages when network |
| 53 // configuration changes. | 53 // configuration changes. |
| 54 IPC_MESSAGE_ROUTED0(P2PHostMsg_StartNetworkNotifications) | 54 IPC_MESSAGE_CONTROL0(P2PHostMsg_StartNetworkNotifications) |
| 55 IPC_MESSAGE_ROUTED0(P2PHostMsg_StopNetworkNotifications) | 55 IPC_MESSAGE_CONTROL0(P2PHostMsg_StopNetworkNotifications) |
| 56 | 56 |
| 57 IPC_MESSAGE_ROUTED2(P2PHostMsg_GetHostAddress, | 57 IPC_MESSAGE_CONTROL2(P2PHostMsg_GetHostAddress, |
| 58 std::string /* host_name */, | 58 std::string /* host_name */, |
| 59 int32 /* request_id */) | 59 int32 /* request_id */) |
| 60 | 60 |
| 61 IPC_MESSAGE_ROUTED4(P2PHostMsg_CreateSocket, | 61 IPC_MESSAGE_CONTROL4(P2PHostMsg_CreateSocket, |
| 62 content::P2PSocketType /* type */, | 62 content::P2PSocketType /* type */, |
| 63 int /* socket_id */, | 63 int /* socket_id */, |
| 64 net::IPEndPoint /* local_address */, | 64 net::IPEndPoint /* local_address */, |
| 65 net::IPEndPoint /* remote_address */) | 65 net::IPEndPoint /* remote_address */) |
| 66 | 66 |
| 67 IPC_MESSAGE_ROUTED3(P2PHostMsg_AcceptIncomingTcpConnection, | 67 IPC_MESSAGE_CONTROL3(P2PHostMsg_AcceptIncomingTcpConnection, |
| 68 int /* listen_socket_id */, | 68 int /* listen_socket_id */, |
| 69 net::IPEndPoint /* remote_address */, | 69 net::IPEndPoint /* remote_address */, |
| 70 int /* connected_socket_id */) | 70 int /* connected_socket_id */) |
| 71 | 71 |
| 72 // TODO(sergeyu): Use shared memory to pass the data. | 72 // TODO(sergeyu): Use shared memory to pass the data. |
| 73 IPC_MESSAGE_ROUTED3(P2PHostMsg_Send, | 73 IPC_MESSAGE_CONTROL3(P2PHostMsg_Send, |
| 74 int /* socket_id */, | 74 int /* socket_id */, |
| 75 net::IPEndPoint /* socket_address */, | 75 net::IPEndPoint /* socket_address */, |
| 76 std::vector<char> /* data */) | 76 std::vector<char> /* data */) |
| 77 | 77 |
| 78 IPC_MESSAGE_ROUTED1(P2PHostMsg_DestroySocket, | 78 IPC_MESSAGE_CONTROL1(P2PHostMsg_DestroySocket, |
| 79 int /* socket_id */) | 79 int /* socket_id */) |
| OLD | NEW |