| 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "content/browser/renderer_host/p2p/socket_host_throttler.h" | 13 #include "content/browser/renderer_host/p2p/socket_host_throttler.h" |
| 14 #include "content/common/p2p_socket_type.h" | 14 #include "content/common/p2p_socket_type.h" |
| 15 #include "content/public/browser/browser_message_filter.h" | 15 #include "content/public/browser/browser_message_filter.h" |
| 16 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
| 17 #include "content/public/browser/render_process_host.h" |
| 17 #include "net/base/ip_endpoint.h" | 18 #include "net/base/ip_endpoint.h" |
| 18 #include "net/base/network_change_notifier.h" | 19 #include "net/base/network_change_notifier.h" |
| 19 | 20 |
| 20 namespace net { | 21 namespace net { |
| 21 class URLRequestContextGetter; | 22 class URLRequestContextGetter; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace talk_base { | 25 namespace talk_base { |
| 25 struct PacketOptions; | 26 struct PacketOptions; |
| 26 } | 27 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 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 // Starts the RTP packet header dumping. Must be called on the IO thread. |
| 51 void StartRtpDump( |
| 52 bool incoming, |
| 53 bool outgoing, |
| 54 const RenderProcessHost::WebRtcRtpPacketCallback& packet_callback); |
| 55 |
| 56 // Stops the RTP packet header dumping. Must be Called on the UI thread. |
| 57 void StopRtpDumpOnUIThread(bool incoming, bool outgoing); |
| 58 |
| 49 protected: | 59 protected: |
| 50 virtual ~P2PSocketDispatcherHost(); | 60 virtual ~P2PSocketDispatcherHost(); |
| 51 | 61 |
| 52 private: | 62 private: |
| 53 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; | 63 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; |
| 54 friend class base::DeleteHelper<P2PSocketDispatcherHost>; | 64 friend class base::DeleteHelper<P2PSocketDispatcherHost>; |
| 55 | 65 |
| 56 typedef std::map<int, P2PSocketHost*> SocketsMap; | 66 typedef std::map<int, P2PSocketHost*> SocketsMap; |
| 57 | 67 |
| 58 class DnsRequest; | 68 class DnsRequest; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 80 uint64 packet_id); | 90 uint64 packet_id); |
| 81 void OnSetOption(int socket_id, P2PSocketOption option, int value); | 91 void OnSetOption(int socket_id, P2PSocketOption option, int value); |
| 82 void OnDestroySocket(int socket_id); | 92 void OnDestroySocket(int socket_id); |
| 83 | 93 |
| 84 void DoGetNetworkList(); | 94 void DoGetNetworkList(); |
| 85 void SendNetworkList(const net::NetworkInterfaceList& list); | 95 void SendNetworkList(const net::NetworkInterfaceList& list); |
| 86 | 96 |
| 87 void OnAddressResolved(DnsRequest* request, | 97 void OnAddressResolved(DnsRequest* request, |
| 88 const net::IPAddressList& addresses); | 98 const net::IPAddressList& addresses); |
| 89 | 99 |
| 100 void StopRtpDumpOnIOThread(bool incoming, bool outgoing); |
| 101 |
| 90 content::ResourceContext* resource_context_; | 102 content::ResourceContext* resource_context_; |
| 91 scoped_refptr<net::URLRequestContextGetter> url_context_; | 103 scoped_refptr<net::URLRequestContextGetter> url_context_; |
| 92 | 104 |
| 93 SocketsMap sockets_; | 105 SocketsMap sockets_; |
| 94 | 106 |
| 95 bool monitoring_networks_; | 107 bool monitoring_networks_; |
| 96 | 108 |
| 97 std::set<DnsRequest*> dns_requests_; | 109 std::set<DnsRequest*> dns_requests_; |
| 98 P2PMessageThrottler throttler_; | 110 P2PMessageThrottler throttler_; |
| 99 | 111 |
| 112 bool dump_incoming_rtp_packet_; |
| 113 bool dump_outgoing_rtp_packet_; |
| 114 RenderProcessHost::WebRtcRtpPacketCallback packet_callback_; |
| 115 |
| 100 DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcherHost); | 116 DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcherHost); |
| 101 }; | 117 }; |
| 102 | 118 |
| 103 } // namespace content | 119 } // namespace content |
| 104 | 120 |
| 105 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_DISPATCHER_HOST_H_ | 121 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_DISPATCHER_HOST_H_ |
| OLD | NEW |