| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // Multiply-included message file, hence no include guard. | 5 // Multiply-included message file, hence no include guard. |
| 6 | 6 |
| 7 // This file defines the IPCs for the browser-side implementation of | 7 // This file defines the IPCs for the browser-side implementation of |
| 8 // WebSockets. For the legacy renderer-side implementation, see | 8 // WebSockets. For the legacy renderer-side implementation, see |
| 9 // socket_stream_messages.h. | 9 // socket_stream_messages.h. |
| 10 // TODO(ricea): Fix this comment when the legacy implementation has been | 10 // TODO(ricea): Fix this comment when the legacy implementation has been |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // Open new virtual WebSocket connection to |socket_url|. |channel_id| is an | 51 // Open new virtual WebSocket connection to |socket_url|. |channel_id| is an |
| 52 // identifier chosen by the renderer for the new channel. It cannot correspond | 52 // identifier chosen by the renderer for the new channel. It cannot correspond |
| 53 // to an existing open channel, and must be between 1 and | 53 // to an existing open channel, and must be between 1 and |
| 54 // 0x7FFFFFFF. |requested_protocols| is a list of tokens identifying | 54 // 0x7FFFFFFF. |requested_protocols| is a list of tokens identifying |
| 55 // sub-protocols the renderer would like to use, as described in RFC6455 | 55 // sub-protocols the renderer would like to use, as described in RFC6455 |
| 56 // "Subprotocols Using the WebSocket Protocol". | 56 // "Subprotocols Using the WebSocket Protocol". |
| 57 // | 57 // |
| 58 // The browser process will not send |channel_id| as-is to the remote server; it | 58 // The browser process will not send |channel_id| as-is to the remote server; it |
| 59 // will try to use a short id on the wire. This saves the renderer from | 59 // will try to use a short id on the wire. This saves the renderer from |
| 60 // having to try to choose the ids cleverly. | 60 // having to try to choose the ids cleverly. |
| 61 IPC_MESSAGE_ROUTED3(WebSocketHostMsg_AddChannelRequest, | 61 IPC_MESSAGE_ROUTED4(WebSocketHostMsg_AddChannelRequest, |
| 62 GURL /* socket_url */, | 62 GURL /* socket_url */, |
| 63 std::vector<std::string> /* requested_protocols */, | 63 std::vector<std::string> /* requested_protocols */, |
| 64 url::Origin /* origin */) | 64 url::Origin /* origin */, |
| 65 int /* render_frame_id */) |
| 65 | 66 |
| 66 // WebSocket messages sent from the browser to the renderer. | 67 // WebSocket messages sent from the browser to the renderer. |
| 67 | 68 |
| 68 // Respond to an AddChannelRequest for channel |channel_id|. |channel_id| is | 69 // Respond to an AddChannelRequest for channel |channel_id|. |channel_id| is |
| 69 // scoped to the renderer process; while it is unique per-renderer, the browser | 70 // scoped to the renderer process; while it is unique per-renderer, the browser |
| 70 // may have multiple renderers using the same id. If |fail| is true, the channel | 71 // may have multiple renderers using the same id. If |fail| is true, the channel |
| 71 // could not be established (the cause of the failure is not provided to the | 72 // could not be established (the cause of the failure is not provided to the |
| 72 // renderer in order to limit its ability to abuse WebSockets to perform network | 73 // renderer in order to limit its ability to abuse WebSockets to perform network |
| 73 // probing, etc.). If |fail| is set then the |channel_id| is available for | 74 // probing, etc.). If |fail| is set then the |channel_id| is available for |
| 74 // re-use. |selected_protocol| is the sub-protocol the server selected, | 75 // re-use. |selected_protocol| is the sub-protocol the server selected, |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 // closing handshake and the renderer cannot accept any new messages on this | 151 // closing handshake and the renderer cannot accept any new messages on this |
| 151 // connection. | 152 // connection. |
| 152 IPC_MESSAGE_ROUTED3(WebSocketMsg_DropChannel, | 153 IPC_MESSAGE_ROUTED3(WebSocketMsg_DropChannel, |
| 153 bool /* was_clean */, | 154 bool /* was_clean */, |
| 154 unsigned short /* code */, | 155 unsigned short /* code */, |
| 155 std::string /* reason */) | 156 std::string /* reason */) |
| 156 | 157 |
| 157 // Notify the renderer that a closing handshake has been initiated by the | 158 // Notify the renderer that a closing handshake has been initiated by the |
| 158 // server, so that it can set the Javascript readyState to CLOSING. | 159 // server, so that it can set the Javascript readyState to CLOSING. |
| 159 IPC_MESSAGE_ROUTED0(WebSocketMsg_NotifyClosing) | 160 IPC_MESSAGE_ROUTED0(WebSocketMsg_NotifyClosing) |
| OLD | NEW |