| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 P2PSocketDispatcherHost::P2PSocketDispatcherHost( | 88 P2PSocketDispatcherHost::P2PSocketDispatcherHost( |
| 89 content::ResourceContext* resource_context, | 89 content::ResourceContext* resource_context, |
| 90 net::URLRequestContextGetter* url_context) | 90 net::URLRequestContextGetter* url_context) |
| 91 : resource_context_(resource_context), | 91 : resource_context_(resource_context), |
| 92 url_context_(url_context), | 92 url_context_(url_context), |
| 93 monitoring_networks_(false) { | 93 monitoring_networks_(false) { |
| 94 } | 94 } |
| 95 | 95 |
| 96 void P2PSocketDispatcherHost::OnChannelClosing() { | 96 void P2PSocketDispatcherHost::OnChannelClosing() { |
| 97 BrowserMessageFilter::OnChannelClosing(); | |
| 98 | |
| 99 // Since the IPC channel is gone, close pending connections. | 97 // Since the IPC channel is gone, close pending connections. |
| 100 STLDeleteContainerPairSecondPointers(sockets_.begin(), sockets_.end()); | 98 STLDeleteContainerPairSecondPointers(sockets_.begin(), sockets_.end()); |
| 101 sockets_.clear(); | 99 sockets_.clear(); |
| 102 | 100 |
| 103 STLDeleteContainerPointers(dns_requests_.begin(), dns_requests_.end()); | 101 STLDeleteContainerPointers(dns_requests_.begin(), dns_requests_.end()); |
| 104 dns_requests_.clear(); | 102 dns_requests_.clear(); |
| 105 | 103 |
| 106 if (monitoring_networks_) { | 104 if (monitoring_networks_) { |
| 107 net::NetworkChangeNotifier::RemoveIPAddressObserver(this); | 105 net::NetworkChangeNotifier::RemoveIPAddressObserver(this); |
| 108 monitoring_networks_ = false; | 106 monitoring_networks_ = false; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 void P2PSocketDispatcherHost::OnAddressResolved( | 256 void P2PSocketDispatcherHost::OnAddressResolved( |
| 259 DnsRequest* request, | 257 DnsRequest* request, |
| 260 const net::IPAddressNumber& result) { | 258 const net::IPAddressNumber& result) { |
| 261 Send(new P2PMsg_GetHostAddressResult(request->request_id(), result)); | 259 Send(new P2PMsg_GetHostAddressResult(request->request_id(), result)); |
| 262 | 260 |
| 263 dns_requests_.erase(request); | 261 dns_requests_.erase(request); |
| 264 delete request; | 262 delete request; |
| 265 } | 263 } |
| 266 | 264 |
| 267 } // namespace content | 265 } // namespace content |
| OLD | NEW |