| 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 "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "content/public/common/p2p_socket_type.h" | 10 #include "content/public/common/p2p_socket_type.h" |
| 11 #include "ipc/ipc_message_macros.h" | 11 #include "ipc/ipc_message_macros.h" |
| 12 #include "net/base/ip_endpoint.h" | 12 #include "net/base/ip_endpoint.h" |
| 13 #include "net/base/net_util.h" | 13 #include "net/base/net_util.h" |
| 14 #include "third_party/libjingle/source/talk/base/asyncpacketsocket.h" | |
| 15 | 14 |
| 16 #undef IPC_MESSAGE_EXPORT | 15 #undef IPC_MESSAGE_EXPORT |
| 17 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 16 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| 18 #define IPC_MESSAGE_START P2PMsgStart | 17 #define IPC_MESSAGE_START P2PMsgStart |
| 19 | 18 |
| 20 IPC_ENUM_TRAITS_MAX_VALUE(content::P2PSocketType, | 19 IPC_ENUM_TRAITS_MAX_VALUE(content::P2PSocketType, |
| 21 content::P2P_SOCKET_TYPE_LAST) | 20 content::P2P_SOCKET_TYPE_LAST) |
| 22 IPC_ENUM_TRAITS_MAX_VALUE(content::P2PSocketOption, | 21 IPC_ENUM_TRAITS_MAX_VALUE(content::P2PSocketOption, |
| 23 content::P2P_SOCKET_OPT_MAX - 1) | 22 content::P2P_SOCKET_OPT_MAX - 1) |
| 24 IPC_ENUM_TRAITS_MIN_MAX_VALUE(talk_base::DiffServCodePoint, | 23 IPC_ENUM_TRAITS_MIN_MAX_VALUE(net::DiffServCodePoint, |
| 25 talk_base::DSCP_NO_CHANGE, | 24 net::DSCP_FIRST, |
| 26 talk_base::DSCP_CS7) | 25 net::DSCP_LAST) |
| 27 | 26 |
| 28 IPC_STRUCT_TRAITS_BEGIN(net::NetworkInterface) | 27 IPC_STRUCT_TRAITS_BEGIN(net::NetworkInterface) |
| 29 IPC_STRUCT_TRAITS_MEMBER(name) | 28 IPC_STRUCT_TRAITS_MEMBER(name) |
| 30 IPC_STRUCT_TRAITS_MEMBER(address) | 29 IPC_STRUCT_TRAITS_MEMBER(address) |
| 31 IPC_STRUCT_TRAITS_END() | 30 IPC_STRUCT_TRAITS_END() |
| 32 | 31 |
| 33 IPC_STRUCT_TRAITS_BEGIN(talk_base::PacketTimeUpdateParams) | |
| 34 IPC_STRUCT_TRAITS_MEMBER(rtp_sendtime_extension_id) | |
| 35 IPC_STRUCT_TRAITS_MEMBER(srtp_auth_key) | |
| 36 IPC_STRUCT_TRAITS_MEMBER(srtp_auth_tag_len) | |
| 37 IPC_STRUCT_TRAITS_MEMBER(srtp_packet_index) | |
| 38 IPC_STRUCT_TRAITS_MEMBER(payload_len) | |
| 39 IPC_STRUCT_TRAITS_END() | |
| 40 | |
| 41 IPC_STRUCT_TRAITS_BEGIN(talk_base::PacketOptions) | |
| 42 IPC_STRUCT_TRAITS_MEMBER(dscp) | |
| 43 IPC_STRUCT_TRAITS_MEMBER(packet_time_params) | |
| 44 IPC_STRUCT_TRAITS_END() | |
| 45 | |
| 46 // P2P Socket messages sent from the browser to the renderer. | 32 // P2P Socket messages sent from the browser to the renderer. |
| 47 | 33 |
| 48 IPC_MESSAGE_CONTROL1(P2PMsg_NetworkListChanged, | 34 IPC_MESSAGE_CONTROL1(P2PMsg_NetworkListChanged, |
| 49 net::NetworkInterfaceList /* networks */) | 35 net::NetworkInterfaceList /* networks */) |
| 50 | 36 |
| 51 IPC_MESSAGE_CONTROL2(P2PMsg_GetHostAddressResult, | 37 IPC_MESSAGE_CONTROL2(P2PMsg_GetHostAddressResult, |
| 52 int32 /* request_id */, | 38 int32 /* request_id */, |
| 53 net::IPAddressList /* address list*/) | 39 net::IPAddressList /* address list*/) |
| 54 | 40 |
| 55 IPC_MESSAGE_CONTROL2(P2PMsg_OnSocketCreated, | 41 IPC_MESSAGE_CONTROL2(P2PMsg_OnSocketCreated, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 IPC_MESSAGE_CONTROL3(P2PHostMsg_AcceptIncomingTcpConnection, | 78 IPC_MESSAGE_CONTROL3(P2PHostMsg_AcceptIncomingTcpConnection, |
| 93 int /* listen_socket_id */, | 79 int /* listen_socket_id */, |
| 94 net::IPEndPoint /* remote_address */, | 80 net::IPEndPoint /* remote_address */, |
| 95 int /* connected_socket_id */) | 81 int /* connected_socket_id */) |
| 96 | 82 |
| 97 // TODO(sergeyu): Use shared memory to pass the data. | 83 // TODO(sergeyu): Use shared memory to pass the data. |
| 98 IPC_MESSAGE_CONTROL5(P2PHostMsg_Send, | 84 IPC_MESSAGE_CONTROL5(P2PHostMsg_Send, |
| 99 int /* socket_id */, | 85 int /* socket_id */, |
| 100 net::IPEndPoint /* socket_address */, | 86 net::IPEndPoint /* socket_address */, |
| 101 std::vector<char> /* data */, | 87 std::vector<char> /* data */, |
| 102 talk_base::PacketOptions /* dscp */, | 88 net::DiffServCodePoint /* dscp */, |
| 103 uint64 /* packet_id */) | 89 uint64 /* packet_id */) |
| 104 | 90 |
| 105 IPC_MESSAGE_CONTROL1(P2PHostMsg_DestroySocket, | 91 IPC_MESSAGE_CONTROL1(P2PHostMsg_DestroySocket, |
| 106 int /* socket_id */) | 92 int /* socket_id */) |
| 107 | 93 |
| 108 IPC_MESSAGE_CONTROL3(P2PHostMsg_SetOption, | 94 IPC_MESSAGE_CONTROL3(P2PHostMsg_SetOption, |
| 109 int /* socket_id */, | 95 int /* socket_id */, |
| 110 content::P2PSocketOption /* socket option type */, | 96 content::P2PSocketOption /* socket option type */, |
| 111 int /* value */) | 97 int /* value */) |
| OLD | NEW |