Chromium Code Reviews| Index: content/browser/renderer_host/p2p_socket_host_udp.h |
| diff --git a/content/browser/renderer_host/p2p_socket_host_udp.h b/content/browser/renderer_host/p2p_socket_host_udp.h |
| index ba5742767324764bccbadf457f58103ee56617e4..fe0467ede19e25ecb655c687ae733502c0cdb94a 100644 |
| --- a/content/browser/renderer_host/p2p_socket_host_udp.h |
| +++ b/content/browser/renderer_host/p2p_socket_host_udp.h |
| @@ -5,29 +5,36 @@ |
| #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_UDP_H_ |
| #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_UDP_H_ |
| -#include "content/common/p2p_sockets.h" |
| +#include <map> |
|
Alpha Left Google
2011/04/09 00:44:32
#include <set> ?
Sergey Ulanov
2011/04/09 00:52:36
Done.
|
| #include "base/message_loop.h" |
| #include "content/browser/renderer_host/p2p_socket_host.h" |
| +#include "content/common/p2p_sockets.h" |
| +#include "net/base/ip_endpoint.h" |
| #include "net/udp/udp_server_socket.h" |
| class P2PSocketHostUdp : public P2PSocketHost { |
| public: |
| - P2PSocketHostUdp(P2PSocketsHost* host, int routing_id, int id); |
| + P2PSocketHostUdp(IPC::Message::Sender* message_sender, |
| + int routing_id, int id); |
|
Alpha Left Google
2011/04/09 00:44:32
nit: indentation.
Sergey Ulanov
2011/04/09 00:52:36
Looks correct to me
|
| virtual ~P2PSocketHostUdp(); |
| // P2PSocketHost overrides. |
| virtual bool Init(const net::IPEndPoint& local_address) OVERRIDE; |
| - virtual void Send(const net::IPEndPoint& socket_address, |
| + virtual void Send(const net::IPEndPoint& to, |
| const std::vector<char>& data) OVERRIDE; |
| private: |
| + friend class P2PSocketHostUdpTest; |
| + |
| enum State { |
| STATE_UNINITIALIZED, |
| STATE_OPEN, |
| STATE_ERROR, |
| }; |
| + typedef std::set<net::IPEndPoint> AuthorizedPeerSet; |
| + |
| void OnError(); |
| void DoRead(); |
| void DidCompleteRead(int result); |
| @@ -42,6 +49,10 @@ class P2PSocketHostUdp : public P2PSocketHost { |
| net::IPEndPoint recv_address_; |
| bool send_pending_; |
| + // Set of peer for which we have received STUN binding request or |
| + // response. |
| + AuthorizedPeerSet authorized_peers_; |
| + |
| net::CompletionCallbackImpl<P2PSocketHostUdp> recv_callback_; |
| net::CompletionCallbackImpl<P2PSocketHostUdp> send_callback_; |