OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_DISPATCHER_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_DISPATCHER_HOST_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "content/common/p2p_sockets.h" | 10 #include "content/common/p2p_sockets.h" |
11 #include "content/public/browser/browser_message_filter.h" | 11 #include "content/public/browser/browser_message_filter.h" |
12 #include "net/base/ip_endpoint.h" | 12 #include "net/base/ip_endpoint.h" |
13 #include "net/base/network_change_notifier.h" | 13 #include "net/base/network_change_notifier.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 | 16 |
17 class P2PSocketHost; | 17 class P2PSocketHost; |
18 class ResourceContext; | 18 class ResourceContext; |
19 | 19 |
20 class P2PSocketDispatcherHost | 20 class P2PSocketDispatcherHost |
21 : public content::BrowserMessageFilter, | 21 : public content::BrowserMessageFilter, |
22 public net::NetworkChangeNotifier::IPAddressObserver { | 22 public net::NetworkChangeNotifier::IPAddressObserver { |
23 public: | 23 public: |
24 P2PSocketDispatcherHost(const content::ResourceContext* resource_context); | 24 P2PSocketDispatcherHost(content::ResourceContext* resource_context); |
25 virtual ~P2PSocketDispatcherHost(); | 25 virtual ~P2PSocketDispatcherHost(); |
26 | 26 |
27 // content::BrowserMessageFilter overrides. | 27 // content::BrowserMessageFilter overrides. |
28 virtual void OnChannelClosing() OVERRIDE; | 28 virtual void OnChannelClosing() OVERRIDE; |
29 virtual void OnDestruct() const OVERRIDE; | 29 virtual void OnDestruct() const OVERRIDE; |
30 virtual bool OnMessageReceived(const IPC::Message& message, | 30 virtual bool OnMessageReceived(const IPC::Message& message, |
31 bool* message_was_ok) OVERRIDE; | 31 bool* message_was_ok) OVERRIDE; |
32 | 32 |
33 // net::NetworkChangeNotifier::IPAddressObserver interface. | 33 // net::NetworkChangeNotifier::IPAddressObserver interface. |
34 virtual void OnIPAddressChanged() OVERRIDE; | 34 virtual void OnIPAddressChanged() OVERRIDE; |
(...skipping 27 matching lines...) Expand all Loading... |
62 const net::IPEndPoint& socket_address, | 62 const net::IPEndPoint& socket_address, |
63 const std::vector<char>& data); | 63 const std::vector<char>& data); |
64 void OnDestroySocket(const IPC::Message& msg, int socket_id); | 64 void OnDestroySocket(const IPC::Message& msg, int socket_id); |
65 | 65 |
66 void DoGetNetworkList(); | 66 void DoGetNetworkList(); |
67 void SendNetworkList(const net::NetworkInterfaceList& list); | 67 void SendNetworkList(const net::NetworkInterfaceList& list); |
68 | 68 |
69 void OnAddressResolved(DnsRequest* request, | 69 void OnAddressResolved(DnsRequest* request, |
70 const net::IPAddressNumber& result); | 70 const net::IPAddressNumber& result); |
71 | 71 |
72 const content::ResourceContext* resource_context_; | 72 content::ResourceContext* resource_context_; |
73 | 73 |
74 SocketsMap sockets_; | 74 SocketsMap sockets_; |
75 | 75 |
76 bool monitoring_networks_; | 76 bool monitoring_networks_; |
77 | 77 |
78 // List or routing IDs for the hosts that have subscribed to the | 78 // List or routing IDs for the hosts that have subscribed to the |
79 // network list notifications. | 79 // network list notifications. |
80 std::set<int> notifications_routing_ids_; | 80 std::set<int> notifications_routing_ids_; |
81 | 81 |
82 std::set<DnsRequest*> dns_requests_; | 82 std::set<DnsRequest*> dns_requests_; |
83 | 83 |
84 DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcherHost); | 84 DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcherHost); |
85 }; | 85 }; |
86 | 86 |
87 } // namespace content | 87 } // namespace content |
88 | 88 |
89 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_DISPATCHER_HOST_H_ | 89 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_DISPATCHER_HOST_H_ |
OLD | NEW |