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

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

Issue 9235035: Add getter methods for sockaddr. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Fixing errors found by review system. Created 8 years, 11 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/browser_ppb_net_address_private_rpc_server.cc
===================================================================
--- ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_net_address_private_rpc_server.cc (revision 119128)
+++ ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_net_address_private_rpc_server.cc (working copy)
@@ -177,3 +177,76 @@
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::Port\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) {
+ NaClSrpcClosureRunner runner(done);
+ rpc->result = NACL_SRPC_RESULT_APP_ERROR;
+
+ if (addr_bytes !=
+ static_cast<nacl_abi_size_t>(sizeof(PP_NetAddress_Private))) {
+ return;
+ }
+
+ DebugPrintf("PPB_NetAddress_Private::GetAddress");
+
+ if (!PPBNetAddressPrivateInterface()->GetAddress(
+ reinterpret_cast<PP_NetAddress_Private*>(addr),
+ address,
+ static_cast<uint16_t>(*address_bytes)))
+ return;
+
+ rpc->result = NACL_SRPC_RESULT_OK;
+}
+

Powered by Google App Engine
This is Rietveld 408576698