diff options
Diffstat (limited to 'ppapi/proxy/udp_socket_resource.cc')
-rw-r--r-- | ppapi/proxy/udp_socket_resource.cc | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/ppapi/proxy/udp_socket_resource.cc b/ppapi/proxy/udp_socket_resource.cc index d815b9f..25a0f88 100644 --- a/ppapi/proxy/udp_socket_resource.cc +++ b/ppapi/proxy/udp_socket_resource.cc @@ -79,11 +79,26 @@ int32_t UDPSocketResource::SetOption1_0( PP_UDPSocket_Option name, const PP_Var& value, scoped_refptr<TrackedCallback> callback) { + if (name > PP_UDPSOCKET_OPTION_RECV_BUFFER_SIZE) + return PP_ERROR_BADARGUMENT; + return SetOptionImpl(name, value, true, // Check bind() state. callback); } +int32_t UDPSocketResource::SetOption1_1( + PP_UDPSocket_Option name, + const PP_Var& value, + scoped_refptr<TrackedCallback> callback) { + if (name > PP_UDPSOCKET_OPTION_RECV_BUFFER_SIZE) + return PP_ERROR_BADARGUMENT; + + return SetOptionImpl(name, value, + false, // Check bind() state. + callback); +} + int32_t UDPSocketResource::SetOption( PP_UDPSocket_Option name, const PP_Var& value, @@ -93,5 +108,27 @@ int32_t UDPSocketResource::SetOption( callback); } +int32_t UDPSocketResource::JoinGroup( + PP_Resource group, + scoped_refptr<TrackedCallback> callback) { + EnterNetAddressNoLock enter(group, true); + if (enter.failed()) + return PP_ERROR_BADRESOURCE; + + return JoinGroupImpl(&enter.object()->GetNetAddressPrivate(), + callback); +} + +int32_t UDPSocketResource::LeaveGroup( + PP_Resource group, + scoped_refptr<TrackedCallback> callback) { + EnterNetAddressNoLock enter(group, true); + if (enter.failed()) + return PP_ERROR_BADRESOURCE; + + return LeaveGroupImpl(&enter.object()->GetNetAddressPrivate(), + callback); +} + } // namespace proxy } // namespace ppapi |