| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 module blink.mojom; | 5 module blink.mojom; |
| 6 | 6 |
| 7 import "url/mojo/origin.mojom"; | 7 import "url/mojo/origin.mojom"; |
| 8 import "url/mojo/url.mojom"; | 8 import "url/mojo/url.mojom"; |
| 9 | 9 |
| 10 enum WebSocketMessageType { | 10 enum WebSocketMessageType { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // - If |was_clean| is false, then the WebSocket connection was not closed | 89 // - If |was_clean| is false, then the WebSocket connection was not closed |
| 90 // cleanly. | 90 // cleanly. |
| 91 OnDropChannel(bool was_clean, uint16 code, string reason); | 91 OnDropChannel(bool was_clean, uint16 code, string reason); |
| 92 | 92 |
| 93 // Notify the renderer that a closing handshake has been initiated by the | 93 // Notify the renderer that a closing handshake has been initiated by the |
| 94 // server, so that it can set the Javascript readyState to CLOSING. | 94 // server, so that it can set the Javascript readyState to CLOSING. |
| 95 OnClosingHandshake(); | 95 OnClosingHandshake(); |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 interface WebSocket { | 98 interface WebSocket { |
| 99 // The client side may observe the following disconnection reason from the |
| 100 // service side: |
| 101 const uint32 kInsufficientResources = 1; |
| 102 |
| 99 // Open new WebSocket connection to |socket_url|. |requested_protocols| is a | 103 // Open new WebSocket connection to |socket_url|. |requested_protocols| is a |
| 100 // list of tokens identifying sub-protocols the renderer would like to use, | 104 // list of tokens identifying sub-protocols the renderer would like to use, |
| 101 // as described in RFC6455 "Subprotocols Using the WebSocket Protocol". | 105 // as described in RFC6455 "Subprotocols Using the WebSocket Protocol". |
| 102 AddChannelRequest(url.mojom.Url url, | 106 AddChannelRequest(url.mojom.Url url, |
| 103 array<string> requested_protocols, | 107 array<string> requested_protocols, |
| 104 url.mojom.Origin origin, | 108 url.mojom.Origin origin, |
| 105 url.mojom.Url first_party_for_cookies, | 109 url.mojom.Url first_party_for_cookies, |
| 106 string user_agent_override, | 110 string user_agent_override, |
| 107 WebSocketClient client); | 111 WebSocketClient client); |
| 108 | 112 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 129 // | 133 // |
| 130 // When sent by the renderer, this will cause a Close message will be sent and | 134 // When sent by the renderer, this will cause a Close message will be sent and |
| 131 // the TCP/IP connection will be closed. | 135 // the TCP/IP connection will be closed. |
| 132 // | 136 // |
| 133 // - |code| is one of the reason codes specified in RFC6455. | 137 // - |code| is one of the reason codes specified in RFC6455. |
| 134 // - |reason|, if non-empty, is a UTF-8 encoded string which may be useful for | 138 // - |reason|, if non-empty, is a UTF-8 encoded string which may be useful for |
| 135 // debugging but is not necessarily human-readable, as supplied by the | 139 // debugging but is not necessarily human-readable, as supplied by the |
| 136 // server in the Close message. | 140 // server in the Close message. |
| 137 StartClosingHandshake(uint16 code, string reason); | 141 StartClosingHandshake(uint16 code, string reason); |
| 138 }; | 142 }; |
| OLD | NEW |