Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(445)

Side by Side Diff: content/browser/renderer_host/p2p/socket_host_tcp.cc

Issue 184813006: Relanding PacketOptions CL after revert (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 } 282 }
283 283
284 message_sender_->Send(new P2PMsg_OnDataReceived( 284 message_sender_->Send(new P2PMsg_OnDataReceived(
285 id_, remote_address_, data, base::TimeTicks::Now())); 285 id_, remote_address_, data, base::TimeTicks::Now()));
286 } 286 }
287 287
288 // Note: dscp is not actually used on TCP sockets as this point, 288 // Note: dscp is not actually used on TCP sockets as this point,
289 // but may be honored in the future. 289 // but may be honored in the future.
290 void P2PSocketHostTcpBase::Send(const net::IPEndPoint& to, 290 void P2PSocketHostTcpBase::Send(const net::IPEndPoint& to,
291 const std::vector<char>& data, 291 const std::vector<char>& data,
292 net::DiffServCodePoint dscp, 292 const talk_base::PacketOptions& options,
293 uint64 packet_id) { 293 uint64 packet_id) {
294 if (!socket_) { 294 if (!socket_) {
295 // The Send message may be sent after the an OnError message was 295 // The Send message may be sent after the an OnError message was
296 // sent by hasn't been processed the renderer. 296 // sent by hasn't been processed the renderer.
297 return; 297 return;
298 } 298 }
299 299
300 if (!(to == remote_address_)) { 300 if (!(to == remote_address_)) {
301 // Renderer should use this socket only to send data to |remote_address_|. 301 // Renderer should use this socket only to send data to |remote_address_|.
302 NOTREACHED(); 302 NOTREACHED();
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 } else { 544 } else {
545 packet_size += kTurnChannelDataHeaderSize; 545 packet_size += kTurnChannelDataHeaderSize;
546 // Calculate any padding if present. 546 // Calculate any padding if present.
547 if (packet_size % 4) 547 if (packet_size % 4)
548 *pad_bytes = 4 - packet_size % 4; 548 *pad_bytes = 4 - packet_size % 4;
549 } 549 }
550 return packet_size; 550 return packet_size;
551 } 551 }
552 552
553 } // namespace content 553 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/p2p/socket_host_tcp.h ('k') | content/browser/renderer_host/p2p/socket_host_tcp_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698