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