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 // Start or stop the RTP packet header dumping. Must be called on the IO |
| 51 // thread. |
| 52 void StartRtpDump( |
| 53 bool incoming, |
| 54 bool outgoing, |
| 55 const RenderProcessHost::WebRtcRtpPacketCallback& packet_callback); |
| 56 |
| 57 void StopRtpDump(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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 content::ResourceContext* resource_context_; | 100 content::ResourceContext* resource_context_; |
91 scoped_refptr<net::URLRequestContextGetter> url_context_; | 101 scoped_refptr<net::URLRequestContextGetter> url_context_; |
92 | 102 |
93 SocketsMap sockets_; | 103 SocketsMap sockets_; |
94 | 104 |
95 bool monitoring_networks_; | 105 bool monitoring_networks_; |
96 | 106 |
97 std::set<DnsRequest*> dns_requests_; | 107 std::set<DnsRequest*> dns_requests_; |
98 P2PMessageThrottler throttler_; | 108 P2PMessageThrottler throttler_; |
99 | 109 |
| 110 bool dump_incoming_rtp_packet_; |
| 111 bool dump_outgoing_rtp_packet_; |
| 112 RenderProcessHost::WebRtcRtpPacketCallback packet_callback_; |
| 113 |
100 DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcherHost); | 114 DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcherHost); |
101 }; | 115 }; |
102 | 116 |
103 } // namespace content | 117 } // namespace content |
104 | 118 |
105 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_DISPATCHER_HOST_H_ | 119 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_DISPATCHER_HOST_H_ |
OLD | NEW |