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..b6f8de39b548a825be1bb4df2eb76570a6ef3a1b 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. |
viettrungluu
2012/02/07 23:03:58
Nit: This comment is useless; it's self-evident fr
mtilburg1
2012/02/08 15:27:01
Done.
|
+ if (result == net::OK) { |
viettrungluu
2012/02/07 23:03:58
Nit: Other single-line if statements in the file d
mtilburg1
2012/02/08 15:27:01
Done.
|
+ socket_->GetLocalAddress(&bound_address_); |
+ } |
+ |
SendBindACK(result == net::OK); |
} |
@@ -106,8 +111,12 @@ void PepperUDPSocket::SendSendToACKError() { |
} |
void PepperUDPSocket::SendBindACK(bool result) { |
+ PP_NetAddress_Private addr = NetAddressPrivateImpl::kInvalidNetAddress; |
+ if (!NetAddressPrivateImpl::IPEndPointToNetAddress(bound_address_, &addr)) |
viettrungluu
2012/02/07 23:03:58
Shouldn't you do some other cleanup here, rather t
mtilburg1
2012/02/08 15:27:01
Changed to be consistant with GetRecvFromACKError.
|
+ result = false; |
+ |
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) { |