Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(513)

Unified Diff: ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_udp_socket_private.cc

Issue 9212047: Add GetBoundAddress to PPB_UDPSocket_Private (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: fix build error after rebase Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..d690d5d6f554500d617d4d16ae0f94fd57411473 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", "
@@ -196,15 +220,29 @@ void Close(PP_Resource udp_socket) {
} // namespace
-const PPB_UDPSocket_Private* PluginUDPSocketPrivate::GetInterface() {
- static const PPB_UDPSocket_Private udpsocket_private_interface = {
+const PPB_UDPSocket_Private_0_2* PluginUDPSocketPrivate::GetInterface0_2() {
+ static const PPB_UDPSocket_Private_0_2 udpsocket_private_interface = {
+ Create,
+ IsUDPSocket,
+ Bind,
+ RecvFrom,
+ GetRecvFromAddress,
+ SendTo,
+ Close
+ };
+ return &udpsocket_private_interface;
+}
+
+const PPB_UDPSocket_Private_0_3* PluginUDPSocketPrivate::GetInterface0_3() {
+ static const PPB_UDPSocket_Private_0_3 udpsocket_private_interface = {
Create,
IsUDPSocket,
Bind,
+ GetBoundAddress,
RecvFrom,
GetRecvFromAddress,
SendTo,
- Close,
+ Close
};
return &udpsocket_private_interface;
}

Powered by Google App Engine
This is Rietveld 408576698