| Index: ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_udp_socket_private.cc
|
| diff --git a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_udp_socket_private.cc b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_udp_socket_private.cc
|
| index f38dcc0a8014e35bb569b41fac48fb013bdf6533..49bde4c634c7d6023d70b0eede4368b9d30b830d 100644
|
| --- a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_udp_socket_private.cc
|
| +++ b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_udp_socket_private.cc
|
| @@ -5,8 +5,11 @@
|
| #include "native_client/src/shared/ppapi_proxy/plugin_ppb_udp_socket_private.h"
|
|
|
| #include <string.h>
|
| +
|
| #include "native_client/src/include/nacl_macros.h"
|
| +#include "native_client/src/include/nacl_scoped_ptr.h"
|
| #include "native_client/src/include/portability.h"
|
| +#include "native_client/src/shared/ppapi_proxy/object_serialize.h"
|
| #include "native_client/src/shared/ppapi_proxy/plugin_callback.h"
|
| #include "native_client/src/shared/ppapi_proxy/plugin_globals.h"
|
| #include "native_client/src/shared/ppapi_proxy/utility.h"
|
| @@ -57,6 +60,32 @@ PP_Bool IsUDPSocket(PP_Resource resource_id) {
|
| return PP_FALSE;
|
| }
|
|
|
| +int32_t SetSocketFeature(PP_Resource udp_socket,
|
| + PP_UDPSocketFeature_Private name,
|
| + struct PP_Var value) {
|
| + DebugPrintf("PPB_UDPSocket_Private::SetSocketFeature: ",
|
| + "udp_socket=%"NACL_PRId32"\n", udp_socket);
|
| +
|
| + nacl_abi_size_t value_size;
|
| + nacl::scoped_array<char> value_bytes(Serialize(&value, 1, &value_size));
|
| +
|
| + int32_t pp_error = PP_ERROR_FAILED;
|
| + NaClSrpcError srpc_result =
|
| + PpbUDPSocketPrivateRpcClient::PPB_UDPSocket_Private_SetSocketFeature(
|
| + GetMainSrpcChannel(),
|
| + udp_socket,
|
| + name,
|
| + value_size, value_bytes.get(),
|
| + &pp_error);
|
| +
|
| + DebugPrintf("PPB_UDPSocket_Private::SetSocketFeature: %s\n",
|
| + NaClSrpcErrorString(srpc_result));
|
| +
|
| + if (srpc_result != NACL_SRPC_RESULT_OK)
|
| + pp_error = PP_ERROR_FAILED;
|
| + return pp_error;
|
| +}
|
| +
|
| int32_t Bind(PP_Resource udp_socket, const struct PP_NetAddress_Private* addr,
|
| struct PP_CompletionCallback callback) {
|
| DebugPrintf("PPB_UDPSocket_Private::Bind: "
|
| @@ -248,4 +277,19 @@ const PPB_UDPSocket_Private_0_3* PluginUDPSocketPrivate::GetInterface0_3() {
|
| return &udpsocket_private_interface;
|
| }
|
|
|
| +const PPB_UDPSocket_Private_0_4* PluginUDPSocketPrivate::GetInterface0_4() {
|
| + static const PPB_UDPSocket_Private_0_4 udpsocket_private_interface = {
|
| + Create,
|
| + IsUDPSocket,
|
| + SetSocketFeature,
|
| + Bind,
|
| + GetBoundAddress,
|
| + RecvFrom,
|
| + GetRecvFromAddress,
|
| + SendTo,
|
| + Close
|
| + };
|
| + return &udpsocket_private_interface;
|
| +}
|
| +
|
| } // namespace ppapi_proxy
|
|
|