Chromium Code Reviews| Index: net/quic/quic_stream_factory.cc |
| diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc |
| index 40f294821850e0a6fbffa5c9dc5a1d0fbb58d13c..c1c72322cef7ca7bcdc71c600d5d6735d9d74254 100644 |
| --- a/net/quic/quic_stream_factory.cc |
| +++ b/net/quic/quic_stream_factory.cc |
| @@ -21,6 +21,7 @@ |
| #include "net/quic/congestion_control/tcp_receiver.h" |
| #include "net/quic/crypto/proof_verifier_chromium.h" |
| #include "net/quic/crypto/quic_random.h" |
| +#include "net/quic/port_suggester.h" |
| #include "net/quic/quic_client_session.h" |
| #include "net/quic/quic_clock.h" |
| #include "net/quic/quic_connection.h" |
| @@ -256,7 +257,8 @@ QuicStreamFactory::QuicStreamFactory( |
| random_generator_(random_generator), |
| clock_(clock), |
| max_packet_length_(max_packet_length), |
| - weak_factory_(this) { |
| + weak_factory_(this), |
| + port_entropy_(random_generator_->RandUint64()) { |
| config_.SetDefaults(); |
| config_.set_idle_connection_state_lifetime( |
| QuicTime::Delta::FromSeconds(30), |
| @@ -447,9 +449,12 @@ QuicClientSession* QuicStreamFactory::CreateSession( |
| const BoundNetLog& net_log) { |
| QuicGuid guid = random_generator_->RandUint64(); |
| IPEndPoint addr = *address_list.begin(); |
| + scoped_refptr<PortSuggester> port_suggester = |
| + new PortSuggester(host_port_proxy_pair.first, port_entropy_); |
| scoped_ptr<DatagramClientSocket> socket( |
| client_socket_factory_->CreateDatagramClientSocket( |
| - DatagramSocket::DEFAULT_BIND, base::Bind(&base::RandInt), |
| + DatagramSocket::RANDOM_BIND, |
| + base::Bind(&PortSuggester::SuggestPort, port_suggester), |
|
Ryan Hamilton
2013/12/07 01:46:14
It would be super great if we had a test that veri
jar (doing other things)
2013/12/07 03:12:18
I added some code to DCHECK() that the port_sugges
Ryan Hamilton
2013/12/07 04:52:22
If you reverted the changes to this file, would an
|
| net_log.net_log(), net_log.source())); |
| socket->Connect(addr); |