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

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

Issue 9398003: Change PPB_NetAddress_Private.GetFamily to return a PP_AddressFamily_Private value instead of uint1… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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_net_address_private.cc
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_net_address_private.cc b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_net_address_private.cc
index bf4989b2a1decebe61a6bf222b5d384d76b5a6b2..557775eeb136bead9308e4b9db6c178c35714620 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_net_address_private.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_net_address_private.cc
@@ -159,15 +159,15 @@ void GetAnyAddress(PP_Bool is_ipv6, PP_NetAddress_Private* addr) {
NaClSrpcErrorString(srpc_result));
}
-uint16_t GetFamily(const PP_NetAddress_Private* addr) {
+PP_NetAddressFamily_Private GetFamily(const PP_NetAddress_Private* addr) {
DebugPrintf("PPB_NetAddress_Private::GetFamily\n");
nacl_abi_size_t addr_bytes =
static_cast<nacl_abi_size_t>(sizeof(PP_NetAddress_Private));
char* const raw_addr =
reinterpret_cast<char*>(const_cast<PP_NetAddress_Private*>(addr));
- int32_t addr_family;
+ int32_t addr_family = PP_NETADDRESSFAMILY_UNSPECIFIED;
NaClSrpcError srpc_result =
PpbNetAddressPrivateRpcClient::PPB_NetAddress_Private_GetFamily(
GetMainSrpcChannel(),
@@ -177,7 +177,9 @@ uint16_t GetFamily(const PP_NetAddress_Private* addr) {
DebugPrintf("PPB_NetAddress_Private::GetFamily: %s\n",
NaClSrpcErrorString(srpc_result));
- return static_cast<uint16_t>(static_cast<uint32_t>(addr_family));
+ if (srpc_result == NACL_SRPC_RESULT_OK)
+ return static_cast<PP_NetAddressFamily_Private>(addr_family);
+ return PP_NETADDRESSFAMILY_UNSPECIFIED;
}
uint16_t GetPort(const PP_NetAddress_Private* addr) {

Powered by Google App Engine
This is Rietveld 408576698