| Index: content/browser/renderer_host/pepper/pepper_udp_socket.cc
|
| ===================================================================
|
| --- content/browser/renderer_host/pepper/pepper_udp_socket.cc (revision 156377)
|
| +++ content/browser/renderer_host/pepper/pepper_udp_socket.cc (working copy)
|
| @@ -50,9 +50,10 @@
|
| void PepperUDPSocket::Bind(const PP_NetAddress_Private& addr) {
|
| socket_.reset(new net::UDPServerSocket(NULL, net::NetLog::Source()));
|
|
|
| - net::IPEndPoint address;
|
| + net::IPAddressNumber address;
|
| + int port;
|
| if (!socket_.get() ||
|
| - !NetAddressPrivateImpl::NetAddressToIPEndPoint(addr, &address)) {
|
| + !NetAddressPrivateImpl::NetAddressToIPEndPoint(addr, &address, &port)) {
|
| SendBindACKError();
|
| return;
|
| }
|
| @@ -62,7 +63,7 @@
|
| if (allow_broadcast_)
|
| socket_->AllowBroadcast();
|
|
|
| - int result = socket_->Listen(address);
|
| + int result = socket_->Listen(net::IPEndPoint(address, port));
|
|
|
| if (result == net::OK &&
|
| socket_->GetLocalAddress(&bound_address_) != net::OK) {
|
| @@ -96,8 +97,9 @@
|
| return;
|
| }
|
|
|
| - net::IPEndPoint address;
|
| - if (!NetAddressPrivateImpl::NetAddressToIPEndPoint(addr, &address)) {
|
| + net::IPAddressNumber address;
|
| + int port;
|
| + if (!NetAddressPrivateImpl::NetAddressToIPEndPoint(addr, &address, &port)) {
|
| SendSendToACKError();
|
| return;
|
| }
|
| @@ -107,7 +109,7 @@
|
| sendto_buffer_ = new net::IOBuffer(data_size);
|
| memcpy(sendto_buffer_->data(), data.data(), data_size);
|
| int result = socket_->SendTo(
|
| - sendto_buffer_, data_size, address,
|
| + sendto_buffer_, data_size, net::IPEndPoint(address, port),
|
| base::Bind(&PepperUDPSocket::OnSendToCompleted, base::Unretained(this)));
|
|
|
| if (result != net::ERR_IO_PENDING)
|
| @@ -135,7 +137,8 @@
|
| void PepperUDPSocket::OnBindCompleted(int result) {
|
| PP_NetAddress_Private addr = NetAddressPrivateImpl::kInvalidNetAddress;
|
| if (result < 0 ||
|
| - !NetAddressPrivateImpl::IPEndPointToNetAddress(bound_address_,
|
| + !NetAddressPrivateImpl::IPEndPointToNetAddress(bound_address_.address(),
|
| + bound_address_.port(),
|
| &addr)) {
|
| SendBindACKError();
|
| } else {
|
| @@ -151,8 +154,10 @@
|
| // to send back.
|
| PP_NetAddress_Private addr = NetAddressPrivateImpl::kInvalidNetAddress;
|
| if (result < 0 ||
|
| - !NetAddressPrivateImpl::IPEndPointToNetAddress(recvfrom_address_,
|
| - &addr)) {
|
| + !NetAddressPrivateImpl::IPEndPointToNetAddress(
|
| + recvfrom_address_.address(),
|
| + recvfrom_address_.port(),
|
| + &addr)) {
|
| SendRecvFromACKError();
|
| } else {
|
| manager_->Send(new PpapiMsg_PPBUDPSocket_RecvFromACK(
|
|
|