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

Unified Diff: content/renderer/p2p/socket_dispatcher.h

Issue 7599003: Add IPC for DNS host address resolution. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 4 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
« no previous file with comments | « content/renderer/p2p/host_address_request.cc ('k') | content/renderer/p2p/socket_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/p2p/socket_dispatcher.h
diff --git a/content/renderer/p2p/socket_dispatcher.h b/content/renderer/p2p/socket_dispatcher.h
index c4b71cd57a8df7b3cadd6e160874bd860c1e878c..3dbc49dd288b519eac8b301417d73403b8a7f061 100644
--- a/content/renderer/p2p/socket_dispatcher.h
+++ b/content/renderer/p2p/socket_dispatcher.h
@@ -27,13 +27,20 @@
#include "base/observer_list_threadsafe.h"
#include "base/synchronization/lock.h"
#include "content/common/p2p_sockets.h"
-#include "content/renderer/p2p/socket_client.h"
#include "content/renderer/render_view_observer.h"
+#include "net/base/net_util.h"
namespace base {
class MessageLoopProxy;
} // namespace base
+namespace net {
+class IPEndPoint;
+} // namespace net
+
+class P2PHostAddressRequest;
+class P2PSocketClient;
+
// P2PSocketDispatcher works on the renderer thread. It dispatches all
// messages on that thread, and all its methods must be called on the
// same thread.
@@ -68,16 +75,24 @@ class P2PSocketDispatcher : public RenderViewObserver {
virtual bool OnMessageReceived(const IPC::Message& message);
private:
+ friend class P2PHostAddressRequest;
friend class P2PSocketClient;
+ base::MessageLoopProxy* message_loop();
+
// Called by P2PSocketClient.
int RegisterClient(P2PSocketClient* client);
void UnregisterClient(int id);
void SendP2PMessage(IPC::Message* msg);
- base::MessageLoopProxy* message_loop();
+
+ // Called by DnsRequest.
+ int RegisterHostAddressRequest(P2PHostAddressRequest* request);
+ void UnregisterHostAddressRequest(int id);
// Incoming message handlers.
void OnNetworkListChanged(const net::NetworkInterfaceList& networks);
+ void OnGetHostAddressResult(int32 request_id,
+ const net::IPAddressNumber& address);
void OnSocketCreated(int socket_id, const net::IPEndPoint& address);
void OnIncomingTcpConnection(int socket_id, const net::IPEndPoint& address);
void OnError(int socket_id);
@@ -89,6 +104,8 @@ class P2PSocketDispatcher : public RenderViewObserver {
scoped_refptr<base::MessageLoopProxy> message_loop_;
IDMap<P2PSocketClient> clients_;
+ IDMap<P2PHostAddressRequest> host_address_requests_;
+
bool network_notifications_started_;
scoped_refptr<ObserverListThreadSafe<NetworkListObserver> >
network_list_observers_;
« no previous file with comments | « content/renderer/p2p/host_address_request.cc ('k') | content/renderer/p2p/socket_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698