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/renderer/p2p/ipc_socket_factory.h" | 5 #include "content/renderer/p2p/ipc_socket_factory.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <list> | 10 #include <list> |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
557 SignalAddressReady(this, local_address_); | 557 SignalAddressReady(this, local_address_); |
558 if (IsTcpClientSocket(type_)) { | 558 if (IsTcpClientSocket(type_)) { |
559 // If remote address is unresolved, set resolved remote IP address received | 559 // If remote address is unresolved, set resolved remote IP address received |
560 // in the callback. This address will be used while sending the packets | 560 // in the callback. This address will be used while sending the packets |
561 // over the network. | 561 // over the network. |
562 if (remote_address_.IsUnresolvedIP()) { | 562 if (remote_address_.IsUnresolvedIP()) { |
563 rtc::SocketAddress jingle_socket_address; | 563 rtc::SocketAddress jingle_socket_address; |
564 // |remote_address| could be unresolved if the connection is behind a | 564 // |remote_address| could be unresolved if the connection is behind a |
565 // proxy. | 565 // proxy. |
566 if (!remote_address.address().empty() && | 566 if (!remote_address.address().empty() && |
567 jingle_glue::IPEndPointToSocketAddress( | 567 jingle_glue::IPEndPointToSocketAddress(remote_address, |
eroman
2016/01/13 23:19:42
Consider remove this edit, since it is just a form
martijnc
2016/01/14 22:48:16
Done.
| |
568 remote_address, &jingle_socket_address)) { | 568 &jingle_socket_address)) { |
569 // Set only the IP address. | 569 // Set only the IP address. |
570 remote_address_.SetResolvedIP(jingle_socket_address.ipaddr()); | 570 remote_address_.SetResolvedIP(jingle_socket_address.ipaddr()); |
571 } | 571 } |
572 } | 572 } |
573 | 573 |
574 // SignalConnect after updating the |remote_address_| so that the listener | 574 // SignalConnect after updating the |remote_address_| so that the listener |
575 // can get the resolved remote address. | 575 // can get the resolved remote address. |
576 SignalConnect(this); | 576 SignalConnect(this); |
577 } | 577 } |
578 } | 578 } |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
801 } | 801 } |
802 | 802 |
803 rtc::AsyncResolverInterface* | 803 rtc::AsyncResolverInterface* |
804 IpcPacketSocketFactory::CreateAsyncResolver() { | 804 IpcPacketSocketFactory::CreateAsyncResolver() { |
805 scoped_ptr<AsyncAddressResolverImpl> resolver( | 805 scoped_ptr<AsyncAddressResolverImpl> resolver( |
806 new AsyncAddressResolverImpl(socket_dispatcher_)); | 806 new AsyncAddressResolverImpl(socket_dispatcher_)); |
807 return resolver.release(); | 807 return resolver.release(); |
808 } | 808 } |
809 | 809 |
810 } // namespace content | 810 } // namespace content |
OLD | NEW |