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 bool IsEcdsaSupported() { | 78 bool IsEcdsaSupported() { |
79 #if defined(OS_WIN) | 79 #if defined(OS_WIN) |
80 if (base::win::GetVersion() < base::win::VERSION_VISTA) | 80 if (base::win::GetVersion() < base::win::VERSION_VISTA) |
81 return false; | 81 return false; |
82 #endif | 82 #endif |
83 | 83 |
84 return true; | 84 return true; |
85 } | 85 } |
86 | 86 |
87 QuicConfig InitializeQuicConfig(bool enable_pacing, | 87 QuicConfig InitializeQuicConfig(bool enable_pacing, |
88 bool enable_time_based_loss_detection) { | 88 bool enable_time_based_loss_detection, |
| 89 QuicTagVector connection_options) { |
89 QuicConfig config; | 90 QuicConfig config; |
90 config.SetDefaults(); | 91 config.SetDefaults(); |
91 config.EnablePacing(enable_pacing); | 92 config.EnablePacing(enable_pacing); |
92 if (enable_time_based_loss_detection) | 93 if (enable_time_based_loss_detection) |
93 config.SetLossDetectionToSend(kTIME); | 94 config.SetLossDetectionToSend(kTIME); |
94 config.set_idle_connection_state_lifetime( | 95 config.set_idle_connection_state_lifetime( |
95 QuicTime::Delta::FromSeconds(kIdleConnectionTimeoutSeconds), | 96 QuicTime::Delta::FromSeconds(kIdleConnectionTimeoutSeconds), |
96 QuicTime::Delta::FromSeconds(kIdleConnectionTimeoutSeconds)); | 97 QuicTime::Delta::FromSeconds(kIdleConnectionTimeoutSeconds)); |
| 98 config.SetCongestionOptionsToSend(connection_options); |
97 return config; | 99 return config; |
98 } | 100 } |
99 | 101 |
100 } // namespace | 102 } // namespace |
101 | 103 |
102 QuicStreamFactory::IpAliasKey::IpAliasKey() {} | 104 QuicStreamFactory::IpAliasKey::IpAliasKey() {} |
103 | 105 |
104 QuicStreamFactory::IpAliasKey::IpAliasKey(IPEndPoint ip_endpoint, | 106 QuicStreamFactory::IpAliasKey::IpAliasKey(IPEndPoint ip_endpoint, |
105 bool is_https) | 107 bool is_https) |
106 : ip_endpoint(ip_endpoint), | 108 : ip_endpoint(ip_endpoint), |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 base::WeakPtr<HttpServerProperties> http_server_properties, | 453 base::WeakPtr<HttpServerProperties> http_server_properties, |
452 CertVerifier* cert_verifier, | 454 CertVerifier* cert_verifier, |
453 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory, | 455 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory, |
454 QuicRandom* random_generator, | 456 QuicRandom* random_generator, |
455 QuicClock* clock, | 457 QuicClock* clock, |
456 size_t max_packet_length, | 458 size_t max_packet_length, |
457 const std::string& user_agent_id, | 459 const std::string& user_agent_id, |
458 const QuicVersionVector& supported_versions, | 460 const QuicVersionVector& supported_versions, |
459 bool enable_port_selection, | 461 bool enable_port_selection, |
460 bool enable_pacing, | 462 bool enable_pacing, |
461 bool enable_time_based_loss_detection) | 463 bool enable_time_based_loss_detection, |
| 464 QuicTagVector connection_options) |
462 : require_confirmation_(true), | 465 : require_confirmation_(true), |
463 host_resolver_(host_resolver), | 466 host_resolver_(host_resolver), |
464 client_socket_factory_(client_socket_factory), | 467 client_socket_factory_(client_socket_factory), |
465 http_server_properties_(http_server_properties), | 468 http_server_properties_(http_server_properties), |
466 cert_verifier_(cert_verifier), | 469 cert_verifier_(cert_verifier), |
467 quic_server_info_factory_(NULL), | 470 quic_server_info_factory_(NULL), |
468 quic_crypto_client_stream_factory_(quic_crypto_client_stream_factory), | 471 quic_crypto_client_stream_factory_(quic_crypto_client_stream_factory), |
469 random_generator_(random_generator), | 472 random_generator_(random_generator), |
470 clock_(clock), | 473 clock_(clock), |
471 max_packet_length_(max_packet_length), | 474 max_packet_length_(max_packet_length), |
472 config_(InitializeQuicConfig(enable_pacing, | 475 config_(InitializeQuicConfig(enable_pacing, |
473 enable_time_based_loss_detection)), | 476 enable_time_based_loss_detection, |
| 477 connection_options)), |
474 supported_versions_(supported_versions), | 478 supported_versions_(supported_versions), |
475 enable_port_selection_(enable_port_selection), | 479 enable_port_selection_(enable_port_selection), |
476 port_seed_(random_generator_->RandUint64()), | 480 port_seed_(random_generator_->RandUint64()), |
477 weak_factory_(this) { | 481 weak_factory_(this) { |
478 crypto_config_.SetDefaults(); | 482 crypto_config_.SetDefaults(); |
479 crypto_config_.set_user_agent_id(user_agent_id); | 483 crypto_config_.set_user_agent_id(user_agent_id); |
480 crypto_config_.AddCanonicalSuffix(".c.youtube.com"); | 484 crypto_config_.AddCanonicalSuffix(".c.youtube.com"); |
481 crypto_config_.AddCanonicalSuffix(".googlevideo.com"); | 485 crypto_config_.AddCanonicalSuffix(".googlevideo.com"); |
482 crypto_config_.SetProofVerifier(new ProofVerifierChromium(cert_verifier)); | 486 crypto_config_.SetProofVerifier(new ProofVerifierChromium(cert_verifier)); |
483 base::CPU cpu; | 487 base::CPU cpu; |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 http_server_properties_->ClearAlternateProtocol(server); | 950 http_server_properties_->ClearAlternateProtocol(server); |
947 http_server_properties_->SetAlternateProtocol( | 951 http_server_properties_->SetAlternateProtocol( |
948 server, alternate.port, alternate.protocol); | 952 server, alternate.port, alternate.protocol); |
949 DCHECK_EQ(QUIC, | 953 DCHECK_EQ(QUIC, |
950 http_server_properties_->GetAlternateProtocol(server).protocol); | 954 http_server_properties_->GetAlternateProtocol(server).protocol); |
951 DCHECK(http_server_properties_->WasAlternateProtocolRecentlyBroken( | 955 DCHECK(http_server_properties_->WasAlternateProtocolRecentlyBroken( |
952 server)); | 956 server)); |
953 } | 957 } |
954 | 958 |
955 } // namespace net | 959 } // namespace net |
OLD | NEW |