| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 << "Terminating connection."; | 182 << "Terminating connection."; |
| 183 OnError(); | 183 OnError(); |
| 184 return; | 184 return; |
| 185 } | 185 } |
| 186 } | 186 } |
| 187 | 187 |
| 188 message_sender_->Send(new P2PMsg_OnDataReceived(id_, remote_address_, data)); | 188 message_sender_->Send(new P2PMsg_OnDataReceived(id_, remote_address_, data)); |
| 189 } | 189 } |
| 190 | 190 |
| 191 void P2PSocketHostTcpBase::Send(const net::IPEndPoint& to, | 191 void P2PSocketHostTcpBase::Send(const net::IPEndPoint& to, |
| 192 const std::vector<char>& data) { | 192 const std::vector<char>& data, |
| 193 net::DiffServCodePoint dscp) { |
| 193 if (!socket_) { | 194 if (!socket_) { |
| 194 // The Send message may be sent after the an OnError message was | 195 // The Send message may be sent after the an OnError message was |
| 195 // sent by hasn't been processed the renderer. | 196 // sent by hasn't been processed the renderer. |
| 196 return; | 197 return; |
| 197 } | 198 } |
| 198 | 199 |
| 199 if (!(to == remote_address_)) { | 200 if (!(to == remote_address_)) { |
| 200 // Renderer should use this socket only to send data to |remote_address_|. | 201 // Renderer should use this socket only to send data to |remote_address_|. |
| 201 NOTREACHED(); | 202 NOTREACHED(); |
| 202 OnError(); | 203 OnError(); |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 } else { | 426 } else { |
| 426 packet_size += kTurnChannelDataHeaderSize; | 427 packet_size += kTurnChannelDataHeaderSize; |
| 427 // Calculate any padding if present. | 428 // Calculate any padding if present. |
| 428 if (packet_size % 4) | 429 if (packet_size % 4) |
| 429 *pad_bytes = 4 - packet_size % 4; | 430 *pad_bytes = 4 - packet_size % 4; |
| 430 } | 431 } |
| 431 return packet_size; | 432 return packet_size; |
| 432 } | 433 } |
| 433 | 434 |
| 434 } // namespace content | 435 } // namespace content |
| OLD | NEW |