| 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/renderer/p2p/socket_dispatcher.h" | 5 #include "content/renderer/p2p/socket_dispatcher.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "content/child/child_process.h" | 9 #include "content/child/child_process.h" |
| 10 #include "content/common/p2p_messages.h" | 10 #include "content/common/p2p_messages.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 DCHECK(ipc_task_runner_->BelongsToCurrentThread()); | 117 DCHECK(ipc_task_runner_->BelongsToCurrentThread()); |
| 118 return host_address_requests_.Add(request); | 118 return host_address_requests_.Add(request); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void P2PSocketDispatcher::UnregisterHostAddressRequest(int id) { | 121 void P2PSocketDispatcher::UnregisterHostAddressRequest(int id) { |
| 122 DCHECK(ipc_task_runner_->BelongsToCurrentThread()); | 122 DCHECK(ipc_task_runner_->BelongsToCurrentThread()); |
| 123 host_address_requests_.Remove(id); | 123 host_address_requests_.Remove(id); |
| 124 } | 124 } |
| 125 | 125 |
| 126 void P2PSocketDispatcher::OnNetworkListChanged( | 126 void P2PSocketDispatcher::OnNetworkListChanged( |
| 127 const net::NetworkInterfaceList& networks) { | 127 const net::NetworkInterfaceList& networks, |
| 128 const net::IPAddressNumber& default_ipv4_local_address, |
| 129 const net::IPAddressNumber& default_ipv6_local_address) { |
| 128 network_list_observers_->Notify( | 130 network_list_observers_->Notify( |
| 129 FROM_HERE, &NetworkListObserver::OnNetworkListChanged, networks); | 131 FROM_HERE, &NetworkListObserver::OnNetworkListChanged, networks, |
| 132 default_ipv4_local_address, default_ipv6_local_address); |
| 130 } | 133 } |
| 131 | 134 |
| 132 void P2PSocketDispatcher::OnGetHostAddressResult( | 135 void P2PSocketDispatcher::OnGetHostAddressResult( |
| 133 int32 request_id, | 136 int32 request_id, |
| 134 const net::IPAddressList& addresses) { | 137 const net::IPAddressList& addresses) { |
| 135 P2PAsyncAddressResolver* request = host_address_requests_.Lookup(request_id); | 138 P2PAsyncAddressResolver* request = host_address_requests_.Lookup(request_id); |
| 136 if (!request) { | 139 if (!request) { |
| 137 DVLOG(1) << "Received P2P message for socket that doesn't exist."; | 140 DVLOG(1) << "Received P2P message for socket that doesn't exist."; |
| 138 return; | 141 return; |
| 139 } | 142 } |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 // hasn't processed the close message by the time it sends the | 195 // hasn't processed the close message by the time it sends the |
| 193 // message to the renderer. | 196 // message to the renderer. |
| 194 DVLOG(1) << "Received P2P message for socket that doesn't exist."; | 197 DVLOG(1) << "Received P2P message for socket that doesn't exist."; |
| 195 return NULL; | 198 return NULL; |
| 196 } | 199 } |
| 197 | 200 |
| 198 return client; | 201 return client; |
| 199 } | 202 } |
| 200 | 203 |
| 201 } // namespace content | 204 } // namespace content |
| OLD | NEW |