| 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. | 8 // WebSockets. |
| 9 // | 9 // |
| 10 // This IPC interface was originally desined based on the WebSocket | 10 // This IPC interface was originally desined based on the WebSocket |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "url/gurl.h" | 39 #include "url/gurl.h" |
| 40 #include "url/origin.h" | 40 #include "url/origin.h" |
| 41 | 41 |
| 42 #undef IPC_MESSAGE_EXPORT | 42 #undef IPC_MESSAGE_EXPORT |
| 43 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 43 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| 44 #define IPC_MESSAGE_START WebSocketMsgStart | 44 #define IPC_MESSAGE_START WebSocketMsgStart |
| 45 | 45 |
| 46 IPC_ENUM_TRAITS_MAX_VALUE(content::WebSocketMessageType, | 46 IPC_ENUM_TRAITS_MAX_VALUE(content::WebSocketMessageType, |
| 47 content::WEB_SOCKET_MESSAGE_TYPE_LAST) | 47 content::WEB_SOCKET_MESSAGE_TYPE_LAST) |
| 48 | 48 |
| 49 IPC_STRUCT_BEGIN(WebSocketHostMsg_AddChannelRequest_Params) |
| 50 IPC_STRUCT_MEMBER(GURL, socket_url) |
| 51 IPC_STRUCT_MEMBER(std::vector<std::string>, requested_protocols) |
| 52 IPC_STRUCT_MEMBER(url::Origin, origin) |
| 53 IPC_STRUCT_MEMBER(GURL, first_party_for_cookies) |
| 54 IPC_STRUCT_MEMBER(std::string, user_agent_override) |
| 55 IPC_STRUCT_MEMBER(int, render_frame_id) |
| 56 IPC_STRUCT_END() |
| 57 |
| 49 IPC_STRUCT_TRAITS_BEGIN(content::WebSocketHandshakeRequest) | 58 IPC_STRUCT_TRAITS_BEGIN(content::WebSocketHandshakeRequest) |
| 50 IPC_STRUCT_TRAITS_MEMBER(url) | 59 IPC_STRUCT_TRAITS_MEMBER(url) |
| 51 IPC_STRUCT_TRAITS_MEMBER(headers) | 60 IPC_STRUCT_TRAITS_MEMBER(headers) |
| 52 IPC_STRUCT_TRAITS_MEMBER(headers_text) | 61 IPC_STRUCT_TRAITS_MEMBER(headers_text) |
| 53 IPC_STRUCT_TRAITS_MEMBER(request_time) | 62 IPC_STRUCT_TRAITS_MEMBER(request_time) |
| 54 IPC_STRUCT_TRAITS_END() | 63 IPC_STRUCT_TRAITS_END() |
| 55 | 64 |
| 56 IPC_STRUCT_TRAITS_BEGIN(content::WebSocketHandshakeResponse) | 65 IPC_STRUCT_TRAITS_BEGIN(content::WebSocketHandshakeResponse) |
| 57 IPC_STRUCT_TRAITS_MEMBER(url) | 66 IPC_STRUCT_TRAITS_MEMBER(url) |
| 58 IPC_STRUCT_TRAITS_MEMBER(status_code) | 67 IPC_STRUCT_TRAITS_MEMBER(status_code) |
| 59 IPC_STRUCT_TRAITS_MEMBER(status_text) | 68 IPC_STRUCT_TRAITS_MEMBER(status_text) |
| 60 IPC_STRUCT_TRAITS_MEMBER(headers) | 69 IPC_STRUCT_TRAITS_MEMBER(headers) |
| 61 IPC_STRUCT_TRAITS_MEMBER(headers_text) | 70 IPC_STRUCT_TRAITS_MEMBER(headers_text) |
| 62 IPC_STRUCT_TRAITS_MEMBER(response_time) | 71 IPC_STRUCT_TRAITS_MEMBER(response_time) |
| 63 IPC_STRUCT_TRAITS_END() | 72 IPC_STRUCT_TRAITS_END() |
| 64 | 73 |
| 65 // WebSocket messages sent from the renderer to the browser. | 74 // WebSocket messages sent from the renderer to the browser. |
| 66 | 75 |
| 67 // Open new WebSocket connection to |socket_url|. |requested_protocols| is a | 76 // Open new WebSocket connection to |socket_url|. |requested_protocols| is a |
| 68 // list of tokens identifying sub-protocols the renderer would like to use, as | 77 // list of tokens identifying sub-protocols the renderer would like to use, as |
| 69 // described in RFC6455 "Subprotocols Using the WebSocket Protocol". | 78 // described in RFC6455 "Subprotocols Using the WebSocket Protocol". |
| 70 IPC_MESSAGE_ROUTED5(WebSocketHostMsg_AddChannelRequest, | 79 IPC_MESSAGE_ROUTED1(WebSocketHostMsg_AddChannelRequest, |
| 71 GURL /* socket_url */, | 80 WebSocketHostMsg_AddChannelRequest_Params) |
| 72 std::vector<std::string> /* requested_protocols */, | |
| 73 url::Origin /* origin */, | |
| 74 std::string /* user_agent_override */, | |
| 75 int /* render_frame_id */) | |
| 76 | 81 |
| 77 // Send a complete binary WebSocket message consisting of the Blob identified by | 82 // Send a complete binary WebSocket message consisting of the Blob identified by |
| 78 // |uuid|. The message will be split into frames as necessary. |expected_size| | 83 // |uuid|. The message will be split into frames as necessary. |expected_size| |
| 79 // must match the browser's idea of the size of the Blob to prevent flow control | 84 // must match the browser's idea of the size of the Blob to prevent flow control |
| 80 // from becoming desynchronised. If it does not match the connection will be | 85 // from becoming desynchronised. If it does not match the connection will be |
| 81 // terminated with a WebSocketMsg_NotifyFailure message. On success, the browser | 86 // terminated with a WebSocketMsg_NotifyFailure message. On success, the browser |
| 82 // will have consumed |expected_size| bytes of flow control send quota and the | 87 // will have consumed |expected_size| bytes of flow control send quota and the |
| 83 // renderer needs to subtract that from its running total of flow control send | 88 // renderer needs to subtract that from its running total of flow control send |
| 84 // quota. See the design doc at | 89 // quota. See the design doc at |
| 85 // https://docs.google.com/document/d/1CDiXB9pBumhFVVfmIn1CRI6v6byxyqWu2urEE9xp7
14/edit | 90 // https://docs.google.com/document/d/1CDiXB9pBumhFVVfmIn1CRI6v6byxyqWu2urEE9xp7
14/edit |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 // a closing handshake and the renderer cannot accept any new messages on this | 192 // a closing handshake and the renderer cannot accept any new messages on this |
| 188 // connection. | 193 // connection. |
| 189 IPC_MESSAGE_ROUTED3(WebSocketMsg_DropChannel, | 194 IPC_MESSAGE_ROUTED3(WebSocketMsg_DropChannel, |
| 190 bool /* was_clean */, | 195 bool /* was_clean */, |
| 191 unsigned short /* code */, | 196 unsigned short /* code */, |
| 192 std::string /* reason */) | 197 std::string /* reason */) |
| 193 | 198 |
| 194 // Notify the renderer that a closing handshake has been initiated by the | 199 // Notify the renderer that a closing handshake has been initiated by the |
| 195 // server, so that it can set the Javascript readyState to CLOSING. | 200 // server, so that it can set the Javascript readyState to CLOSING. |
| 196 IPC_MESSAGE_ROUTED0(WebSocketMsg_NotifyClosing) | 201 IPC_MESSAGE_ROUTED0(WebSocketMsg_NotifyClosing) |
| OLD | NEW |