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

Unified Diff: ppapi/proxy/udp_socket_resource.cc

Issue 704133005: Pepper: Add support for multicast in PPB_UDPSocket API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore mistakenly removed lines Created 5 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/proxy/udp_socket_resource.cc
diff --git a/ppapi/proxy/udp_socket_resource.cc b/ppapi/proxy/udp_socket_resource.cc
index d815b9fa62f5b77d2765ea85a07f2b793f386ba6..25a0f880c28bfba4b5d84b7fcea60241696cb107 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

Powered by Google App Engine
This is Rietveld 408576698