Make PepperUdpSocketMessageFilter use NetworkService UDP API.

This CL moves all of the logic over to the UI thread, to keep things
relatively simple and minimize thread hops, since that's where core
network service objects live.

It also fixes a pre-existing bug in the PPAPI UDP code, where read
errors that occur when there's no pending read are converted into
0-byte read successes.

This is a reland of https://chromium-review.googlesource.com/1171568,
which was reverted due to tests failing on OSX when broadcast was set
only after calling Bind, due to the Bind call failing. The new CL
uses a new UDPSocketOption to allow broadcast before calling Bind on
the underlying socket.

TBR=jam@chromium.org, rhalvati@chromium.org

Bug: 848078, 876824
Change-Id: I0e31a357eb4b80bb78bae32f2a3ea3ce331256ec
Cq-Include-Trybots: luci.chromium.try:linux_mojo
Reviewed-on: https://chromium-review.googlesource.com/1190407
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#586497}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 80c224c08e567070336c4762f8a56d405c134929
5 files changed