| Index: mojo/services/network/udp_socket_impl.h
|
| diff --git a/mojo/services/network/udp_socket_impl.h b/mojo/services/network/udp_socket_impl.h
|
| index eb63d93d4e6973ea6d6925f482eacca3a7267d74..4e8188369e45c5dbfac505bff0617059ec77e185 100644
|
| --- a/mojo/services/network/udp_socket_impl.h
|
| +++ b/mojo/services/network/udp_socket_impl.h
|
| @@ -13,6 +13,7 @@
|
| #include "net/base/ip_endpoint.h"
|
| #include "net/udp/udp_socket.h"
|
| #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_impl.h"
|
| +#include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h"
|
|
|
| namespace net {
|
| class IOBuffer;
|
| @@ -21,9 +22,11 @@ class IOBufferWithSize;
|
|
|
| namespace mojo {
|
|
|
| -class UDPSocketImpl : public InterfaceImpl<UDPSocket> {
|
| +class UDPSocketImpl : public UDPSocket {
|
| public:
|
| - UDPSocketImpl();
|
| + // The lifetime of a new UDPSocketImpl is bound to the connection associated
|
| + // with |request|.
|
| + explicit UDPSocketImpl(InterfaceRequest<UDPSocket> request);
|
| ~UDPSocketImpl() override;
|
|
|
| // UDPSocket implementation.
|
| @@ -50,6 +53,8 @@ class UDPSocketImpl : public InterfaceImpl<UDPSocket> {
|
| uint32_t requested_size,
|
| const Callback<void(uint32_t)>& callback) override;
|
|
|
| + void SetReceiver(UDPSocketReceiverPtr receiver) override;
|
| +
|
| void ReceiveMore(uint32_t datagram_number) override;
|
|
|
| void SendTo(NetAddressPtr dest_addr,
|
| @@ -85,6 +90,8 @@ class UDPSocketImpl : public InterfaceImpl<UDPSocket> {
|
| return state_ == BOUND || state_ == CONNECTED;
|
| }
|
|
|
| + StrongBinding<UDPSocket> binding_;
|
| +
|
| net::UDPSocket socket_;
|
|
|
| State state_;
|
| @@ -96,8 +103,15 @@ class UDPSocketImpl : public InterfaceImpl<UDPSocket> {
|
| // Non-null when there is a pending SendTo operation on |socket_|.
|
| scoped_refptr<net::IOBufferWithSize> sendto_buffer_;
|
|
|
| + // The address of the pending RecvFrom operation, if any.
|
| net::IPEndPoint recvfrom_address_;
|
|
|
| + // The result code the pending RecvFrom operation, if any.
|
| + int recvfrom_result_;
|
| +
|
| + // The interface which gets data from fulfilled receive requests.
|
| + UDPSocketReceiverPtr receiver_;
|
| +
|
| // How many more packets the client side expects to receive.
|
| size_t remaining_recv_slots_;
|
|
|
|
|