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..7077484eac1d7136a66b846c31853147d7ee0253 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,30 @@ 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 = |
+ static_cast<nacl_abi_size_t>(sizeof(PP_NetAddress_Private)); |
+ 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 +225,7 @@ const PPB_UDPSocket_Private* PluginUDPSocketPrivate::GetInterface() { |
Create, |
IsUDPSocket, |
Bind, |
+ GetBoundAddress, |
RecvFrom, |
GetRecvFromAddress, |
SendTo, |