| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 namespace content { | 28 namespace content { |
| 29 | 29 |
| 30 class P2PSocketHost; | 30 class P2PSocketHost; |
| 31 class ResourceContext; | 31 class ResourceContext; |
| 32 | 32 |
| 33 class P2PSocketDispatcherHost | 33 class P2PSocketDispatcherHost |
| 34 : public content::BrowserMessageFilter, | 34 : public content::BrowserMessageFilter, |
| 35 public net::NetworkChangeNotifier::IPAddressObserver { | 35 public net::NetworkChangeNotifier::IPAddressObserver { |
| 36 public: | 36 public: |
| 37 P2PSocketDispatcherHost(content::ResourceContext* resource_context, | 37 P2PSocketDispatcherHost(content::ResourceContext* resource_context, |
| 38 net::URLRequestContextGetter* url_context); | 38 net::URLRequestContextGetter* url_context, |
| 39 int render_process_host_id); |
| 39 | 40 |
| 40 // content::BrowserMessageFilter overrides. | 41 // content::BrowserMessageFilter overrides. |
| 41 virtual void OnChannelClosing() OVERRIDE; | 42 virtual void OnChannelClosing() OVERRIDE; |
| 42 virtual void OnDestruct() const OVERRIDE; | 43 virtual void OnDestruct() const OVERRIDE; |
| 43 virtual bool OnMessageReceived(const IPC::Message& message, | 44 virtual bool OnMessageReceived(const IPC::Message& message, |
| 44 bool* message_was_ok) OVERRIDE; | 45 bool* message_was_ok) OVERRIDE; |
| 45 | 46 |
| 46 // net::NetworkChangeNotifier::IPAddressObserver interface. | 47 // net::NetworkChangeNotifier::IPAddressObserver interface. |
| 47 virtual void OnIPAddressChanged() OVERRIDE; | 48 virtual void OnIPAddressChanged() OVERRIDE; |
| 48 | 49 |
| 50 // Start or stop the RTP packet header dumping. Mustbe called on the IO |
| 51 // thread. |
| 52 void StartRtpDump(bool incoming, bool outgoing); |
| 53 void StopRtpDump(bool incoming, bool outgoing); |
| 54 |
| 49 protected: | 55 protected: |
| 50 virtual ~P2PSocketDispatcherHost(); | 56 virtual ~P2PSocketDispatcherHost(); |
| 51 | 57 |
| 52 private: | 58 private: |
| 53 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; | 59 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; |
| 54 friend class base::DeleteHelper<P2PSocketDispatcherHost>; | 60 friend class base::DeleteHelper<P2PSocketDispatcherHost>; |
| 55 | 61 |
| 56 typedef std::map<int, P2PSocketHost*> SocketsMap; | 62 typedef std::map<int, P2PSocketHost*> SocketsMap; |
| 57 | 63 |
| 58 class DnsRequest; | 64 class DnsRequest; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 82 void OnDestroySocket(int socket_id); | 88 void OnDestroySocket(int socket_id); |
| 83 | 89 |
| 84 void DoGetNetworkList(); | 90 void DoGetNetworkList(); |
| 85 void SendNetworkList(const net::NetworkInterfaceList& list); | 91 void SendNetworkList(const net::NetworkInterfaceList& list); |
| 86 | 92 |
| 87 void OnAddressResolved(DnsRequest* request, | 93 void OnAddressResolved(DnsRequest* request, |
| 88 const net::IPAddressList& addresses); | 94 const net::IPAddressList& addresses); |
| 89 | 95 |
| 90 content::ResourceContext* resource_context_; | 96 content::ResourceContext* resource_context_; |
| 91 scoped_refptr<net::URLRequestContextGetter> url_context_; | 97 scoped_refptr<net::URLRequestContextGetter> url_context_; |
| 98 int render_process_host_id_; |
| 92 | 99 |
| 93 SocketsMap sockets_; | 100 SocketsMap sockets_; |
| 94 | 101 |
| 95 bool monitoring_networks_; | 102 bool monitoring_networks_; |
| 96 | 103 |
| 97 std::set<DnsRequest*> dns_requests_; | 104 std::set<DnsRequest*> dns_requests_; |
| 98 P2PMessageThrottler throttler_; | 105 P2PMessageThrottler throttler_; |
| 99 | 106 |
| 107 bool dump_incoming_rtp_packet_; |
| 108 bool dump_outgoing_rtp_packet_; |
| 109 |
| 100 DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcherHost); | 110 DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcherHost); |
| 101 }; | 111 }; |
| 102 | 112 |
| 103 } // namespace content | 113 } // namespace content |
| 104 | 114 |
| 105 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_DISPATCHER_HOST_H_ | 115 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_DISPATCHER_HOST_H_ |
| OLD | NEW |