Add support for multicast in PPB_UDPSocket API
commit8171d46410b1ea937b0ae59577b9b36ed151149a
authoreduardo.lima <eduardo.lima@intel.com>
Fri, 13 Mar 2015 15:40:21 +0000 (13 08:40 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 13 Mar 2015 15:41:01 +0000 (13 15:41 +0000)
tree24bb98ab89f255ac337f9d584de264f931570bf3
parentfe37dca5b311cf194493669f26ddee27d60cc667
Add support for multicast in PPB_UDPSocket API

This change introduces two new values to be used with SetOption(), to
set up the behavior of the multicast packets:

 - PP_UDPSOCKET_OPTION_MULTICAST_LOOP (Boolean)

   Whether packets sent from the host to the multicast group will be
   looped back to the host or not.

 - PP_UDPSOCKET_OPTION_MULTICAST_TTL (Integer)

   Sets time-to-live of multicast packets sent to the multicast group.

It also introduces two new functions JoinGroup() and LeaveGroup(), both
of them expecting the address of the multicast group as specified by
the PPB_NetAddress API. These two functions should only be called after
the socket is bound.

This CL adds specific test cases to browser_tests in order to exercise
the different versions of the SetOption function. For this reason, the
PPAPI UDPSocket tests were split into multiple tests, instead of a
single one that enclosed all of them. This way we get clearer
information about the results of each test.

BUG=430939
TEST=browser_tests
NOPRESUBMIT=true

Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
Review URL: https://codereview.chromium.org/704133005

Cr-Commit-Position: refs/heads/master@{#320504}
21 files changed:
chrome/test/ppapi/ppapi_browsertest.cc
content/browser/renderer_host/pepper/pepper_udp_socket_message_filter.cc
content/browser/renderer_host/pepper/pepper_udp_socket_message_filter.h
ppapi/api/ppb_udp_socket.idl
ppapi/c/ppb_udp_socket.h
ppapi/cpp/udp_socket.cc
ppapi/cpp/udp_socket.h
ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
ppapi/proxy/ppapi_messages.h
ppapi/proxy/udp_socket_resource.cc
ppapi/proxy/udp_socket_resource.h
ppapi/proxy/udp_socket_resource_base.cc
ppapi/proxy/udp_socket_resource_base.h
ppapi/shared_impl/private/net_address_private_impl.cc
ppapi/shared_impl/private/net_address_private_impl.h
ppapi/tests/test_udp_socket.cc
ppapi/tests/test_udp_socket.h
ppapi/thunk/interfaces_ppb_public_dev_channel.h
ppapi/thunk/ppb_udp_socket_api.h
ppapi/thunk/ppb_udp_socket_thunk.cc
tools/metrics/histograms/histograms.xml