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

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

Issue 689243002: Fix the port of remote HostPortPair in P2PSocketHostTcpBase::Init. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 DCHECK_EQ(state_, STATE_UNINITIALIZED); 81 DCHECK_EQ(state_, STATE_UNINITIALIZED);
82 82
83 remote_address_ = remote_address; 83 remote_address_ = remote_address;
84 state_ = STATE_CONNECTING; 84 state_ = STATE_CONNECTING;
85 85
86 net::HostPortPair dest_host_port_pair; 86 net::HostPortPair dest_host_port_pair;
87 // If there is no resolved address, let's try with domain name, assuming 87 // If there is no resolved address, let's try with domain name, assuming
88 // socket layer will do the DNS resolve. 88 // socket layer will do the DNS resolve.
89 if (remote_address.ip_address.address().empty()) { 89 if (remote_address.ip_address.address().empty()) {
90 DCHECK(!remote_address.hostname.empty()); 90 DCHECK(!remote_address.hostname.empty());
91 dest_host_port_pair = net::HostPortPair::FromString( 91 dest_host_port_pair = net::HostPortPair(remote_address.hostname,
92 remote_address.hostname); 92 remote_address.ip_address.port());
93 } else { 93 } else {
94 dest_host_port_pair = net::HostPortPair::FromIPEndPoint( 94 dest_host_port_pair = net::HostPortPair::FromIPEndPoint(
95 remote_address.ip_address); 95 remote_address.ip_address);
96 } 96 }
97 97
98 // TODO(mallinath) - We are ignoring local_address altogether. We should 98 // TODO(mallinath) - We are ignoring local_address altogether. We should
99 // find a way to inject this into ProxyResolvingClientSocket. This could be 99 // find a way to inject this into ProxyResolvingClientSocket. This could be
100 // a problem on multi-homed host. 100 // a problem on multi-homed host.
101 101
102 // The default SSLConfig is good enough for us for now. 102 // The default SSLConfig is good enough for us for now.
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 } else { 606 } else {
607 packet_size += kTurnChannelDataHeaderSize; 607 packet_size += kTurnChannelDataHeaderSize;
608 // Calculate any padding if present. 608 // Calculate any padding if present.
609 if (packet_size % 4) 609 if (packet_size % 4)
610 *pad_bytes = 4 - packet_size % 4; 610 *pad_bytes = 4 - packet_size % 4;
611 } 611 }
612 return packet_size; 612 return packet_size;
613 } 613 }
614 614
615 } // namespace content 615 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698