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

Unified Diff: content/renderer/pepper/pepper_plugin_delegate_impl.cc

Issue 10735056: AllowBroadcast() is exposed to NaCl. (Closed) Base URL: http://git.chromium.org/chromium/src.git@udp_broadcast
Patch Set: Deleted callbacks. 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
Index: content/renderer/pepper/pepper_plugin_delegate_impl.cc
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.cc b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
index 559d97ced328004f6924333b77875f2d0175b763..918ed8bf9e9ae437f00864d701fc1cea0ed1ccbd 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
@@ -24,8 +24,8 @@
#include "content/common/fileapi/file_system_dispatcher.h"
#include "content/common/fileapi/file_system_messages.h"
#include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
-#include "content/common/pepper_plugin_registry.h"
#include "content/common/pepper_messages.h"
+#include "content/common/pepper_plugin_registry.h"
#include "content/common/quota_dispatcher.h"
#include "content/common/view_messages.h"
#include "content/public/common/content_switches.h"
@@ -62,6 +62,7 @@
#include "ipc/ipc_channel_handle.h"
#include "media/video/capture/video_capture_proxy.h"
#include "ppapi/c/dev/pp_video_dev.h"
+#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/private/ppb_flash.h"
#include "ppapi/host/ppapi_host.h"
@@ -85,9 +86,9 @@
#include "ui/gfx/size.h"
#include "webkit/fileapi/file_system_callback_dispatcher.h"
#include "webkit/plugins/npapi/webplugin.h"
-#include "webkit/plugins/ppapi/ppb_file_io_impl.h"
#include "webkit/plugins/ppapi/plugin_module.h"
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
+#include "webkit/plugins/ppapi/ppb_file_io_impl.h"
#include "webkit/plugins/ppapi/ppb_flash_impl.h"
#include "webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h"
#include "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h"
@@ -1146,11 +1147,31 @@ uint32 PepperPluginDelegateImpl::UDPSocketCreate() {
return socket_id;
}
+void PepperPluginDelegateImpl::UDPSocketSetSocketFeature(
+ webkit::ppapi::PPB_UDPSocket_Private_Impl* socket,
+ uint32 socket_id,
+ PP_UDPSocketFeature_Private name,
+ PP_Var value) {
+ switch (name) {
+ case PP_UDPSOCKETFEATURE_ADDRESS_REUSE:
+ case PP_UDPSOCKETFEATURE_BROADCAST:
+ DCHECK_EQ(PP_VARTYPE_BOOL, value.type);
+ render_view_->Send(
+ new PpapiHostMsg_PPBUDPSocket_SetBoolSocketFeature(
+ render_view_->routing_id(), socket_id,
+ static_cast<int32_t>(name), PP_ToBool(value.value.as_bool)));
+ break;
+ default:
+ NOTREACHED();
+ }
+}
+
void PepperPluginDelegateImpl::UDPSocketBind(
webkit::ppapi::PPB_UDPSocket_Private_Impl* socket,
uint32 socket_id,
const PP_NetAddress_Private& addr) {
- udp_sockets_.AddWithID(socket, socket_id);
+ if (!udp_sockets_.Lookup(socket_id))
+ udp_sockets_.AddWithID(socket, socket_id);
render_view_->Send(new PpapiHostMsg_PPBUDPSocket_Bind(
render_view_->routing_id(), socket_id, addr));
}

Powered by Google App Engine
This is Rietveld 408576698