Chromium Code Reviews| 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 fa2ccc2dfce8b8f281d71a4d21966fe539794960..ccbd5c5497b7a82dece271d565be51b40181bcb3 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 |
| @@ -86,6 +86,29 @@ int32_t Bind(PP_Resource udp_socket, const struct PP_NetAddress_Private* addr, |
| return MayForceCallback(callback, pp_error); |
| } |
| +PP_Bool GetBoundAddress(PP_Resource udp_socket, |
| + struct PP_NetAddress_Private* addr) { |
| + DebugPrintf("PPB_UDPSocket_Private::GetBoundAddress: " |
| + "udp_socket="NACL_PRId32"\n", udp_socket); |
| + |
| + nacl_abi_size_t addr_bytes; |
|
yzshen1
2012/02/06 06:51:27
You have to init this to the size of |addr| right?
mtilburg1
2012/02/06 15:11:35
Done.
|
| + int32_t success; |
| + NaClSrpcError srpc_result = |
| + PpbUDPSocketPrivateRpcClient::PPB_UDPSocket_Private_GetBoundAddress( |
| + GetMainSrpcChannel(), |
| + udp_socket, |
| + &addr_bytes, |
| + reinterpret_cast<char*>(addr), |
| + &success); |
| + |
| + DebugPrintf("PPB_UDPSocket_Private::GetBoundAddress: %s\n", |
| + NaClSrpcErrorString(srpc_result)); |
| + |
| + if (srpc_result == NACL_SRPC_RESULT_OK && success) |
| + return PP_TRUE; |
| + return PP_FALSE; |
| +} |
| + |
| int32_t RecvFrom(PP_Resource udp_socket, char* buffer, int32_t num_bytes, |
| struct PP_CompletionCallback callback) { |
| DebugPrintf("PPB_UDPSocket_Private::RecvFrom: udp_socket=%"NACL_PRId32", " |
| @@ -201,6 +224,7 @@ const PPB_UDPSocket_Private* PluginUDPSocketPrivate::GetInterface() { |
| Create, |
| IsUDPSocket, |
| Bind, |
| + GetBoundAddress, |
| RecvFrom, |
| GetRecvFromAddress, |
| SendTo, |