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 "net/quic/quic_stream_factory.h" | 5 #include "net/quic/quic_stream_factory.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
504 const HostPortProxyPair& host_port_proxy_pair, | 504 const HostPortProxyPair& host_port_proxy_pair, |
505 bool is_https, | 505 bool is_https, |
506 CertVerifier* cert_verifier, | 506 CertVerifier* cert_verifier, |
507 const AddressList& address_list, | 507 const AddressList& address_list, |
508 const BoundNetLog& net_log, | 508 const BoundNetLog& net_log, |
509 QuicClientSession** session) { | 509 QuicClientSession** session) { |
510 QuicGuid guid = random_generator_->RandUint64(); | 510 QuicGuid guid = random_generator_->RandUint64(); |
511 IPEndPoint addr = *address_list.begin(); | 511 IPEndPoint addr = *address_list.begin(); |
512 scoped_refptr<PortSuggester> port_suggester = | 512 scoped_refptr<PortSuggester> port_suggester = |
513 new PortSuggester(host_port_proxy_pair.first, port_seed_); | 513 new PortSuggester(host_port_proxy_pair.first, port_seed_); |
514 DatagramSocket::BindType bind_type = DatagramSocket::RANDOM_BIND; | |
515 #if defined(OS_WIN) | |
516 // TODO(jar)bug=329255 Provide better implementation to avoid pop-up warning. | |
517 bind_type = DatagramSocket::DEFAULT_BIND; | |
Ryan Hamilton
2014/01/08 17:53:41
This change *should* break the test which verifies
| |
518 #endif | |
514 scoped_ptr<DatagramClientSocket> socket( | 519 scoped_ptr<DatagramClientSocket> socket( |
515 client_socket_factory_->CreateDatagramClientSocket( | 520 client_socket_factory_->CreateDatagramClientSocket( |
516 DatagramSocket::RANDOM_BIND, | 521 bind_type, |
517 base::Bind(&PortSuggester::SuggestPort, port_suggester), | 522 base::Bind(&PortSuggester::SuggestPort, port_suggester), |
518 net_log.net_log(), net_log.source())); | 523 net_log.net_log(), net_log.source())); |
519 int rv = socket->Connect(addr); | 524 int rv = socket->Connect(addr); |
520 if (rv != OK) | 525 if (rv != OK) |
521 return rv; | 526 return rv; |
522 UMA_HISTOGRAM_COUNTS("Net.QuicEphemeralPortsSuggested", | 527 UMA_HISTOGRAM_COUNTS("Net.QuicEphemeralPortsSuggested", |
523 port_suggester->call_count()); | 528 port_suggester->call_count()); |
524 DCHECK_LE(1u, port_suggester->call_count()); | 529 DCHECK_LE(1u, port_suggester->call_count()); |
525 | 530 |
526 // We should adaptively set this buffer size, but for now, we'll use a size | 531 // We should adaptively set this buffer size, but for now, we'll use a size |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
632 // Copy the CachedState for the canonical server from canonical_crypto_config | 637 // Copy the CachedState for the canonical server from canonical_crypto_config |
633 // as the initial CachedState for the server_hostname in crypto_config. | 638 // as the initial CachedState for the server_hostname in crypto_config. |
634 crypto_config->InitializeFrom(server_hostname, | 639 crypto_config->InitializeFrom(server_hostname, |
635 canonical_host_port_proxy_pair.first.host(), | 640 canonical_host_port_proxy_pair.first.host(), |
636 canonical_crypto_config); | 641 canonical_crypto_config); |
637 // Update canonical version to point at the "most recent" crypto_config. | 642 // Update canonical version to point at the "most recent" crypto_config. |
638 canonical_hostname_to_origin_map_[canonical_host_port] = host_port_proxy_pair; | 643 canonical_hostname_to_origin_map_[canonical_host_port] = host_port_proxy_pair; |
639 } | 644 } |
640 | 645 |
641 } // namespace net | 646 } // namespace net |
OLD | NEW |