| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |