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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 : BrowserMessageFilter(P2PMsgStart), | 115 : BrowserMessageFilter(P2PMsgStart), |
116 resource_context_(resource_context), | 116 resource_context_(resource_context), |
117 url_context_(url_context), | 117 url_context_(url_context), |
118 monitoring_networks_(false), | 118 monitoring_networks_(false), |
119 dump_incoming_rtp_packet_(false), | 119 dump_incoming_rtp_packet_(false), |
120 dump_outgoing_rtp_packet_(false) { | 120 dump_outgoing_rtp_packet_(false) { |
121 } | 121 } |
122 | 122 |
123 void P2PSocketDispatcherHost::OnChannelClosing() { | 123 void P2PSocketDispatcherHost::OnChannelClosing() { |
124 // Since the IPC sender is gone, close pending connections. | 124 // Since the IPC sender is gone, close pending connections. |
125 STLDeleteContainerPairSecondPointers(sockets_.begin(), sockets_.end()); | 125 base::STLDeleteContainerPairSecondPointers(sockets_.begin(), sockets_.end()); |
126 sockets_.clear(); | 126 sockets_.clear(); |
127 | 127 |
128 STLDeleteContainerPointers(dns_requests_.begin(), dns_requests_.end()); | 128 base::STLDeleteContainerPointers(dns_requests_.begin(), dns_requests_.end()); |
129 dns_requests_.clear(); | 129 dns_requests_.clear(); |
130 | 130 |
131 if (monitoring_networks_) { | 131 if (monitoring_networks_) { |
132 net::NetworkChangeNotifier::RemoveIPAddressObserver(this); | 132 net::NetworkChangeNotifier::RemoveIPAddressObserver(this); |
133 monitoring_networks_ = false; | 133 monitoring_networks_ = false; |
134 } | 134 } |
135 } | 135 } |
136 | 136 |
137 void P2PSocketDispatcherHost::OnDestruct() const { | 137 void P2PSocketDispatcherHost::OnDestruct() const { |
138 BrowserThread::DeleteOnIOThread::Destruct(this); | 138 BrowserThread::DeleteOnIOThread::Destruct(this); |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 | 414 |
415 if (!dump_incoming_rtp_packet_ && !dump_outgoing_rtp_packet_) | 415 if (!dump_incoming_rtp_packet_ && !dump_outgoing_rtp_packet_) |
416 packet_callback_.Reset(); | 416 packet_callback_.Reset(); |
417 | 417 |
418 for (SocketsMap::iterator it = sockets_.begin(); it != sockets_.end(); ++it) | 418 for (SocketsMap::iterator it = sockets_.begin(); it != sockets_.end(); ++it) |
419 it->second->StopRtpDump(incoming, outgoing); | 419 it->second->StopRtpDump(incoming, outgoing); |
420 } | 420 } |
421 } | 421 } |
422 | 422 |
423 } // namespace content | 423 } // namespace content |
OLD | NEW |