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

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

Issue 10735056: AllowBroadcast() is exposed to NaCl. (Closed) Base URL: http://git.chromium.org/chromium/src.git@udp_broadcast
Patch Set: Sync. Created 8 years, 4 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/udp_socket_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_udp_socket_private_rpc_server.cc
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_udp_socket_private_rpc_server.cc b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_udp_socket_private_rpc_server.cc
index 11bd80c7f251f6f55d85ff6f8920934584f8444c..2137e5d18080e774169173e7704b3821c6596271 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_udp_socket_private_rpc_server.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_udp_socket_private_rpc_server.cc
@@ -10,6 +10,7 @@
#include "native_client/src/include/nacl_macros.h"
#include "native_client/src/shared/ppapi_proxy/browser_callback.h"
#include "native_client/src/shared/ppapi_proxy/browser_globals.h"
+#include "native_client/src/shared/ppapi_proxy/object_serialize.h"
#include "native_client/src/shared/ppapi_proxy/utility.h"
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_errors.h"
@@ -18,6 +19,7 @@
using ppapi_proxy::DebugPrintf;
using ppapi_proxy::DeleteRemoteCallbackInfo;
+using ppapi_proxy::DeserializeTo;
using ppapi_proxy::MakeRemoteCompletionCallback;
using ppapi_proxy::PPBUDPSocketPrivateInterface;
@@ -54,6 +56,39 @@ void PpbUDPSocketPrivateRpcServer::PPB_UDPSocket_Private_IsUDPSocket(
"is_udp_socket=%d\n", *is_udp_socket);
}
+void PpbUDPSocketPrivateRpcServer::PPB_UDPSocket_Private_SetSocketFeature(
+ NaClSrpcRpc* rpc,
+ NaClSrpcClosure* done,
+ // inputs
+ PP_Resource udp_socket,
+ int32_t name,
+ nacl_abi_size_t value_bytes, char* value,
+ // output
+ int32_t* pp_error) {
+ NaClSrpcClosureRunner runner(done);
+ rpc->result = NACL_SRPC_RESULT_APP_ERROR;
+
+ if (name < 0 || name >= PP_UDPSOCKETFEATURE_COUNT) {
+ *pp_error = PP_ERROR_BADARGUMENT;
+ rpc->result = NACL_SRPC_RESULT_OK;
+ return;
+ }
+
+ PP_Var pp_value = PP_MakeUndefined();
+ if (!DeserializeTo(value, value_bytes, 1, &pp_value))
+ return;
+
+ *pp_error = PPBUDPSocketPrivateInterface()->SetSocketFeature(
+ udp_socket,
+ static_cast<PP_UDPSocketFeature_Private>(name),
+ pp_value);
+
+ DebugPrintf("PPB_UDPSocket_Private::SetSocketFeature: "
+ "pp_error=%"NACL_PRId32"\n", *pp_error);
+
+ rpc->result = NACL_SRPC_RESULT_OK;
+}
+
void PpbUDPSocketPrivateRpcServer::PPB_UDPSocket_Private_Bind(
NaClSrpcRpc* rpc,
NaClSrpcClosure* done,
« no previous file with comments | « ppapi/cpp/private/udp_socket_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