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

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

Issue 22381012: Allow p2p UDP packages to set DSCP (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: extra newline removed Created 7 years, 4 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698