Chromium Code Reviews| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 * This enumeration contains status codes. These codes are used in Close() and | 49 * This enumeration contains status codes. These codes are used in Close() and |
| 50 * GetCloseCode(). Refer to RFC 6455, The WebSocket Protocol, for further | 50 * GetCloseCode(). Refer to RFC 6455, The WebSocket Protocol, for further |
| 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_WebSocketStatusCode { |
|
dmichael (off chromium)
2012/05/17 20:03:16
Sorry I didn't notice this before... you're break
Takashi Toyoshima
2012/05/30 10:15:46
The reason why I changed enum name here is that th
dmichael (off chromium)
2012/05/30 15:20:11
I see.
| |
| 60 /** | |
| 61 * Indicates to request closing connection without status code and reasom. | |
|
dmichael (off chromium)
2012/05/17 20:03:16
nit: reasom->reason
Takashi Toyoshima
2012/05/30 10:15:46
Done.
| |
| 62 * The code 1005 is forbidden to send in actual close frames by the RFC. | |
| 63 * PP_WebSocket reuses this code internally and the code will never appear in | |
| 64 * the actual close frames. | |
|
dmichael (off chromium)
2012/05/17 20:03:16
nit: I think this is information most developers w
Takashi Toyoshima
2012/05/30 10:15:46
Agreed.
Done.
| |
| 65 */ | |
| 66 PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED = 1005, | |
| 67 | |
| 60 /** | 68 /** |
| 61 * Status codes in the range 0-999 are not used. | 69 * Status codes in the range 0-999 are not used. |
| 62 */ | 70 */ |
| 63 | 71 |
| 64 /** | 72 /** |
| 65 * Indicates a normal closure. | 73 * Indicates a normal closure. |
| 66 */ | 74 */ |
| 67 PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE = 1000, | 75 PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE = 1000, |
| 68 | 76 |
| 69 /** | 77 /** |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 237 [in] uint32_t protocol_count, | 245 [in] uint32_t protocol_count, |
| 238 [in] PP_CompletionCallback callback); | 246 [in] PP_CompletionCallback callback); |
| 239 | 247 |
| 240 /** | 248 /** |
| 241 * Close() closes the specified WebSocket connection by specifying | 249 * Close() closes the specified WebSocket connection by specifying |
| 242 * <code>code</code> and <code>reason</code>. | 250 * <code>code</code> and <code>reason</code>. |
| 243 * | 251 * |
| 244 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a | 252 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a |
| 245 * WebSocket. | 253 * WebSocket. |
| 246 * | 254 * |
| 247 * @param[in] code The WebSocket close code. This is ignored if it is 0. | 255 * @param[in] code The WebSocket close code. This is ignored if it is |
| 256 * <code>PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED</code>. | |
| 248 * <code>PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE</code> must be used for the | 257 * <code>PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE</code> must be used for the |
| 249 * usual case. To indicate some specific error cases, codes in the range | 258 * usual case. To indicate some specific error cases, codes in the range |
| 250 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN</code> to | 259 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN</code> to |
| 251 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX</code>, and in the range | 260 * <code>PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MAX</code>, and in the range |
| 252 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN</code> to | 261 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MIN</code> to |
| 253 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX</code> are available. | 262 * <code>PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX</code> are available. |
| 254 * | 263 * |
| 255 * @param[in] reason A <code>PP_Var</code> representing the WebSocket | 264 * @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>. | 265 * close reason. This is ignored if it is <code>PP_VARTYPE_UNDEFINED</code>. |
| 257 * Otherwise, its <code>PP_VarType</code> must be | 266 * 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 | 435 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a |
| 427 * WebSocket. | 436 * WebSocket. |
| 428 * | 437 * |
| 429 * @return Returns a <code>PP_VARTYPE_STRING</code> var. If called before the | 438 * @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 | 439 * connection is established, the var contains the empty string. Returns a |
| 431 * <code>PP_VARTYPE_UNDEFINED</code> if this function is called on an | 440 * <code>PP_VARTYPE_UNDEFINED</code> if this function is called on an |
| 432 * invalid resource. | 441 * invalid resource. |
| 433 */ | 442 */ |
| 434 PP_Var GetURL([in] PP_Resource web_socket); | 443 PP_Var GetURL([in] PP_Resource web_socket); |
| 435 }; | 444 }; |
| OLD | NEW |