| 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_host_tcp.h" | 5 #include "content/browser/renderer_host/p2p/socket_host_tcp.h" |
| 6 | 6 |
| 7 #include "base/sys_byteorder.h" | 7 #include "base/sys_byteorder.h" |
| 8 #include "content/common/p2p_messages.h" | 8 #include "content/common/p2p_messages.h" |
| 9 #include "ipc/ipc_sender.h" | 9 #include "ipc/ipc_sender.h" |
| 10 #include "jingle/glue/fake_ssl_client_socket.h" | 10 #include "jingle/glue/fake_ssl_client_socket.h" |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 << "Terminating connection."; | 259 << "Terminating connection."; |
| 260 OnError(); | 260 OnError(); |
| 261 return; | 261 return; |
| 262 } | 262 } |
| 263 } | 263 } |
| 264 | 264 |
| 265 message_sender_->Send(new P2PMsg_OnDataReceived(id_, remote_address_, data)); | 265 message_sender_->Send(new P2PMsg_OnDataReceived(id_, remote_address_, data)); |
| 266 } | 266 } |
| 267 | 267 |
| 268 void P2PSocketHostTcpBase::Send(const net::IPEndPoint& to, | 268 void P2PSocketHostTcpBase::Send(const net::IPEndPoint& to, |
| 269 const std::vector<char>& data) { | 269 const std::vector<char>& data, |
| 270 net::DiffServCodePoint dscp) { |
| 270 if (!socket_) { | 271 if (!socket_) { |
| 271 // The Send message may be sent after the an OnError message was | 272 // The Send message may be sent after the an OnError message was |
| 272 // sent by hasn't been processed the renderer. | 273 // sent by hasn't been processed the renderer. |
| 273 return; | 274 return; |
| 274 } | 275 } |
| 275 | 276 |
| 276 if (!(to == remote_address_)) { | 277 if (!(to == remote_address_)) { |
| 277 // Renderer should use this socket only to send data to |remote_address_|. | 278 // Renderer should use this socket only to send data to |remote_address_|. |
| 278 NOTREACHED(); | 279 NOTREACHED(); |
| 279 OnError(); | 280 OnError(); |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 } else { | 506 } else { |
| 506 packet_size += kTurnChannelDataHeaderSize; | 507 packet_size += kTurnChannelDataHeaderSize; |
| 507 // Calculate any padding if present. | 508 // Calculate any padding if present. |
| 508 if (packet_size % 4) | 509 if (packet_size % 4) |
| 509 *pad_bytes = 4 - packet_size % 4; | 510 *pad_bytes = 4 - packet_size % 4; |
| 510 } | 511 } |
| 511 return packet_size; | 512 return packet_size; |
| 512 } | 513 } |
| 513 | 514 |
| 514 } // namespace content | 515 } // namespace content |
| OLD | NEW |