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 #include "content/browser/renderer_host/p2p/socket_dispatcher_host.h" | 5 #include "content/browser/renderer_host/p2p/socket_dispatcher_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "content/browser/renderer_host/p2p/socket_host.h" | 9 #include "content/browser/renderer_host/p2p/socket_host.h" |
10 #include "content/common/p2p_messages.h" | 10 #include "content/common/p2p_messages.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 net::URLRequestContextGetter* url_context) | 98 net::URLRequestContextGetter* url_context) |
99 : BrowserMessageFilter(P2PMsgStart), | 99 : BrowserMessageFilter(P2PMsgStart), |
100 resource_context_(resource_context), | 100 resource_context_(resource_context), |
101 url_context_(url_context), | 101 url_context_(url_context), |
102 monitoring_networks_(false), | 102 monitoring_networks_(false), |
103 dump_incoming_rtp_packet_(false), | 103 dump_incoming_rtp_packet_(false), |
104 dump_outgoing_rtp_packet_(false) { | 104 dump_outgoing_rtp_packet_(false) { |
105 } | 105 } |
106 | 106 |
107 void P2PSocketDispatcherHost::OnChannelClosing() { | 107 void P2PSocketDispatcherHost::OnChannelClosing() { |
108 // Since the IPC channel is gone, close pending connections. | 108 // Since the IPC sender is gone, close pending connections. |
109 STLDeleteContainerPairSecondPointers(sockets_.begin(), sockets_.end()); | 109 STLDeleteContainerPairSecondPointers(sockets_.begin(), sockets_.end()); |
110 sockets_.clear(); | 110 sockets_.clear(); |
111 | 111 |
112 STLDeleteContainerPointers(dns_requests_.begin(), dns_requests_.end()); | 112 STLDeleteContainerPointers(dns_requests_.begin(), dns_requests_.end()); |
113 dns_requests_.clear(); | 113 dns_requests_.clear(); |
114 | 114 |
115 if (monitoring_networks_) { | 115 if (monitoring_networks_) { |
116 net::NetworkChangeNotifier::RemoveIPAddressObserver(this); | 116 net::NetworkChangeNotifier::RemoveIPAddressObserver(this); |
117 monitoring_networks_ = false; | 117 monitoring_networks_ = false; |
118 } | 118 } |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 | 346 |
347 if (!dump_incoming_rtp_packet_ && !dump_outgoing_rtp_packet_) | 347 if (!dump_incoming_rtp_packet_ && !dump_outgoing_rtp_packet_) |
348 packet_callback_.Reset(); | 348 packet_callback_.Reset(); |
349 | 349 |
350 for (SocketsMap::iterator it = sockets_.begin(); it != sockets_.end(); ++it) | 350 for (SocketsMap::iterator it = sockets_.begin(); it != sockets_.end(); ++it) |
351 it->second->StopRtpDump(incoming, outgoing); | 351 it->second->StopRtpDump(incoming, outgoing); |
352 } | 352 } |
353 } | 353 } |
354 | 354 |
355 } // namespace content | 355 } // namespace content |
OLD | NEW |