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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 const net::IPEndPoint& remote_address) { | 190 const net::IPEndPoint& remote_address) { |
191 if (LookupSocket(socket_id)) { | 191 if (LookupSocket(socket_id)) { |
192 LOG(ERROR) << "Received P2PHostMsg_CreateSocket for socket " | 192 LOG(ERROR) << "Received P2PHostMsg_CreateSocket for socket " |
193 "that already exists."; | 193 "that already exists."; |
194 return; | 194 return; |
195 } | 195 } |
196 | 196 |
197 scoped_ptr<P2PSocketHost> socket( | 197 scoped_ptr<P2PSocketHost> socket( |
198 P2PSocketHost::Create(this, socket_id, type)); | 198 P2PSocketHost::Create(this, socket_id, type)); |
199 | 199 |
200 if (!socket.get()) { | 200 if (!socket) { |
201 Send(new P2PMsg_OnError(socket_id)); | 201 Send(new P2PMsg_OnError(socket_id)); |
202 return; | 202 return; |
203 } | 203 } |
204 | 204 |
205 if (socket->Init(local_address, remote_address)) { | 205 if (socket->Init(local_address, remote_address)) { |
206 sockets_[socket_id] = socket.release(); | 206 sockets_[socket_id] = socket.release(); |
207 } | 207 } |
208 } | 208 } |
209 | 209 |
210 void P2PSocketDispatcherHost::OnAcceptIncomingTcpConnection( | 210 void P2PSocketDispatcherHost::OnAcceptIncomingTcpConnection( |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 void P2PSocketDispatcherHost::OnAddressResolved( | 260 void P2PSocketDispatcherHost::OnAddressResolved( |
261 DnsRequest* request, | 261 DnsRequest* request, |
262 const net::IPAddressNumber& result) { | 262 const net::IPAddressNumber& result) { |
263 Send(new P2PMsg_GetHostAddressResult(request->request_id(), result)); | 263 Send(new P2PMsg_GetHostAddressResult(request->request_id(), result)); |
264 | 264 |
265 dns_requests_.erase(request); | 265 dns_requests_.erase(request); |
266 delete request; | 266 delete request; |
267 } | 267 } |
268 | 268 |
269 } // namespace content | 269 } // namespace content |
OLD | NEW |