| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 P2PSocketType type, int socket_id, | 184 P2PSocketType type, int socket_id, |
| 185 const net::IPEndPoint& local_address, | 185 const net::IPEndPoint& local_address, |
| 186 const net::IPEndPoint& remote_address) { | 186 const net::IPEndPoint& remote_address) { |
| 187 if (LookupSocket(socket_id)) { | 187 if (LookupSocket(socket_id)) { |
| 188 LOG(ERROR) << "Received P2PHostMsg_CreateSocket for socket " | 188 LOG(ERROR) << "Received P2PHostMsg_CreateSocket for socket " |
| 189 "that already exists."; | 189 "that already exists."; |
| 190 return; | 190 return; |
| 191 } | 191 } |
| 192 | 192 |
| 193 scoped_ptr<P2PSocketHost> socket( | 193 scoped_ptr<P2PSocketHost> socket( |
| 194 P2PSocketHost::Create(this, socket_id, type, url_context_)); | 194 P2PSocketHost::Create(this, socket_id, type, url_context_.get())); |
| 195 | 195 |
| 196 if (!socket) { | 196 if (!socket) { |
| 197 Send(new P2PMsg_OnError(socket_id)); | 197 Send(new P2PMsg_OnError(socket_id)); |
| 198 return; | 198 return; |
| 199 } | 199 } |
| 200 | 200 |
| 201 if (socket->Init(local_address, remote_address)) { | 201 if (socket->Init(local_address, remote_address)) { |
| 202 sockets_[socket_id] = socket.release(); | 202 sockets_[socket_id] = socket.release(); |
| 203 } | 203 } |
| 204 } | 204 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 void P2PSocketDispatcherHost::OnAddressResolved( | 256 void P2PSocketDispatcherHost::OnAddressResolved( |
| 257 DnsRequest* request, | 257 DnsRequest* request, |
| 258 const net::IPAddressNumber& result) { | 258 const net::IPAddressNumber& result) { |
| 259 Send(new P2PMsg_GetHostAddressResult(request->request_id(), result)); | 259 Send(new P2PMsg_GetHostAddressResult(request->request_id(), result)); |
| 260 | 260 |
| 261 dns_requests_.erase(request); | 261 dns_requests_.erase(request); |
| 262 delete request; | 262 delete request; |
| 263 } | 263 } |
| 264 | 264 |
| 265 } // namespace content | 265 } // namespace content |
| OLD | NEW |