| OLD | NEW |
| 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 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 | 5 |
| 6 /** | 6 /** |
| 7 * This file defines the <code>PPB_WebSocket</code> interface providing | 7 * This file defines the <code>PPB_WebSocket</code> interface providing |
| 8 * bi-directional, full-duplex, communications over a single TCP socket. | 8 * bi-directional, full-duplex, communications over a single TCP socket. |
| 9 */ | 9 */ |
| 10 label Chrome { | 10 label Chrome { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 * information. | 51 * information. |
| 52 * <code>PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE</code> and codes in the range | 52 * <code>PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE</code> and codes in the range |
| 53 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN</code> to | 53 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN</code> to |
| 54 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX</code>, and | 54 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX</code>, and |
| 55 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN</code> to | 55 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN</code> to |
| 56 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX</code> are valid for Close(). | 56 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX</code> are valid for Close(). |
| 57 */ | 57 */ |
| 58 [assert_size(4)] | 58 [assert_size(4)] |
| 59 enum PP_WebSocketCloseCode { | 59 enum PP_WebSocketCloseCode { |
| 60 /** | 60 /** |
| 61 * Indicates to request closing connection without status code and reason. |
| 62 * |
| 63 * (Note that the code 1005 is forbidden to send in actual close frames by |
| 64 * the RFC. PP_WebSocket reuses this code internally and the code will never |
| 65 * appear in the actual close frames.) |
| 66 */ |
| 67 PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED = 1005, |
| 68 |
| 69 /** |
| 61 * Status codes in the range 0-999 are not used. | 70 * Status codes in the range 0-999 are not used. |
| 62 */ | 71 */ |
| 63 | 72 |
| 64 /** | 73 /** |
| 65 * Indicates a normal closure. | 74 * Indicates a normal closure. |
| 66 */ | 75 */ |
| 67 PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE = 1000, | 76 PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE = 1000, |
| 68 | 77 |
| 69 /** | 78 /** |
| 70 * Indicates that an endpoint is "going away", such as a server going down. | 79 * Indicates that an endpoint is "going away", such as a server going down. |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 [in] uint32_t protocol_count, | 246 [in] uint32_t protocol_count, |
| 238 [in] PP_CompletionCallback callback); | 247 [in] PP_CompletionCallback callback); |
| 239 | 248 |
| 240 /** | 249 /** |
| 241 * Close() closes the specified WebSocket connection by specifying | 250 * Close() closes the specified WebSocket connection by specifying |
| 242 * <code>code</code> and <code>reason</code>. | 251 * <code>code</code> and <code>reason</code>. |
| 243 * | 252 * |
| 244 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a | 253 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a |
| 245 * WebSocket. | 254 * WebSocket. |
| 246 * | 255 * |
| 247 * @param[in] code The WebSocket close code. This is ignored if it is 0. | 256 * @param[in] code The WebSocket close code. This is ignored if it is |
| 257 * <code>PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED</code>. |
| 248 * <code>PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE</code> must be used for the | 258 * <code>PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE</code> must be used for the |
| 249 * usual case. To indicate some specific error cases, codes in the range | 259 * usual case. To indicate some specific error cases, codes in the range |
| 250 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN</code> to | 260 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN</code> to |
| 251 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX</code>, and in the range | 261 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX</code>, and in the range |
| 252 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN</code> to | 262 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN</code> to |
| 253 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX</code> are available. | 263 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX</code> are available. |
| 254 * | 264 * |
| 255 * @param[in] reason A <code>PP_Var</code> representing the WebSocket | 265 * @param[in] reason A <code>PP_Var</code> representing the WebSocket |
| 256 * close reason. This is ignored if it is <code>PP_VARTYPE_UNDEFINED</code>. | 266 * close reason. This is ignored if it is <code>PP_VARTYPE_UNDEFINED</code>. |
| 257 * Otherwise, its <code>PP_VarType</code> must be | 267 * Otherwise, its <code>PP_VarType</code> must be |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a | 436 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a |
| 427 * WebSocket. | 437 * WebSocket. |
| 428 * | 438 * |
| 429 * @return Returns a <code>PP_VARTYPE_STRING</code> var. If called before the | 439 * @return Returns a <code>PP_VARTYPE_STRING</code> var. If called before the |
| 430 * connection is established, the var contains the empty string. Returns a | 440 * connection is established, the var contains the empty string. Returns a |
| 431 * <code>PP_VARTYPE_UNDEFINED</code> if this function is called on an | 441 * <code>PP_VARTYPE_UNDEFINED</code> if this function is called on an |
| 432 * invalid resource. | 442 * invalid resource. |
| 433 */ | 443 */ |
| 434 PP_Var GetURL([in] PP_Resource web_socket); | 444 PP_Var GetURL([in] PP_Resource web_socket); |
| 435 }; | 445 }; |
| OLD | NEW |