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

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

Issue 9307115: PPB_NetAddress_Private: add getter methods for sockaddr. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync 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
« no previous file with comments | « ppapi/cpp/private/net_address_private.cc ('k') | ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_net_address_private_rpc_server.cc
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_net_address_private_rpc_server.cc b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_net_address_private_rpc_server.cc
index 55de726b21ccc0f4915d0aeb1f9473bb24625df7..6d355a9473b6de619b8c8e33cb546fa2489ac8b7 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_net_address_private_rpc_server.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_net_address_private_rpc_server.cc
@@ -177,3 +177,77 @@ void PpbNetAddressPrivateRpcServer::PPB_NetAddress_Private_GetAnyAddress(
rpc->result = NACL_SRPC_RESULT_OK;
}
+
+void PpbNetAddressPrivateRpcServer::PPB_NetAddress_Private_GetFamily(
+ NaClSrpcRpc* rpc,
+ NaClSrpcClosure* done,
+ // input
+ nacl_abi_size_t addr_bytes, char* addr,
+ // output
+ int32_t* addr_family) {
+ NaClSrpcClosureRunner runner(done);
+ rpc->result = NACL_SRPC_RESULT_APP_ERROR;
+
+ if (addr_bytes !=
+ static_cast<nacl_abi_size_t>(sizeof(PP_NetAddress_Private))) {
+ return;
+ }
+
+ *addr_family = PPBNetAddressPrivateInterface()->GetFamily(
+ reinterpret_cast<PP_NetAddress_Private*>(addr));
+
+ DebugPrintf("PPB_NetAddress_Private::GetFamily\n");
+
+ rpc->result = NACL_SRPC_RESULT_OK;
+}
+
+void PpbNetAddressPrivateRpcServer::PPB_NetAddress_Private_GetPort(
+ NaClSrpcRpc* rpc,
+ NaClSrpcClosure* done,
+ // input
+ nacl_abi_size_t addr_bytes, char* addr,
+ // output
+ int32_t* port) {
+ NaClSrpcClosureRunner runner(done);
+ rpc->result = NACL_SRPC_RESULT_APP_ERROR;
+
+ if (addr_bytes !=
+ static_cast<nacl_abi_size_t>(sizeof(PP_NetAddress_Private))) {
+ return;
+ }
+
+ *port = PPBNetAddressPrivateInterface()->GetPort(
+ reinterpret_cast<PP_NetAddress_Private*>(addr));
+
+ DebugPrintf("PPB_NetAddress_Private::GetPort\n");
+
+ rpc->result = NACL_SRPC_RESULT_OK;
+}
+
+void PpbNetAddressPrivateRpcServer::PPB_NetAddress_Private_GetAddress(
+ NaClSrpcRpc* rpc,
+ NaClSrpcClosure* done,
+ // input
+ nacl_abi_size_t addr_bytes, char* addr,
+ // output
+ nacl_abi_size_t* address_bytes, char* address,
+ int32_t* success) {
+ NaClSrpcClosureRunner runner(done);
+ rpc->result = NACL_SRPC_RESULT_APP_ERROR;
+
+ if (addr_bytes !=
+ static_cast<nacl_abi_size_t>(sizeof(PP_NetAddress_Private))) {
+ return;
+ }
+
+ PP_Bool pp_success = PPBNetAddressPrivateInterface()->GetAddress(
+ reinterpret_cast<PP_NetAddress_Private*>(addr),
+ address, static_cast<uint16_t>(*address_bytes));
+
+ DebugPrintf("PPB_NetAddress_Private::GetAddress: pp_success=%d\n",
+ pp_success);
+
+ *success = (pp_success == PP_TRUE);
+ rpc->result = NACL_SRPC_RESULT_OK;
+}
+
« no previous file with comments | « ppapi/cpp/private/net_address_private.cc ('k') | ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698