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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 P2PSocketHost* accepted_connection = | 262 P2PSocketHost* accepted_connection = |
263 socket->AcceptIncomingTcpConnection(remote_address, connected_socket_id); | 263 socket->AcceptIncomingTcpConnection(remote_address, connected_socket_id); |
264 if (accepted_connection) { | 264 if (accepted_connection) { |
265 sockets_[connected_socket_id] = accepted_connection; | 265 sockets_[connected_socket_id] = accepted_connection; |
266 } | 266 } |
267 } | 267 } |
268 | 268 |
269 void P2PSocketDispatcherHost::OnSend(int socket_id, | 269 void P2PSocketDispatcherHost::OnSend(int socket_id, |
270 const net::IPEndPoint& socket_address, | 270 const net::IPEndPoint& socket_address, |
271 const std::vector<char>& data, | 271 const std::vector<char>& data, |
272 const talk_base::PacketOptions& options, | 272 const rtc::PacketOptions& options, |
273 uint64 packet_id) { | 273 uint64 packet_id) { |
274 P2PSocketHost* socket = LookupSocket(socket_id); | 274 P2PSocketHost* socket = LookupSocket(socket_id); |
275 if (!socket) { | 275 if (!socket) { |
276 LOG(ERROR) << "Received P2PHostMsg_Send for invalid socket_id."; | 276 LOG(ERROR) << "Received P2PHostMsg_Send for invalid socket_id."; |
277 return; | 277 return; |
278 } | 278 } |
279 | 279 |
280 if (data.size() > kMaximumPacketSize) { | 280 if (data.size() > kMaximumPacketSize) { |
281 LOG(ERROR) << "Received P2PHostMsg_Send with a packet that is too big: " | 281 LOG(ERROR) << "Received P2PHostMsg_Send with a packet that is too big: " |
282 << data.size(); | 282 << data.size(); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 | 346 |
347 if (!dump_incoming_rtp_packet_ && !dump_outgoing_rtp_packet_) | 347 if (!dump_incoming_rtp_packet_ && !dump_outgoing_rtp_packet_) |
348 packet_callback_.Reset(); | 348 packet_callback_.Reset(); |
349 | 349 |
350 for (SocketsMap::iterator it = sockets_.begin(); it != sockets_.end(); ++it) | 350 for (SocketsMap::iterator it = sockets_.begin(); it != sockets_.end(); ++it) |
351 it->second->StopRtpDump(incoming, outgoing); | 351 it->second->StopRtpDump(incoming, outgoing); |
352 } | 352 } |
353 } | 353 } |
354 | 354 |
355 } // namespace content | 355 } // namespace content |
OLD | NEW |