[email protected] | 6c54e7e4 | 2011-03-02 20:52:34 | [diff] [blame] | 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. |
[email protected] | db803aae | 2011-03-05 02:00:42 | [diff] [blame] | 6 | // Multiply-included message file, hence no include guard. |
[email protected] | 6c54e7e4 | 2011-03-02 20:52:34 | [diff] [blame] | 7 | |
| 8 | #include "content/common/p2p_sockets.h" |
| 9 | #include "ipc/ipc_message_macros.h" |
[email protected] | 1a2123c6 | 2011-03-12 04:42:39 | [diff] [blame] | 10 | #include "net/base/ip_endpoint.h" |
[email protected] | 6c54e7e4 | 2011-03-02 20:52:34 | [diff] [blame] | 11 | |
| 12 | #define IPC_MESSAGE_START P2PMsgStart |
| 13 | |
[email protected] | db803aae | 2011-03-05 02:00:42 | [diff] [blame] | 14 | IPC_ENUM_TRAITS(P2PSocketType) |
| 15 | |
[email protected] | 6c54e7e4 | 2011-03-02 20:52:34 | [diff] [blame] | 16 | // P2P Socket messages sent from the browser to the renderer. |
| 17 | |
| 18 | IPC_MESSAGE_ROUTED2(P2PMsg_OnSocketCreated, |
| 19 | int /* socket_id */, |
[email protected] | 1a2123c6 | 2011-03-12 04:42:39 | [diff] [blame] | 20 | net::IPEndPoint /* socket_address */) |
[email protected] | 6c54e7e4 | 2011-03-02 20:52:34 | [diff] [blame] | 21 | |
| 22 | IPC_MESSAGE_ROUTED1(P2PMsg_OnError, |
| 23 | int /* socket_id */) |
| 24 | |
[email protected] | 0f2b2e95 | 2011-04-19 04:40:56 | [diff] [blame^] | 25 | IPC_MESSAGE_ROUTED2(P2PMsg_OnIncomingTcpConnection, |
| 26 | int /* socket_id */, |
| 27 | net::IPEndPoint /* socket_address */) |
| 28 | |
[email protected] | 6c54e7e4 | 2011-03-02 20:52:34 | [diff] [blame] | 29 | IPC_MESSAGE_ROUTED3(P2PMsg_OnDataReceived, |
| 30 | int /* socket_id */, |
[email protected] | 1a2123c6 | 2011-03-12 04:42:39 | [diff] [blame] | 31 | net::IPEndPoint /* socket_address */, |
[email protected] | 6c54e7e4 | 2011-03-02 20:52:34 | [diff] [blame] | 32 | std::vector<char> /* data */) |
| 33 | |
| 34 | // P2P Socket messages sent from the renderer to the browser. |
| 35 | |
| 36 | IPC_MESSAGE_ROUTED3(P2PHostMsg_CreateSocket, |
| 37 | P2PSocketType /* type */, |
| 38 | int /* socket_id */, |
[email protected] | 1a2123c6 | 2011-03-12 04:42:39 | [diff] [blame] | 39 | net::IPEndPoint /* remote_address */) |
[email protected] | 6c54e7e4 | 2011-03-02 20:52:34 | [diff] [blame] | 40 | |
[email protected] | 0f2b2e95 | 2011-04-19 04:40:56 | [diff] [blame^] | 41 | IPC_MESSAGE_ROUTED3(P2PHostMsg_AcceptIncomingTcpConnection, |
| 42 | int /* listen_socket_id */, |
| 43 | net::IPEndPoint /* remote_address */, |
| 44 | int /* connected_socket_id */) |
| 45 | |
[email protected] | 6c54e7e4 | 2011-03-02 20:52:34 | [diff] [blame] | 46 | // TODO(sergeyu): Use shared memory to pass the data. |
| 47 | IPC_MESSAGE_ROUTED3(P2PHostMsg_Send, |
| 48 | int /* socket_id */, |
[email protected] | 1a2123c6 | 2011-03-12 04:42:39 | [diff] [blame] | 49 | net::IPEndPoint /* socket_address */, |
[email protected] | 6c54e7e4 | 2011-03-02 20:52:34 | [diff] [blame] | 50 | std::vector<char> /* data */) |
| 51 | |
| 52 | IPC_MESSAGE_ROUTED1(P2PHostMsg_DestroySocket, |
[email protected] | 1a2123c6 | 2011-03-12 04:42:39 | [diff] [blame] | 53 | int /* socket_id */) |