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

Unified Diff: ppapi/shared_impl/private/udp_socket_private_impl.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/shared_impl/private/udp_socket_private_impl.h ('k') | ppapi/tests/test_udp_socket_private.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/private/udp_socket_private_impl.cc
diff --git a/ppapi/shared_impl/private/udp_socket_private_impl.cc b/ppapi/shared_impl/private/udp_socket_private_impl.cc
index 9b509e1f307cf8daf413908e531a4a7b27012ce3..d3e94c1a48391352a3c5696ba18e3e9b953fbd08 100644
--- a/ppapi/shared_impl/private/udp_socket_private_impl.cc
+++ b/ppapi/shared_impl/private/udp_socket_private_impl.cc
@@ -12,6 +12,7 @@
#include "base/bind.h"
#include "base/logging.h"
#include "base/message_loop.h"
+#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_errors.h"
@@ -40,6 +41,25 @@ UDPSocketPrivateImpl::AsPPB_UDPSocket_Private_API() {
return this;
}
+int32_t UDPSocketPrivateImpl::SetSocketFeature(PP_UDPSocketFeature_Private name,
+ PP_Var value) {
+ if (bound_ || closed_)
+ return PP_ERROR_FAILED;
+
+ switch (name) {
+ case PP_UDPSOCKETFEATURE_ADDRESS_REUSE:
+ case PP_UDPSOCKETFEATURE_BROADCAST:
+ if (value.type != PP_VARTYPE_BOOL)
+ return PP_ERROR_BADARGUMENT;
+ SendBoolSocketFeature(static_cast<int32_t>(name),
+ PP_ToBool(value.value.as_bool));
+ break;
+ default:
+ return PP_ERROR_BADARGUMENT;
+ }
+ return PP_OK;
+}
+
int32_t UDPSocketPrivateImpl::Bind(const PP_NetAddress_Private* addr,
scoped_refptr<TrackedCallback> callback) {
if (!addr)
« no previous file with comments | « ppapi/shared_impl/private/udp_socket_private_impl.h ('k') | ppapi/tests/test_udp_socket_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698