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 // Multiply-included message file, hence no include guard. |
| 6 |
| 7 #include <vector> |
| 8 |
| 9 #include "ipc/ipc_message_macros.h" |
| 10 #include "ipc/ipc_param_traits.h" |
| 11 |
| 12 class GURL; |
| 13 |
| 14 #define IPC_MESSAGE_START SocketStreamMsgStart |
| 15 |
| 16 // Web Sockets messages sent from the renderer to the browser. |
| 17 |
| 18 // Open new Socket Stream for the |socket_url| identified by |socket_id| |
| 19 // in the renderer process. |
| 20 // The browser starts connecting asynchronously. |
| 21 // Once Socket Stream connection is established, the browser will send |
| 22 // SocketStreamMsg_Connected back. |
| 23 IPC_MESSAGE_CONTROL2(SocketStreamHostMsg_Connect, |
| 24 GURL /* socket_url */, |
| 25 int /* socket_id */) |
| 26 |
| 27 // Request to send data on the Socket Stream. |
| 28 // SocketStreamHandle can send data at most |max_pending_send_allowed| bytes, |
| 29 // which is given by ViewMsg_SocketStream_Connected at any time. |
| 30 // The number of pending bytes can be tracked by size of |data| sent |
| 31 // and |amount_sent| parameter of ViewMsg_SocketStream_DataSent. |
| 32 // That is, the following constraints is applied: |
| 33 // (accumulated total of |data|) - (accumulated total of |amount_sent|) |
| 34 // <= |max_pending_send_allowed| |
| 35 // If the SocketStreamHandle ever tries to exceed the |
| 36 // |max_pending_send_allowed|, the connection will be closed. |
| 37 IPC_MESSAGE_CONTROL2(SocketStreamHostMsg_SendData, |
| 38 int /* socket_id */, |
| 39 std::vector<char> /* data */) |
| 40 |
| 41 // Request to close the Socket Stream. |
| 42 // The browser will send ViewMsg_SocketStream_Closed back when the Socket |
| 43 // Stream is completely closed. |
| 44 IPC_MESSAGE_CONTROL1(SocketStreamHostMsg_Close, |
| 45 int /* socket_id */) |
| 46 |
| 47 |
| 48 // Speech input messages sent from the browser to the renderer. |
| 49 |
| 50 // A |socket_id| is assigned by SocketStreamHostMsg_Connect. |
| 51 // The Socket Stream is connected. The SocketStreamHandle should keep track |
| 52 // of how much it has pending (how much it has requested to be sent) and |
| 53 // shouldn't go over |max_pending_send_allowed| bytes. |
| 54 IPC_MESSAGE_CONTROL2(SocketStreamMsg_Connected, |
| 55 int /* socket_id */, |
| 56 int /* max_pending_send_allowed */) |
| 57 |
| 58 // |data| is received on the Socket Stream. |
| 59 IPC_MESSAGE_CONTROL2(SocketStreamMsg_ReceivedData, |
| 60 int /* socket_id */, |
| 61 std::vector<char> /* data */) |
| 62 |
| 63 // |amount_sent| bytes of data requested by |
| 64 // SocketStreamHostMsg_SendData has been sent on the Socket Stream. |
| 65 IPC_MESSAGE_CONTROL2(SocketStreamMsg_SentData, |
| 66 int /* socket_id */, |
| 67 int /* amount_sent */) |
| 68 |
| 69 // The Socket Stream is closed. |
| 70 IPC_MESSAGE_CONTROL1(SocketStreamMsg_Closed, |
| 71 int /* socket_id */) |
OLD | NEW |