| 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/cpu.h" | 9 #include "base/cpu.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 bool IsEcdsaSupported() { | 79 bool IsEcdsaSupported() { |
| 80 #if defined(OS_WIN) | 80 #if defined(OS_WIN) |
| 81 if (base::win::GetVersion() < base::win::VERSION_VISTA) | 81 if (base::win::GetVersion() < base::win::VERSION_VISTA) |
| 82 return false; | 82 return false; |
| 83 #endif | 83 #endif |
| 84 | 84 |
| 85 return true; | 85 return true; |
| 86 } | 86 } |
| 87 | 87 |
| 88 QuicConfig InitializeQuicConfig(bool enable_pacing, | 88 QuicConfig InitializeQuicConfig(bool enable_time_based_loss_detection, |
| 89 bool enable_time_based_loss_detection, | |
| 90 const QuicTagVector& connection_options) { | 89 const QuicTagVector& connection_options) { |
| 91 QuicConfig config; | 90 QuicConfig config; |
| 92 config.SetDefaults(); | 91 config.SetDefaults(); |
| 93 config.EnablePacing(enable_pacing); | |
| 94 if (enable_time_based_loss_detection) | 92 if (enable_time_based_loss_detection) |
| 95 config.SetLossDetectionToSend(kTIME); | 93 config.SetLossDetectionToSend(kTIME); |
| 96 config.set_idle_connection_state_lifetime( | 94 config.set_idle_connection_state_lifetime( |
| 97 QuicTime::Delta::FromSeconds(kIdleConnectionTimeoutSeconds), | 95 QuicTime::Delta::FromSeconds(kIdleConnectionTimeoutSeconds), |
| 98 QuicTime::Delta::FromSeconds(kIdleConnectionTimeoutSeconds)); | 96 QuicTime::Delta::FromSeconds(kIdleConnectionTimeoutSeconds)); |
| 99 config.SetConnectionOptionsToSend(connection_options); | 97 config.SetConnectionOptionsToSend(connection_options); |
| 100 return config; | 98 return config; |
| 101 } | 99 } |
| 102 | 100 |
| 103 } // namespace | 101 } // namespace |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 CertVerifier* cert_verifier, | 453 CertVerifier* cert_verifier, |
| 456 ChannelIDService* channel_id_service, | 454 ChannelIDService* channel_id_service, |
| 457 TransportSecurityState* transport_security_state, | 455 TransportSecurityState* transport_security_state, |
| 458 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory, | 456 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory, |
| 459 QuicRandom* random_generator, | 457 QuicRandom* random_generator, |
| 460 QuicClock* clock, | 458 QuicClock* clock, |
| 461 size_t max_packet_length, | 459 size_t max_packet_length, |
| 462 const std::string& user_agent_id, | 460 const std::string& user_agent_id, |
| 463 const QuicVersionVector& supported_versions, | 461 const QuicVersionVector& supported_versions, |
| 464 bool enable_port_selection, | 462 bool enable_port_selection, |
| 465 bool enable_pacing, | |
| 466 bool enable_time_based_loss_detection, | 463 bool enable_time_based_loss_detection, |
| 467 const QuicTagVector& connection_options) | 464 const QuicTagVector& connection_options) |
| 468 : require_confirmation_(true), | 465 : require_confirmation_(true), |
| 469 host_resolver_(host_resolver), | 466 host_resolver_(host_resolver), |
| 470 client_socket_factory_(client_socket_factory), | 467 client_socket_factory_(client_socket_factory), |
| 471 http_server_properties_(http_server_properties), | 468 http_server_properties_(http_server_properties), |
| 472 quic_server_info_factory_(NULL), | 469 quic_server_info_factory_(NULL), |
| 473 quic_crypto_client_stream_factory_(quic_crypto_client_stream_factory), | 470 quic_crypto_client_stream_factory_(quic_crypto_client_stream_factory), |
| 474 random_generator_(random_generator), | 471 random_generator_(random_generator), |
| 475 clock_(clock), | 472 clock_(clock), |
| 476 max_packet_length_(max_packet_length), | 473 max_packet_length_(max_packet_length), |
| 477 config_(InitializeQuicConfig(enable_pacing, | 474 config_(InitializeQuicConfig(enable_time_based_loss_detection, |
| 478 enable_time_based_loss_detection, | |
| 479 connection_options)), | 475 connection_options)), |
| 480 supported_versions_(supported_versions), | 476 supported_versions_(supported_versions), |
| 481 enable_port_selection_(enable_port_selection), | 477 enable_port_selection_(enable_port_selection), |
| 482 port_seed_(random_generator_->RandUint64()), | 478 port_seed_(random_generator_->RandUint64()), |
| 483 weak_factory_(this) { | 479 weak_factory_(this) { |
| 484 crypto_config_.SetDefaults(); | 480 crypto_config_.SetDefaults(); |
| 485 crypto_config_.set_user_agent_id(user_agent_id); | 481 crypto_config_.set_user_agent_id(user_agent_id); |
| 486 crypto_config_.AddCanonicalSuffix(".c.youtube.com"); | 482 crypto_config_.AddCanonicalSuffix(".c.youtube.com"); |
| 487 crypto_config_.AddCanonicalSuffix(".googlevideo.com"); | 483 crypto_config_.AddCanonicalSuffix(".googlevideo.com"); |
| 488 crypto_config_.SetProofVerifier( | 484 crypto_config_.SetProofVerifier( |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 960 http_server_properties_->ClearAlternateProtocol(server); | 956 http_server_properties_->ClearAlternateProtocol(server); |
| 961 http_server_properties_->SetAlternateProtocol( | 957 http_server_properties_->SetAlternateProtocol( |
| 962 server, alternate.port, alternate.protocol, 1); | 958 server, alternate.port, alternate.protocol, 1); |
| 963 DCHECK_EQ(QUIC, | 959 DCHECK_EQ(QUIC, |
| 964 http_server_properties_->GetAlternateProtocol(server).protocol); | 960 http_server_properties_->GetAlternateProtocol(server).protocol); |
| 965 DCHECK(http_server_properties_->WasAlternateProtocolRecentlyBroken( | 961 DCHECK(http_server_properties_->WasAlternateProtocolRecentlyBroken( |
| 966 server)); | 962 server)); |
| 967 } | 963 } |
| 968 | 964 |
| 969 } // namespace net | 965 } // namespace net |
| OLD | NEW |