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_Dev</code> interface. | 7 * This file defines the <code>PPB_WebSocket_Dev</code> interface. |
| 8 */ | 8 */ |
| 9 label Chrome { | 9 label Chrome { |
| 10 M17 = 0.1 | 10 M17 = 0.1, |
| 11 M18 = 0.9 | |
| 11 }; | 12 }; |
| 12 | 13 |
| 13 | 14 |
| 14 /** | 15 /** |
| 15 * This enumeration contains the types representing the WebSocket ready state | 16 * This enumeration contains the types representing the WebSocket ready state |
| 16 * and these states are based on the JavaScript WebSocket API specification. | 17 * and these states are based on the JavaScript WebSocket API specification. |
| 17 * GetReadyState() returns one of these states. | 18 * GetReadyState() returns one of these states. |
| 18 */ | 19 */ |
| 19 [assert_size(4)] | 20 [assert_size(4)] |
| 20 enum PP_WebSocketReadyState_Dev { | 21 enum PP_WebSocketReadyState_Dev { |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 38 */ | 39 */ |
| 39 PP_WEBSOCKETREADYSTATE_CLOSING_DEV = 2, | 40 PP_WEBSOCKETREADYSTATE_CLOSING_DEV = 2, |
| 40 | 41 |
| 41 /** | 42 /** |
| 42 * Ready state that the connection has been closed or could not be opened. | 43 * Ready state that the connection has been closed or could not be opened. |
| 43 */ | 44 */ |
| 44 PP_WEBSOCKETREADYSTATE_CLOSED_DEV = 3 | 45 PP_WEBSOCKETREADYSTATE_CLOSED_DEV = 3 |
| 45 }; | 46 }; |
| 46 | 47 |
| 47 /** | 48 /** |
| 48 * This enumeration contains the types representing the WebSocket message type | 49 * This enumeration contains the types representing the WebSocket binary type |
| 49 * and these types are based on the JavaScript WebSocket API specification. | 50 * to receive frames. These types are based on the JavaScript WebSocket API |
| 50 * ReceiveMessage() and SendMessage() use them as a parameter to represent | 51 * specification. |
| 51 * handling message types. | |
| 52 */ | 52 */ |
| 53 [assert_size(4)] | 53 [assert_size(4)] |
| 54 enum PP_WebSocketMessageType_Dev { | 54 enum PP_WebSocketBinaryType_Dev { |
| 55 /** | 55 /** |
| 56 * Message type that represents a text message type. | 56 * Binary type is queried on an invalid resource. |
| 57 */ | 57 */ |
| 58 PP_WEBSOCKET_MESSAGE_TYPE_TEXT_DEV = 0, | 58 PP_WEBSOCKETBINARYTYPE_INVALID = -1, |
|
dmichael (off chromium)
2012/01/11 04:53:41
append _DEV
| |
| 59 | 59 |
| 60 /** | 60 /** |
| 61 * Message type that represents a binary message type. | 61 * Binary type that represents Blob objects. |
| 62 */ | 62 */ |
| 63 PP_WEBSOCKET_MESSAGE_TYPE_BINARY_DEV = 1 | 63 PP_WEBSOCKETBINARYTYPE_BLOB_DEV = 0, |
| 64 | |
| 65 /** | |
| 66 * Binary type that represents ArrayBuffer objects. | |
| 67 */ | |
| 68 PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV = 1 | |
| 64 }; | 69 }; |
| 65 | 70 |
| 66 [version=0.1, macro="PPB_WEBSOCKET_DEV_INTERFACE"] | |
| 67 interface PPB_WebSocket_Dev { | 71 interface PPB_WebSocket_Dev { |
| 68 /** | 72 /** |
| 69 * Create() creates a WebSocket instance. | 73 * Create() creates a WebSocket instance. |
| 70 * | 74 * |
| 71 * @param[in] instance A <code>PP_Instance</code> identifying the instance | 75 * @param[in] instance A <code>PP_Instance</code> identifying the instance |
| 72 * with the WebSocket. | 76 * with the WebSocket. |
| 73 * | 77 * |
| 74 * @return A <code>PP_Resource</code> corresponding to a WebSocket if | 78 * @return A <code>PP_Resource</code> corresponding to a WebSocket if |
| 75 * successful. | 79 * successful. |
| 76 */ | 80 */ |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 308 * GetURL() returns the URL associated with specified WebSocket connection. | 312 * GetURL() returns the URL associated with specified WebSocket connection. |
| 309 * | 313 * |
| 310 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a | 314 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a |
| 311 * WebSocket. | 315 * WebSocket. |
| 312 * | 316 * |
| 313 * @return Returns a <code>PP_VARTYPE_STRING</code> var. If called before the | 317 * @return Returns a <code>PP_VARTYPE_STRING</code> var. If called before the |
| 314 * connection is established, it contains the empty string. Return a | 318 * connection is established, it contains the empty string. Return a |
| 315 * <code>PP_VARTYPE_UNDEFINED</code> if called on an invalid resource. | 319 * <code>PP_VARTYPE_UNDEFINED</code> if called on an invalid resource. |
| 316 */ | 320 */ |
| 317 PP_Var GetURL([in] PP_Resource web_socket); | 321 PP_Var GetURL([in] PP_Resource web_socket); |
| 322 | |
| 323 /** | |
| 324 * SetBinaryType() specifies binary object type for receiving binary frames | |
|
dmichael (off chromium)
2012/01/11 04:53:41
specifies "the" binary
Takashi Toyoshima
2012/01/11 05:25:49
Done.
| |
| 325 * representation. Receiving text frames are always mapped to | |
| 326 * <PP_VARTYPE_STRING</code> var regardless of this attribute. | |
| 327 * This function should be called before Connect() to ensure receiving all | |
| 328 * incoming binary frames as specified binary object type. | |
|
dmichael (off chromium)
2012/01/11 04:53:41
as "the" specified
Takashi Toyoshima
2012/01/11 05:25:49
Done.
| |
| 329 * Default type must be <code>PP_WEBSOCKETBINARYTYPE_BLOB_DEV</code>, but | |
| 330 * currently is <code>PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER</code> for lack | |
| 331 * of Blob bindings for Pepper. | |
|
dmichael (off chromium)
2012/01/11 04:53:41
I don't know if we should bother saying what type
Takashi Toyoshima
2012/01/11 05:25:49
I think it's confusing that the default binary typ
| |
| 332 * | |
| 333 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a | |
| 334 * WebSocket. | |
| 335 * | |
| 336 * @param[in] binary_type Binary object type for receibing binary frames | |
| 337 * representation. | |
| 338 * | |
| 339 * @return Returns <code>PP_FALSE</code> if specified type is not supported. | |
|
dmichael (off chromium)
2012/01/11 04:53:41
if "the" specified
Takashi Toyoshima
2012/01/11 05:25:49
Done.
| |
| 340 * Otherwise, returns <code>PP_TRUE</code>. | |
| 341 */ | |
| 342 [version=0.9] | |
| 343 PP_Bool SetBinaryType([in] PP_Resource web_socket, | |
| 344 [in] PP_WebSocketBinaryType_Dev binary_type); | |
| 345 | |
| 346 /** | |
| 347 * GetBinaryType() returns currently specified binary object type for | |
| 348 * receiving binary frames representation. | |
| 349 * | |
| 350 * @param[in] web_socket A <code>PP_Resource</code> corresponding to a | |
| 351 * WebSocket. | |
| 352 * | |
| 353 * @return Returns <code>PP_WebSocketBinaryType_Dev</code> represents | |
| 354 * current binary object type. | |
| 355 */ | |
| 356 [version=0.9] | |
| 357 PP_WebSocketBinaryType_Dev GetBinaryType([in] PP_Resource web_socket); | |
| 318 }; | 358 }; |
| OLD | NEW |