Index: content/browser/renderer_host/pepper_udp_socket.cc |
diff --git a/content/browser/renderer_host/pepper_udp_socket.cc b/content/browser/renderer_host/pepper_udp_socket.cc |
index 33f2c7f0c17199eef6e047f4680cc5ea250c975b..b82d2e7de407cacc8612b8602dd2d94c89479717 100644 |
--- a/content/browser/renderer_host/pepper_udp_socket.cc |
+++ b/content/browser/renderer_host/pepper_udp_socket.cc |
@@ -49,6 +49,11 @@ void PepperUDPSocket::Bind(const PP_NetAddress_Private& addr) { |
int result = socket_->Listen(address); |
+ // If we are successful, get the local address we bound to. |
+ if (result == net::OK) { |
+ socket_->GetLocalAddress(&bound_address_); |
+ } |
+ |
SendBindACK(result == net::OK); |
} |
@@ -106,8 +111,11 @@ void PepperUDPSocket::SendSendToACKError() { |
} |
void PepperUDPSocket::SendBindACK(bool result) { |
+ PP_NetAddress_Private addr = NetAddressPrivateImpl::kInvalidNetAddress; |
+ NetAddressPrivateImpl::IPEndPointToNetAddress(bound_address_, &addr); |
yzshen1
2012/02/06 06:51:27
nit: please check for failure as OnRecvFromComplet
mtilburg1
2012/02/06 15:11:35
Done.
|
+ |
manager_->Send(new PpapiMsg_PPBUDPSocket_BindACK( |
- routing_id_, plugin_dispatcher_id_, socket_id_, result)); |
+ routing_id_, plugin_dispatcher_id_, socket_id_, result, addr)); |
} |
void PepperUDPSocket::OnRecvFromCompleted(int result) { |