diff options
author | toyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-27 06:07:25 +0000 |
---|---|---|
committer | toyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-27 06:07:25 +0000 |
commit | dc909a9e56db63a207f21d2056c86f531aedc18f (patch) | |
tree | 91e9c7df3d8ff83b94e7528f28be4f15478b0188 | |
parent | 1c6027f1ae1f33a7ead07bfb767843a1170b8da7 (diff) | |
download | chromium_src-dc909a9e56db63a207f21d2056c86f531aedc18f.zip chromium_src-dc909a9e56db63a207f21d2056c86f531aedc18f.tar.gz chromium_src-dc909a9e56db63a207f21d2056c86f531aedc18f.tar.bz2 |
WebSocket Pepper API: Remove binary type handling interfaces
In an API discussion, we decide to remove binary type handling interfaces
from the first release. This change just fix the interface. The change to
make the interface out of dev will follow this change.
BUG=87310
TEST=ui_test --gtest_filter='*WebSocket*'
Review URL: https://chromiumcodereview.appspot.com/9296001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119382 0039d316-1c4b-4281-b951-d872f2087c98
17 files changed, 23 insertions, 461 deletions
diff --git a/ppapi/api/dev/ppb_websocket_dev.idl b/ppapi/api/dev/ppb_websocket_dev.idl index 0836038..0a68e7c 100644 --- a/ppapi/api/dev/ppb_websocket_dev.idl +++ b/ppapi/api/dev/ppb_websocket_dev.idl @@ -7,8 +7,7 @@ * This file defines the <code>PPB_WebSocket_Dev</code> interface. */ label Chrome { - M17 = 0.1, - M18 = 0.9 + M17 = 0.1 }; @@ -45,29 +44,6 @@ enum PP_WebSocketReadyState_Dev { PP_WEBSOCKETREADYSTATE_CLOSED_DEV = 3 }; -/** - * 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_WebSocketBinaryType_Dev { - /** - * Binary type is queried on an invalid resource. - */ - PP_WEBSOCKETBINARYTYPE_INVALID = -1, - - /** - * Binary type that represents Blob objects. - */ - PP_WEBSOCKETBINARYTYPE_BLOB_DEV = 0, - - /** - * Binary type that represents ArrayBuffer objects. - */ - PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV = 1 -}; - interface PPB_WebSocket_Dev { /** * Create() creates a WebSocket instance. @@ -180,7 +156,9 @@ interface PPB_WebSocket_Dev { * * @param[out] message The received message is copied to provided * <code>message</code>. The <code>message</code> must remain valid until - * the ReceiveMessage operation completes. + * the ReceiveMessage operation completes. Its <code>PP_VarType</code> + * will be <code>PP_VARTYPE_STRING</code> or + * <code>PP_VARTYPE_ARRAY_BYFFER</code> on receiving. * * @param[in] callback A <code>PP_CompletionCallback</code> which is called * when the receiving message is completed. It is ignored if ReceiveMessage @@ -204,7 +182,8 @@ interface PPB_WebSocket_Dev { * * @param[in] message A message to send. The message is copied to internal * buffer. So caller can free <code>message</code> safely after returning - * from the function. + * from the function. Its <code>PP_VarType</code> must be + * <code>PP_VARTYPE_STRING</code> or <code>PP_VARTYPE_ARRAY_BUFFER</code>. * * @return An int32_t containing an error code from <code>pp_errors.h</code>. * Returns <code>PP_ERROR_FAILED</code> if the ReadyState is @@ -319,43 +298,4 @@ 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 the binary object type for receiving binary - * frames 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 the specified binary object type. - * Default type is <code>PP_WEBSOCKETBINARYTYPE_BLOB_DEV</code>. - * - * Currently, Blob bindings is not supported in Pepper, so receiving binary - * type is always ArrayBuffer. To ensure backward compatibility, you must - * call this function with - * <code>PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV</code> to use binary frames. - * - * @param[in] web_socket A <code>PP_Resource</code> corresponding to a - * WebSocket. - * - * @param[in] binary_type Binary object type for receiving binary frames - * representation. - * - * @return Returns <code>PP_FALSE</code> if the specified type is not - * supported. 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 the currently specified binary object type for - * receiving binary frames. - * - * @param[in] web_socket A <code>PP_Resource</code> corresponding to a - * WebSocket. - * - * @return Returns <code>PP_WebSocketBinaryType_Dev</code> represents the - * current binary object type. - */ - [version=0.9] - PP_WebSocketBinaryType_Dev GetBinaryType([in] PP_Resource web_socket); }; diff --git a/ppapi/c/dev/ppb_websocket_dev.h b/ppapi/c/dev/ppb_websocket_dev.h index e138f2b..2a6f78b 100644 --- a/ppapi/c/dev/ppb_websocket_dev.h +++ b/ppapi/c/dev/ppb_websocket_dev.h @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* From dev/ppb_websocket_dev.idl modified Wed Jan 18 20:17:45 2012. */ +/* From dev/ppb_websocket_dev.idl modified Fri Jan 27 10:09:34 2012. */ #ifndef PPAPI_C_DEV_PPB_WEBSOCKET_DEV_H_ #define PPAPI_C_DEV_PPB_WEBSOCKET_DEV_H_ @@ -17,8 +17,7 @@ #include "ppapi/c/pp_var.h" #define PPB_WEBSOCKET_DEV_INTERFACE_0_1 "PPB_WebSocket(Dev);0.1" -#define PPB_WEBSOCKET_DEV_INTERFACE_0_9 "PPB_WebSocket(Dev);0.9" -#define PPB_WEBSOCKET_DEV_INTERFACE PPB_WEBSOCKET_DEV_INTERFACE_0_9 +#define PPB_WEBSOCKET_DEV_INTERFACE PPB_WEBSOCKET_DEV_INTERFACE_0_1 /** * @file @@ -59,27 +58,6 @@ typedef enum { PP_WEBSOCKETREADYSTATE_CLOSED_DEV = 3 } PP_WebSocketReadyState_Dev; PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_WebSocketReadyState_Dev, 4); - -/** - * This enumeration contains the types representing the WebSocket binary type - * to receive frames. These types are based on the JavaScript WebSocket API - * specification. - */ -typedef enum { - /** - * Binary type is queried on an invalid resource. - */ - PP_WEBSOCKETBINARYTYPE_INVALID = -1, - /** - * Binary type that represents Blob objects. - */ - PP_WEBSOCKETBINARYTYPE_BLOB_DEV = 0, - /** - * Binary type that represents ArrayBuffer objects. - */ - PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV = 1 -} PP_WebSocketBinaryType_Dev; -PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_WebSocketBinaryType_Dev, 4); /** * @} */ @@ -88,7 +66,7 @@ PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_WebSocketBinaryType_Dev, 4); * @addtogroup Interfaces * @{ */ -struct PPB_WebSocket_Dev_0_9 { +struct PPB_WebSocket_Dev_0_1 { /** * Create() creates a WebSocket instance. * @@ -196,7 +174,9 @@ struct PPB_WebSocket_Dev_0_9 { * * @param[out] message The received message is copied to provided * <code>message</code>. The <code>message</code> must remain valid until - * the ReceiveMessage operation completes. + * the ReceiveMessage operation completes. Its <code>PP_VarType</code> + * will be <code>PP_VARTYPE_STRING</code> or + * <code>PP_VARTYPE_ARRAY_BYFFER</code> on receiving. * * @param[in] callback A <code>PP_CompletionCallback</code> which is called * when the receiving message is completed. It is ignored if ReceiveMessage @@ -219,7 +199,8 @@ struct PPB_WebSocket_Dev_0_9 { * * @param[in] message A message to send. The message is copied to internal * buffer. So caller can free <code>message</code> safely after returning - * from the function. + * from the function. Its <code>PP_VarType</code> must be + * <code>PP_VARTYPE_STRING</code> or <code>PP_VARTYPE_ARRAY_BUFFER</code>. * * @return An int32_t containing an error code from <code>pp_errors.h</code>. * Returns <code>PP_ERROR_FAILED</code> if the ReadyState is @@ -325,70 +306,9 @@ struct PPB_WebSocket_Dev_0_9 { * <code>PP_VARTYPE_UNDEFINED</code> if called on an invalid resource. */ struct PP_Var (*GetURL)(PP_Resource web_socket); - /** - * SetBinaryType() specifies the binary object type for receiving binary - * frames 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 the specified binary object type. - * Default type is <code>PP_WEBSOCKETBINARYTYPE_BLOB_DEV</code>. - * - * Currently, Blob bindings is not supported in Pepper, so receiving binary - * type is always ArrayBuffer. To ensure backward compatibility, you must - * call this function with - * <code>PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV</code> to use binary frames. - * - * @param[in] web_socket A <code>PP_Resource</code> corresponding to a - * WebSocket. - * - * @param[in] binary_type Binary object type for receiving binary frames - * representation. - * - * @return Returns <code>PP_FALSE</code> if the specified type is not - * supported. Otherwise, returns <code>PP_TRUE</code>. - */ - PP_Bool (*SetBinaryType)(PP_Resource web_socket, - PP_WebSocketBinaryType_Dev binary_type); - /** - * GetBinaryType() returns the currently specified binary object type for - * receiving binary frames. - * - * @param[in] web_socket A <code>PP_Resource</code> corresponding to a - * WebSocket. - * - * @return Returns <code>PP_WebSocketBinaryType_Dev</code> represents the - * current binary object type. - */ - PP_WebSocketBinaryType_Dev (*GetBinaryType)(PP_Resource web_socket); }; -typedef struct PPB_WebSocket_Dev_0_9 PPB_WebSocket_Dev; - -struct PPB_WebSocket_Dev_0_1 { - PP_Resource (*Create)(PP_Instance instance); - PP_Bool (*IsWebSocket)(PP_Resource resource); - int32_t (*Connect)(PP_Resource web_socket, - struct PP_Var url, - const struct PP_Var protocols[], - uint32_t protocol_count, - struct PP_CompletionCallback callback); - int32_t (*Close)(PP_Resource web_socket, - uint16_t code, - struct PP_Var reason, - struct PP_CompletionCallback callback); - int32_t (*ReceiveMessage)(PP_Resource web_socket, - struct PP_Var* message, - struct PP_CompletionCallback callback); - int32_t (*SendMessage)(PP_Resource web_socket, struct PP_Var message); - uint64_t (*GetBufferedAmount)(PP_Resource web_socket); - uint16_t (*GetCloseCode)(PP_Resource web_socket); - struct PP_Var (*GetCloseReason)(PP_Resource web_socket); - PP_Bool (*GetCloseWasClean)(PP_Resource web_socket); - struct PP_Var (*GetExtensions)(PP_Resource web_socket); - struct PP_Var (*GetProtocol)(PP_Resource web_socket); - PP_WebSocketReadyState_Dev (*GetReadyState)(PP_Resource web_socket); - struct PP_Var (*GetURL)(PP_Resource web_socket); -}; +typedef struct PPB_WebSocket_Dev_0_1 PPB_WebSocket_Dev; /** * @} */ diff --git a/ppapi/cpp/dev/websocket_dev.cc b/ppapi/cpp/dev/websocket_dev.cc index 4cc7f8a..65578fd 100644 --- a/ppapi/cpp/dev/websocket_dev.cc +++ b/ppapi/cpp/dev/websocket_dev.cc @@ -145,17 +145,4 @@ Var WebSocket_Dev::GetURL() { get_interface<PPB_WebSocket_Dev>()->GetURL(pp_resource())); } -bool WebSocket_Dev::SetBinaryType(PP_WebSocketBinaryType_Dev binary_type) { - if (!has_interface<PPB_WebSocket_Dev>()) - return false; - return PP_ToBool(get_interface<PPB_WebSocket_Dev>()->SetBinaryType( - pp_resource(), binary_type)); -} - -PP_WebSocketBinaryType_Dev WebSocket_Dev::GetBinaryType() { - if (!has_interface<PPB_WebSocket_Dev>()) - return PP_WEBSOCKETBINARYTYPE_INVALID; - return get_interface<PPB_WebSocket_Dev>()->GetBinaryType(pp_resource()); -} - } // namespace pp diff --git a/ppapi/cpp/dev/websocket_dev.h b/ppapi/cpp/dev/websocket_dev.h index 2c55d51..e1de536 100644 --- a/ppapi/cpp/dev/websocket_dev.h +++ b/ppapi/cpp/dev/websocket_dev.h @@ -87,7 +87,8 @@ class WebSocket_Dev : public Resource { /// /// @param[out] message The received message is copied to provided /// <code>message</code>. The <code>message</code> must remain valid until - /// the ReceiveMessage operation completes. + /// the ReceiveMessage operation completes. It will be a <code>Var</code> of + /// string or ArrayBuffer types on receiving. /// @param[in] callback A <code>CompletionCallback</code> which is called /// when the receiving message is completed. It is ignored if ReceiveMessage /// completes synchronously and returns <code>PP_OK</code>. @@ -105,7 +106,8 @@ class WebSocket_Dev : public Resource { /// /// @param[in] data A message to send. The message is copied to internal /// buffer. So caller can free <code>data</code> safely after returning - /// from the function. + /// from the function. It must be a <code>Var</code> of string or ArrayBuffer + /// types. /// /// @return An int32_t containing an error code from /// <code>pp_errors.h</code>. @@ -176,33 +178,6 @@ class WebSocket_Dev : public Resource { /// @return Returns a <code>Var</code> of string type. If called before the /// connection is established, it contains the empty string. Var GetURL(); - - /// SetBinaryType() specifies the binary object type for receiving binary - /// frames 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 the specified binary object type. - /// Default type is <code>PP_WEBSOCKETBINARYTYPE_BLOB_DEV</code>. - /// - /// Currently, Blob bindings is not supported in Pepper, so receiving binary - /// type is always ArrayBuffer. To ensure backward compatibility, you must - /// call this function with - /// <code>PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV</code> to use binary frames. - /// - /// @param[in] binary_type Binary object type for receiving binary frames - /// representation. - /// - /// @return Returns <code>false</code> if the specified type is not - /// supported. Otherwise, returns <code>true</code>. - /// - bool SetBinaryType(PP_WebSocketBinaryType_Dev binary_type); - - /// GetBinaryType() returns the currently specified binary object type for - /// receiving binary frames. - /// - /// @return Returns <code>PP_WebSocketBinaryType_Dev</code> represents the - /// current binary object type. - PP_WebSocketBinaryType_Dev GetBinaryType(); }; } // namespace pp diff --git a/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_websocket_rpc_server.cc b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_websocket_rpc_server.cc index 01749fc..d59997b 100644 --- a/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_websocket_rpc_server.cc +++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_websocket_rpc_server.cc @@ -321,40 +321,3 @@ void PpbWebSocketRpcServer::PPB_WebSocket_GetURL( if (SerializeTo(&url, url_bytes, url_size)) rpc->result = NACL_SRPC_RESULT_OK; } - -void PpbWebSocketRpcServer::PPB_WebSocket_SetBinaryType( - NaClSrpcRpc* rpc, - NaClSrpcClosure* done, - // inputs - PP_Resource ws, - int32_t binary_type, - // outputs - int32_t* success) { - NaClSrpcClosureRunner runner(done); - rpc->result = NACL_SRPC_RESULT_APP_ERROR; - - PP_Bool pp_success = PPBWebSocketInterface()->SetBinaryType( - ws, static_cast<PP_WebSocketBinaryType_Dev>(binary_type)); - *success = PP_ToBool(pp_success); - DebugPrintf("PPB_WebSocket::SetBinaryType:: success=%d\n", *success); - - rpc->result = NACL_SRPC_RESULT_OK; -} - -void PpbWebSocketRpcServer::PPB_WebSocket_GetBinaryType( - NaClSrpcRpc* rpc, - NaClSrpcClosure* done, - // inputs - PP_Resource ws, - // outputs - int32_t* binary_type) { - NaClSrpcClosureRunner runner(done); - rpc->result = NACL_SRPC_RESULT_APP_ERROR; - - *binary_type = static_cast<int32_t>( - PPBWebSocketInterface()->GetBinaryType(ws)); - DebugPrintf( - "PPB_WebSocket::GetBinaryType:: binary_type=%d\n", *binary_type); - - rpc->result = NACL_SRPC_RESULT_OK; -} diff --git a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_websocket.cc b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_websocket.cc index a24c654..56b4de2 100644 --- a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_websocket.cc +++ b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_websocket.cc @@ -303,42 +303,6 @@ PP_Var GetURL(PP_Resource ws) { return PP_MakeUndefined(); } -PP_Bool SetBinaryType(PP_Resource ws, - PP_WebSocketBinaryType_Dev binary_type) { - DebugPrintf("PPB_WebSocket::SetBinaryType: ws=%"NACL_PRId32"\n", ws); - - int32_t success; - NaClSrpcError srpc_result = - PpbWebSocketRpcClient::PPB_WebSocket_SetBinaryType( - GetMainSrpcChannel(), - ws, - static_cast<int32_t>(binary_type), - &success); - DebugPrintf("PPB_WebSocket::SetBinaryType: %s\n", - NaClSrpcErrorString(srpc_result)); - - if (srpc_result == NACL_SRPC_RESULT_OK && success) - return PP_TRUE; - return PP_FALSE; -} - -PP_WebSocketBinaryType_Dev GetBinaryType(PP_Resource ws) { - DebugPrintf("PPB_WebSocket::GetBinaryType: ws=%"NACL_PRId32"\n", ws); - - int32_t binary_type; - NaClSrpcError srpc_result = - PpbWebSocketRpcClient::PPB_WebSocket_GetBinaryType( - GetMainSrpcChannel(), - ws, - &binary_type); - DebugPrintf("PPB_WebSocket::GetBinaryType: %s\n", - NaClSrpcErrorString(srpc_result)); - - if (srpc_result != NACL_SRPC_RESULT_OK) - return PP_WEBSOCKETBINARYTYPE_INVALID; - return static_cast<PP_WebSocketBinaryType_Dev>(binary_type); -} - } // namespace const PPB_WebSocket_Dev* PluginWebSocket::GetInterface() { @@ -356,9 +320,7 @@ const PPB_WebSocket_Dev* PluginWebSocket::GetInterface() { &GetExtensions, &GetProtocol, &GetReadyState, - &GetURL, - &SetBinaryType, - &GetBinaryType + &GetURL }; return &websocket_interface; } diff --git a/ppapi/native_client/src/shared/ppapi_proxy/ppb_rpc_client.cc b/ppapi/native_client/src/shared/ppapi_proxy/ppb_rpc_client.cc index 1f51f54..a0d7d44 100644 --- a/ppapi/native_client/src/shared/ppapi_proxy/ppb_rpc_client.cc +++ b/ppapi/native_client/src/shared/ppapi_proxy/ppb_rpc_client.cc @@ -3438,42 +3438,6 @@ NaClSrpcError PpbWebSocketRpcClient::PPB_WebSocket_GetURL( return retval; } -NaClSrpcError PpbWebSocketRpcClient::PPB_WebSocket_SetBinaryType( - NaClSrpcChannel* channel, - PP_Resource ws, - int32_t binary_type, - int32_t* success) { - VCHECK(ppapi_proxy::PPBCoreInterface()->IsMainThread(), - ("%s: PPAPI calls are not supported off the main thread\n", - __FUNCTION__)); - NaClSrpcError retval; - retval = NaClSrpcInvokeBySignature( - channel, - "PPB_WebSocket_SetBinaryType:ii:i", - ws, - binary_type, - success - ); - return retval; -} - -NaClSrpcError PpbWebSocketRpcClient::PPB_WebSocket_GetBinaryType( - NaClSrpcChannel* channel, - PP_Resource ws, - int32_t* binary_type) { - VCHECK(ppapi_proxy::PPBCoreInterface()->IsMainThread(), - ("%s: PPAPI calls are not supported off the main thread\n", - __FUNCTION__)); - NaClSrpcError retval; - retval = NaClSrpcInvokeBySignature( - channel, - "PPB_WebSocket_GetBinaryType:i:i", - ws, - binary_type - ); - return retval; -} - NaClSrpcError PpbWidgetRpcClient::PPB_Widget_IsWidget( NaClSrpcChannel* channel, PP_Resource resource, diff --git a/ppapi/native_client/src/shared/ppapi_proxy/ppb_rpc_server.cc b/ppapi/native_client/src/shared/ppapi_proxy/ppb_rpc_server.cc index 31a0a6f..9476805 100644 --- a/ppapi/native_client/src/shared/ppapi_proxy/ppb_rpc_server.cc +++ b/ppapi/native_client/src/shared/ppapi_proxy/ppb_rpc_server.cc @@ -2760,35 +2760,6 @@ static void PPB_WebSocket_GetURLDispatcher( ); } -static void PPB_WebSocket_SetBinaryTypeDispatcher( - NaClSrpcRpc* rpc, - NaClSrpcArg** inputs, - NaClSrpcArg** outputs, - NaClSrpcClosure* done -) { - PpbWebSocketRpcServer::PPB_WebSocket_SetBinaryType( - rpc, - done, - inputs[0]->u.ival, - inputs[1]->u.ival, - &(outputs[0]->u.ival) - ); -} - -static void PPB_WebSocket_GetBinaryTypeDispatcher( - NaClSrpcRpc* rpc, - NaClSrpcArg** inputs, - NaClSrpcArg** outputs, - NaClSrpcClosure* done -) { - PpbWebSocketRpcServer::PPB_WebSocket_GetBinaryType( - rpc, - done, - inputs[0]->u.ival, - &(outputs[0]->u.ival) - ); -} - static void PPB_Widget_IsWidgetDispatcher( NaClSrpcRpc* rpc, NaClSrpcArg** inputs, @@ -3078,8 +3049,6 @@ NaClSrpcHandlerDesc PpbRpcs::srpc_methods[] = { { "PPB_WebSocket_GetProtocol:i:C", PPB_WebSocket_GetProtocolDispatcher }, { "PPB_WebSocket_GetReadyState:i:i", PPB_WebSocket_GetReadyStateDispatcher }, { "PPB_WebSocket_GetURL:i:C", PPB_WebSocket_GetURLDispatcher }, - { "PPB_WebSocket_SetBinaryType:ii:i", PPB_WebSocket_SetBinaryTypeDispatcher }, - { "PPB_WebSocket_GetBinaryType:i:i", PPB_WebSocket_GetBinaryTypeDispatcher }, { "PPB_Widget_IsWidget:i:i", PPB_Widget_IsWidgetDispatcher }, { "PPB_Widget_Paint:iCi:i", PPB_Widget_PaintDispatcher }, { "PPB_Widget_HandleEvent:ii:i", PPB_Widget_HandleEventDispatcher }, diff --git a/ppapi/native_client/src/shared/ppapi_proxy/ppb_websocket.srpc b/ppapi/native_client/src/shared/ppapi_proxy/ppb_websocket.srpc index 9f6a8c0..6c6fe49 100644 --- a/ppapi/native_client/src/shared/ppapi_proxy/ppb_websocket.srpc +++ b/ppapi/native_client/src/shared/ppapi_proxy/ppb_websocket.srpc @@ -100,19 +100,6 @@ ], 'outputs': [['url', 'char[]'], # PP_Var ] - }, - {'name': 'PPB_WebSocket_SetBinaryType', - 'inputs': [['ws', 'PP_Resource'], # PP_Resource - ['binary_type', 'int32_t'], # PP_WebSocketBinaryType - ], - 'outputs': [['success', 'int32_t'], # PP_Bool - ] - }, - {'name': 'PPB_WebSocket_GetBinaryType', - 'inputs': [['ws', 'PP_Resource'], # PP_Resource - ], - 'outputs': [['binary_type', 'int32_t'], # PP_WebSocketBinaryType - ] } ] } diff --git a/ppapi/native_client/src/shared/ppapi_proxy/trusted/srpcgen/ppb_rpc.h b/ppapi/native_client/src/shared/ppapi_proxy/trusted/srpcgen/ppb_rpc.h index d6fa45e..b2fda1b25 100644 --- a/ppapi/native_client/src/shared/ppapi_proxy/trusted/srpcgen/ppb_rpc.h +++ b/ppapi/native_client/src/shared/ppapi_proxy/trusted/srpcgen/ppb_rpc.h @@ -1362,17 +1362,6 @@ class PpbWebSocketRpcServer { NaClSrpcClosure* done, PP_Resource ws, nacl_abi_size_t* url_bytes, char* url); - static void PPB_WebSocket_SetBinaryType( - NaClSrpcRpc* rpc, - NaClSrpcClosure* done, - PP_Resource ws, - int32_t binary_type, - int32_t* success); - static void PPB_WebSocket_GetBinaryType( - NaClSrpcRpc* rpc, - NaClSrpcClosure* done, - PP_Resource ws, - int32_t* binary_type); private: PpbWebSocketRpcServer(); diff --git a/ppapi/native_client/src/shared/ppapi_proxy/untrusted/srpcgen/ppb_rpc.h b/ppapi/native_client/src/shared/ppapi_proxy/untrusted/srpcgen/ppb_rpc.h index c76832c..6585b48 100644 --- a/ppapi/native_client/src/shared/ppapi_proxy/untrusted/srpcgen/ppb_rpc.h +++ b/ppapi/native_client/src/shared/ppapi_proxy/untrusted/srpcgen/ppb_rpc.h @@ -1182,15 +1182,6 @@ class PpbWebSocketRpcClient { NaClSrpcChannel* channel, PP_Resource ws, nacl_abi_size_t* url_bytes, char* url); - static NaClSrpcError PPB_WebSocket_SetBinaryType( - NaClSrpcChannel* channel, - PP_Resource ws, - int32_t binary_type, - int32_t* success); - static NaClSrpcError PPB_WebSocket_GetBinaryType( - NaClSrpcChannel* channel, - PP_Resource ws, - int32_t* binary_type); private: PpbWebSocketRpcClient(); diff --git a/ppapi/tests/test_websocket.cc b/ppapi/tests/test_websocket.cc index c82eafb..91f6379 100644 --- a/ppapi/tests/test_websocket.cc +++ b/ppapi/tests/test_websocket.cc @@ -135,8 +135,6 @@ PP_Resource TestWebSocket::Connect( protocols[0] = CreateVarString(protocol); protocol_count = 1U; } - websocket_interface_->SetBinaryType( - ws, PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV); *result = websocket_interface_->Connect( ws, url_var, protocols, protocol_count, static_cast<pp::CompletionCallback>(callback).pp_completion_callback()); @@ -199,10 +197,6 @@ std::string TestWebSocket::TestUninitializedPropertiesAccess() { ASSERT_TRUE(AreEqualWithString(url, "")); ReleaseVar(url); - PP_WebSocketBinaryType_Dev binary_type = - websocket_interface_->GetBinaryType(ws); - ASSERT_EQ(PP_WEBSOCKETBINARYTYPE_BLOB_DEV, binary_type); - core_interface_->ReleaseResource(ws); PASS(); @@ -574,7 +568,6 @@ std::string TestWebSocket::TestCcInterfaces() { ASSERT_TRUE(AreEqualWithString(ws.GetURL().pp_var(), "")); // Check communication interfaces (connect, send, receive, and close). - ASSERT_TRUE(ws.SetBinaryType(PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV)); TestCompletionCallback connect_callback(instance_->pp_instance()); int32_t result = ws.Connect(pp::Var(std::string(kCloseServerURL)), NULL, 0U, connect_callback); @@ -628,7 +621,6 @@ std::string TestWebSocket::TestCcInterfaces() { ASSERT_TRUE(AreEqualWithString(ws.GetProtocol().pp_var(), "")); ASSERT_EQ(PP_WEBSOCKETREADYSTATE_CLOSED_DEV, ws.GetReadyState()); ASSERT_TRUE(AreEqualWithString(ws.GetURL().pp_var(), kCloseServerURL)); - ASSERT_EQ(PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV, ws.GetBinaryType()); PASS(); } diff --git a/ppapi/thunk/interfaces_ppb_public_dev.h b/ppapi/thunk/interfaces_ppb_public_dev.h index e4bc1b8..bfc828e 100644 --- a/ppapi/thunk/interfaces_ppb_public_dev.h +++ b/ppapi/thunk/interfaces_ppb_public_dev.h @@ -64,8 +64,8 @@ PROXIED_IFACE(PPB_VideoDecoder, PPB_VIDEODECODER_DEV_INTERFACE_0_16, PPB_VideoDecoder_Dev_0_16) UNPROXIED_IFACE(PPB_VideoLayer, PPB_VIDEOLAYER_DEV_INTERFACE_0_1, PPB_VideoLayer_Dev_0_1) -UNPROXIED_IFACE(PPB_WebSocket, PPB_WEBSOCKET_DEV_INTERFACE_0_9, - PPB_WebSocket_Dev_0_9) +UNPROXIED_IFACE(PPB_WebSocket, PPB_WEBSOCKET_DEV_INTERFACE_0_1, + PPB_WebSocket_Dev_0_1) UNPROXIED_IFACE(PPB_Widget, PPB_WIDGET_DEV_INTERFACE_0_3, PPB_Widget_Dev_0_3) #include "ppapi/thunk/interfaces_postamble.h" diff --git a/ppapi/thunk/ppb_websocket_api.h b/ppapi/thunk/ppb_websocket_api.h index 4012582..867550d 100644 --- a/ppapi/thunk/ppb_websocket_api.h +++ b/ppapi/thunk/ppb_websocket_api.h @@ -33,8 +33,6 @@ class PPB_WebSocket_API { virtual PP_Var GetProtocol() = 0; virtual PP_WebSocketReadyState_Dev GetReadyState() = 0; virtual PP_Var GetURL() = 0; - virtual PP_Bool SetBinaryType(PP_WebSocketBinaryType_Dev) = 0; - virtual PP_WebSocketBinaryType_Dev GetBinaryType() = 0; }; } // namespace thunk diff --git a/ppapi/thunk/ppb_websocket_thunk.cc b/ppapi/thunk/ppb_websocket_thunk.cc index ca12d6b..ea67f84 100644 --- a/ppapi/thunk/ppb_websocket_thunk.cc +++ b/ppapi/thunk/ppb_websocket_thunk.cc @@ -124,21 +124,6 @@ PP_Var GetURL(PP_Resource resource) { return enter.object()->GetURL(); } -PP_Bool SetBinaryType(PP_Resource resource, - PP_WebSocketBinaryType_Dev binary_type) { - EnterResource<PPB_WebSocket_API> enter(resource, false); - if (enter.failed()) - return PP_FALSE; - return enter.object()->SetBinaryType(binary_type); -} - -PP_WebSocketBinaryType_Dev GetBinaryType(PP_Resource resource) { - EnterResource<PPB_WebSocket_API> enter(resource, false); - if (enter.failed()) - return PP_WEBSOCKETBINARYTYPE_INVALID; - return enter.object()->GetBinaryType(); -} - const PPB_WebSocket_Dev_0_1 g_ppb_websocket_0_1_thunk = { &Create, &IsWebSocket, @@ -156,34 +141,11 @@ const PPB_WebSocket_Dev_0_1 g_ppb_websocket_0_1_thunk = { &GetURL }; -const PPB_WebSocket_Dev_0_9 g_ppb_websocket_0_9_thunk = { - &Create, - &IsWebSocket, - &Connect, - &Close, - &ReceiveMessage, - &SendMessage, - &GetBufferedAmount, - &GetCloseCode, - &GetCloseReason, - &GetCloseWasClean, - &GetExtensions, - &GetProtocol, - &GetReadyState, - &GetURL, - &SetBinaryType, - &GetBinaryType -}; - } // namespace const PPB_WebSocket_Dev_0_1* GetPPB_WebSocket_Dev_0_1_Thunk() { return &g_ppb_websocket_0_1_thunk; } -const PPB_WebSocket_Dev_0_9* GetPPB_WebSocket_Dev_0_9_Thunk() { - return &g_ppb_websocket_0_9_thunk; -} - } // namespace thunk } // namespace ppapi diff --git a/webkit/plugins/ppapi/ppb_websocket_impl.cc b/webkit/plugins/ppapi/ppb_websocket_impl.cc index 760a4e4..be42d7e 100644 --- a/webkit/plugins/ppapi/ppb_websocket_impl.cc +++ b/webkit/plugins/ppapi/ppb_websocket_impl.cc @@ -80,7 +80,6 @@ namespace ppapi { PPB_WebSocket_Impl::PPB_WebSocket_Impl(PP_Instance instance) : Resource(instance), state_(PP_WEBSOCKETREADYSTATE_INVALID_DEV), - binary_type_(WebSocket::BinaryTypeBlob), error_was_received_(false), receive_callback_var_(NULL), wait_for_receive_(false), @@ -196,7 +195,7 @@ int32_t PPB_WebSocket_Impl::Connect(PP_Var url, return PP_ERROR_NOTSUPPORTED; // Set receiving binary object type. - websocket_->setBinaryType(binary_type_); + websocket_->setBinaryType(WebSocket::BinaryTypeArrayBuffer); websocket_->connect(web_url, web_protocols); state_ = PP_WEBSOCKETREADYSTATE_CONNECTING_DEV; @@ -413,38 +412,6 @@ PP_Var PPB_WebSocket_Impl::GetURL() { return url_->GetPPVar(); } -PP_Bool PPB_WebSocket_Impl::SetBinaryType( - PP_WebSocketBinaryType_Dev binary_type) { - switch (binary_type) { - case PP_WEBSOCKETBINARYTYPE_BLOB_DEV: - binary_type_ = WebSocket::BinaryTypeBlob; - break; - case PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV: - binary_type_ = WebSocket::BinaryTypeArrayBuffer; - break; - default: - return PP_FALSE; - } - // WebKit API setBinaryType() is called when Connect() is called. - // If the websocket_ contains an object; it means Connect() is already - // called, call WebKit API here to reflect the setting as soon as possible. - if (websocket_.get()) - websocket_->setBinaryType(binary_type_); - return PP_TRUE; -} - -PP_WebSocketBinaryType_Dev PPB_WebSocket_Impl::GetBinaryType() { - switch (binary_type_) { - case WebSocket::BinaryTypeBlob: - return PP_WEBSOCKETBINARYTYPE_BLOB_DEV; - case WebSocket::BinaryTypeArrayBuffer: - return PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV; - default: - NOTREACHED(); - return PP_WEBSOCKETBINARYTYPE_INVALID; - } -} - void PPB_WebSocket_Impl::didConnect() { DCHECK_EQ(PP_WEBSOCKETREADYSTATE_CONNECTING_DEV, state_); state_ = PP_WEBSOCKETREADYSTATE_OPEN_DEV; diff --git a/webkit/plugins/ppapi/ppb_websocket_impl.h b/webkit/plugins/ppapi/ppb_websocket_impl.h index bd6f6c8..5e2021f 100644 --- a/webkit/plugins/ppapi/ppb_websocket_impl.h +++ b/webkit/plugins/ppapi/ppb_websocket_impl.h @@ -55,9 +55,6 @@ class PPB_WebSocket_Impl : public ::ppapi::Resource, virtual PP_Var GetProtocol() OVERRIDE; virtual PP_WebSocketReadyState_Dev GetReadyState() OVERRIDE; virtual PP_Var GetURL() OVERRIDE; - virtual PP_Bool SetBinaryType( - PP_WebSocketBinaryType_Dev binary_type) OVERRIDE; - virtual PP_WebSocketBinaryType_Dev GetBinaryType() OVERRIDE; // WebSocketClient implementation. virtual void didConnect(); @@ -75,7 +72,6 @@ class PPB_WebSocket_Impl : public ::ppapi::Resource, scoped_ptr<WebKit::WebSocket> websocket_; PP_WebSocketReadyState_Dev state_; - WebKit::WebSocket::BinaryType binary_type_; bool error_was_received_; scoped_refptr< ::ppapi::TrackedCallback> connect_callback_; |