Chromium Code Reviews| Index: ppapi/api/dev/ppb_websocket_dev.idl |
| diff --git a/ppapi/api/dev/ppb_websocket_dev.idl b/ppapi/api/dev/ppb_websocket_dev.idl |
| index 2354b72c8e225410fe7f96c306794f399477e3a0..a5d963a50903bce00cdcb6b51dd8fbc14f60bb52 100644 |
| --- a/ppapi/api/dev/ppb_websocket_dev.idl |
| +++ b/ppapi/api/dev/ppb_websocket_dev.idl |
| @@ -7,7 +7,8 @@ |
| * This file defines the <code>PPB_WebSocket_Dev</code> interface. |
| */ |
| label Chrome { |
| - M17 = 0.1 |
| + M17 = 0.1, |
| + M18 = 0.9 |
| }; |
| @@ -45,25 +46,28 @@ enum PP_WebSocketReadyState_Dev { |
| }; |
| /** |
| - * This enumeration contains the types representing the WebSocket message type |
| - * and these types are based on the JavaScript WebSocket API specification. |
| - * ReceiveMessage() and SendMessage() use them as a parameter to represent |
| - * handling message types. |
| + * This enumeration contains the types representing the WebSocket binary type |
| + * to receive frames. These types are based on the JavaScript WebSocket API |
| + * specification. |
| */ |
| [assert_size(4)] |
| -enum PP_WebSocketMessageType_Dev { |
| +enum PP_WebSocketBinaryType_Dev { |
| /** |
| - * Message type that represents a text message type. |
| + * Binary type is queried on an invalid resource. |
| */ |
| - PP_WEBSOCKET_MESSAGE_TYPE_TEXT_DEV = 0, |
| + PP_WEBSOCKETBINARYTYPE_INVALID = -1, |
|
dmichael (off chromium)
2012/01/11 04:53:41
append _DEV
|
| /** |
| - * Message type that represents a binary message type. |
| + * Binary type that represents Blob objects. |
| */ |
| - PP_WEBSOCKET_MESSAGE_TYPE_BINARY_DEV = 1 |
| + PP_WEBSOCKETBINARYTYPE_BLOB_DEV = 0, |
| + |
| + /** |
| + * Binary type that represents ArrayBuffer objects. |
| + */ |
| + PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV = 1 |
| }; |
| -[version=0.1, macro="PPB_WEBSOCKET_DEV_INTERFACE"] |
| interface PPB_WebSocket_Dev { |
| /** |
| * Create() creates a WebSocket instance. |
| @@ -315,4 +319,40 @@ interface PPB_WebSocket_Dev { |
| * <code>PP_VARTYPE_UNDEFINED</code> if called on an invalid resource. |
| */ |
| PP_Var GetURL([in] PP_Resource web_socket); |
| + |
| + /** |
| + * 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.
|
| + * representation. Receiving text frames are always mapped to |
| + * <PP_VARTYPE_STRING</code> var regardless of this attribute. |
| + * This function should be called before Connect() to ensure receiving all |
| + * 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.
|
| + * Default type must be <code>PP_WEBSOCKETBINARYTYPE_BLOB_DEV</code>, but |
| + * currently is <code>PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER</code> for lack |
| + * 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
|
| + * |
| + * @param[in] web_socket A <code>PP_Resource</code> corresponding to a |
| + * WebSocket. |
| + * |
| + * @param[in] binary_type Binary object type for receibing binary frames |
| + * representation. |
| + * |
| + * @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.
|
| + * Otherwise, returns <code>PP_TRUE</code>. |
| + */ |
| + [version=0.9] |
| + PP_Bool SetBinaryType([in] PP_Resource web_socket, |
| + [in] PP_WebSocketBinaryType_Dev binary_type); |
| + |
| + /** |
| + * GetBinaryType() returns currently specified binary object type for |
| + * receiving binary frames representation. |
| + * |
| + * @param[in] web_socket A <code>PP_Resource</code> corresponding to a |
| + * WebSocket. |
| + * |
| + * @return Returns <code>PP_WebSocketBinaryType_Dev</code> represents |
| + * current binary object type. |
| + */ |
| + [version=0.9] |
| + PP_WebSocketBinaryType_Dev GetBinaryType([in] PP_Resource web_socket); |
| }; |