| 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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 DCHECK(stream_); | 447 DCHECK(stream_); |
| 448 return stream_.Pass(); | 448 return stream_.Pass(); |
| 449 } | 449 } |
| 450 | 450 |
| 451 QuicStreamFactory::QuicStreamFactory( | 451 QuicStreamFactory::QuicStreamFactory( |
| 452 HostResolver* host_resolver, | 452 HostResolver* host_resolver, |
| 453 ClientSocketFactory* client_socket_factory, | 453 ClientSocketFactory* client_socket_factory, |
| 454 base::WeakPtr<HttpServerProperties> http_server_properties, | 454 base::WeakPtr<HttpServerProperties> http_server_properties, |
| 455 CertVerifier* cert_verifier, | 455 CertVerifier* cert_verifier, |
| 456 ChannelIDService* channel_id_service, | 456 ChannelIDService* channel_id_service, |
| 457 TransportSecurityState* transport_security_state, |
| 457 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory, | 458 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory, |
| 458 QuicRandom* random_generator, | 459 QuicRandom* random_generator, |
| 459 QuicClock* clock, | 460 QuicClock* clock, |
| 460 size_t max_packet_length, | 461 size_t max_packet_length, |
| 461 const std::string& user_agent_id, | 462 const std::string& user_agent_id, |
| 462 const QuicVersionVector& supported_versions, | 463 const QuicVersionVector& supported_versions, |
| 463 bool enable_port_selection, | 464 bool enable_port_selection, |
| 464 bool enable_pacing, | 465 bool enable_pacing, |
| 465 bool enable_time_based_loss_detection, | 466 bool enable_time_based_loss_detection, |
| 466 const QuicTagVector& connection_options) | 467 const QuicTagVector& connection_options) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 477 enable_time_based_loss_detection, | 478 enable_time_based_loss_detection, |
| 478 connection_options)), | 479 connection_options)), |
| 479 supported_versions_(supported_versions), | 480 supported_versions_(supported_versions), |
| 480 enable_port_selection_(enable_port_selection), | 481 enable_port_selection_(enable_port_selection), |
| 481 port_seed_(random_generator_->RandUint64()), | 482 port_seed_(random_generator_->RandUint64()), |
| 482 weak_factory_(this) { | 483 weak_factory_(this) { |
| 483 crypto_config_.SetDefaults(); | 484 crypto_config_.SetDefaults(); |
| 484 crypto_config_.set_user_agent_id(user_agent_id); | 485 crypto_config_.set_user_agent_id(user_agent_id); |
| 485 crypto_config_.AddCanonicalSuffix(".c.youtube.com"); | 486 crypto_config_.AddCanonicalSuffix(".c.youtube.com"); |
| 486 crypto_config_.AddCanonicalSuffix(".googlevideo.com"); | 487 crypto_config_.AddCanonicalSuffix(".googlevideo.com"); |
| 487 crypto_config_.SetProofVerifier(new ProofVerifierChromium(cert_verifier)); | 488 crypto_config_.SetProofVerifier( |
| 489 new ProofVerifierChromium(cert_verifier, transport_security_state)); |
| 488 // TODO(wtc): a temporary change to investigate the performance degradation | 490 // TODO(wtc): a temporary change to investigate the performance degradation |
| 489 // caused by Channel ID lookup. | 491 // caused by Channel ID lookup. |
| 490 #if 0 | 492 #if 0 |
| 491 crypto_config_.SetChannelIDSource( | 493 crypto_config_.SetChannelIDSource( |
| 492 new ChannelIDSourceChromium(channel_id_service)); | 494 new ChannelIDSourceChromium(channel_id_service)); |
| 493 #endif | 495 #endif |
| 494 base::CPU cpu; | 496 base::CPU cpu; |
| 495 if (cpu.has_aesni() && cpu.has_avx()) | 497 if (cpu.has_aesni() && cpu.has_avx()) |
| 496 crypto_config_.PreferAesGcm(); | 498 crypto_config_.PreferAesGcm(); |
| 497 if (!IsEcdsaSupported()) | 499 if (!IsEcdsaSupported()) |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 http_server_properties_->ClearAlternateProtocol(server); | 964 http_server_properties_->ClearAlternateProtocol(server); |
| 963 http_server_properties_->SetAlternateProtocol( | 965 http_server_properties_->SetAlternateProtocol( |
| 964 server, alternate.port, alternate.protocol, 1); | 966 server, alternate.port, alternate.protocol, 1); |
| 965 DCHECK_EQ(QUIC, | 967 DCHECK_EQ(QUIC, |
| 966 http_server_properties_->GetAlternateProtocol(server).protocol); | 968 http_server_properties_->GetAlternateProtocol(server).protocol); |
| 967 DCHECK(http_server_properties_->WasAlternateProtocolRecentlyBroken( | 969 DCHECK(http_server_properties_->WasAlternateProtocolRecentlyBroken( |
| 968 server)); | 970 server)); |
| 969 } | 971 } |
| 970 | 972 |
| 971 } // namespace net | 973 } // namespace net |
| OLD | NEW |