Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(632)

Unified Diff: content/browser/renderer_host/p2p_socket_host_udp.h

Issue 6800023: Security restrictions for P2P UDP Sockets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..2fd300ed5947e8851b6912ae963fd10a8b63817c 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 <set>
#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);
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_;
« no previous file with comments | « content/browser/renderer_host/p2p_socket_host.cc ('k') | content/browser/renderer_host/p2p_socket_host_udp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698