| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/cpu.h" | 10 #include "base/cpu.h" |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 scoped_ptr<QuicHttpStream> QuicStreamRequest::ReleaseStream() { | 540 scoped_ptr<QuicHttpStream> QuicStreamRequest::ReleaseStream() { |
| 541 DCHECK(stream_); | 541 DCHECK(stream_); |
| 542 return stream_.Pass(); | 542 return stream_.Pass(); |
| 543 } | 543 } |
| 544 | 544 |
| 545 QuicStreamFactory::QuicStreamFactory( | 545 QuicStreamFactory::QuicStreamFactory( |
| 546 HostResolver* host_resolver, | 546 HostResolver* host_resolver, |
| 547 ClientSocketFactory* client_socket_factory, | 547 ClientSocketFactory* client_socket_factory, |
| 548 base::WeakPtr<HttpServerProperties> http_server_properties, | 548 base::WeakPtr<HttpServerProperties> http_server_properties, |
| 549 CertVerifier* cert_verifier, | 549 CertVerifier* cert_verifier, |
| 550 CertPolicyEnforcer* cert_policy_enforcer, |
| 550 ChannelIDService* channel_id_service, | 551 ChannelIDService* channel_id_service, |
| 551 TransportSecurityState* transport_security_state, | 552 TransportSecurityState* transport_security_state, |
| 552 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory, | 553 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory, |
| 553 QuicRandom* random_generator, | 554 QuicRandom* random_generator, |
| 554 QuicClock* clock, | 555 QuicClock* clock, |
| 555 size_t max_packet_length, | 556 size_t max_packet_length, |
| 556 const std::string& user_agent_id, | 557 const std::string& user_agent_id, |
| 557 const QuicVersionVector& supported_versions, | 558 const QuicVersionVector& supported_versions, |
| 558 bool enable_port_selection, | 559 bool enable_port_selection, |
| 559 bool always_require_handshake_confirmation, | 560 bool always_require_handshake_confirmation, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 socket_receive_buffer_size_(socket_receive_buffer_size), | 595 socket_receive_buffer_size_(socket_receive_buffer_size), |
| 595 port_seed_(random_generator_->RandUint64()), | 596 port_seed_(random_generator_->RandUint64()), |
| 596 check_persisted_supports_quic_(true), | 597 check_persisted_supports_quic_(true), |
| 597 task_runner_(nullptr), | 598 task_runner_(nullptr), |
| 598 weak_factory_(this) { | 599 weak_factory_(this) { |
| 599 DCHECK(transport_security_state_); | 600 DCHECK(transport_security_state_); |
| 600 crypto_config_.set_user_agent_id(user_agent_id); | 601 crypto_config_.set_user_agent_id(user_agent_id); |
| 601 crypto_config_.AddCanonicalSuffix(".c.youtube.com"); | 602 crypto_config_.AddCanonicalSuffix(".c.youtube.com"); |
| 602 crypto_config_.AddCanonicalSuffix(".googlevideo.com"); | 603 crypto_config_.AddCanonicalSuffix(".googlevideo.com"); |
| 603 crypto_config_.AddCanonicalSuffix(".googleusercontent.com"); | 604 crypto_config_.AddCanonicalSuffix(".googleusercontent.com"); |
| 604 crypto_config_.SetProofVerifier( | 605 crypto_config_.SetProofVerifier(new ProofVerifierChromium( |
| 605 new ProofVerifierChromium(cert_verifier, transport_security_state)); | 606 cert_verifier, cert_policy_enforcer, transport_security_state)); |
| 606 // TODO(rtenneti): http://crbug.com/487355. Temporary fix for b/20760730 until | 607 // TODO(rtenneti): http://crbug.com/487355. Temporary fix for b/20760730 until |
| 607 // channel_id_service is supported in cronet. | 608 // channel_id_service is supported in cronet. |
| 608 if (channel_id_service) { | 609 if (channel_id_service) { |
| 609 crypto_config_.SetChannelIDSource( | 610 crypto_config_.SetChannelIDSource( |
| 610 new ChannelIDSourceChromium(channel_id_service)); | 611 new ChannelIDSourceChromium(channel_id_service)); |
| 611 } | 612 } |
| 612 base::CPU cpu; | 613 base::CPU cpu; |
| 613 bool has_aes_hardware_support = cpu.has_aesni() && cpu.has_avx(); | 614 bool has_aes_hardware_support = cpu.has_aesni() && cpu.has_avx(); |
| 614 UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.PreferAesGcm", | 615 UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.PreferAesGcm", |
| 615 has_aes_hardware_support); | 616 has_aes_hardware_support); |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1271 // Since the session was active, there's no longer an | 1272 // Since the session was active, there's no longer an |
| 1272 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP | 1273 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP |
| 1273 // job also fails. So to avoid not using QUIC when we otherwise could, we mark | 1274 // job also fails. So to avoid not using QUIC when we otherwise could, we mark |
| 1274 // it as recently broken, which means that 0-RTT will be disabled but we'll | 1275 // it as recently broken, which means that 0-RTT will be disabled but we'll |
| 1275 // still race. | 1276 // still race. |
| 1276 http_server_properties_->MarkAlternativeServiceRecentlyBroken( | 1277 http_server_properties_->MarkAlternativeServiceRecentlyBroken( |
| 1277 alternative_service); | 1278 alternative_service); |
| 1278 } | 1279 } |
| 1279 | 1280 |
| 1280 } // namespace net | 1281 } // namespace net |
| OLD | NEW |