| 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 <ostream> | 7 #include <ostream> |
| 8 | 8 |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| 11 #include "base/threading/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" |
| 12 #include "net/base/test_data_directory.h" | 12 #include "net/base/test_data_directory.h" |
| 13 #include "net/cert/cert_verifier.h" | 13 #include "net/cert/cert_verifier.h" |
| 14 #include "net/cert/ct_policy_enforcer.h" |
| 14 #include "net/cert/multi_log_ct_verifier.h" | 15 #include "net/cert/multi_log_ct_verifier.h" |
| 15 #include "net/dns/mock_host_resolver.h" | 16 #include "net/dns/mock_host_resolver.h" |
| 16 #include "net/http/http_response_headers.h" | 17 #include "net/http/http_response_headers.h" |
| 17 #include "net/http/http_response_info.h" | 18 #include "net/http/http_response_info.h" |
| 18 #include "net/http/http_server_properties_impl.h" | 19 #include "net/http/http_server_properties_impl.h" |
| 19 #include "net/http/http_util.h" | 20 #include "net/http/http_util.h" |
| 20 #include "net/http/transport_security_state.h" | 21 #include "net/http/transport_security_state.h" |
| 21 #include "net/quic/crypto/crypto_handshake.h" | 22 #include "net/quic/crypto/crypto_handshake.h" |
| 22 #include "net/quic/crypto/proof_verifier_chromium.h" | 23 #include "net/quic/crypto/proof_verifier_chromium.h" |
| 23 #include "net/quic/crypto/properties_based_quic_server_info.h" | 24 #include "net/quic/crypto/properties_based_quic_server_info.h" |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 // If |factory_| was not initialized, then |clock_| needs to be destroyed. | 306 // If |factory_| was not initialized, then |clock_| needs to be destroyed. |
| 306 if (!factory_) { | 307 if (!factory_) { |
| 307 delete clock_; | 308 delete clock_; |
| 308 } | 309 } |
| 309 } | 310 } |
| 310 | 311 |
| 311 void Initialize() { | 312 void Initialize() { |
| 312 DCHECK(!factory_); | 313 DCHECK(!factory_); |
| 313 factory_.reset(new QuicStreamFactory( | 314 factory_.reset(new QuicStreamFactory( |
| 314 net_log_.net_log(), &host_resolver_, &socket_factory_, | 315 net_log_.net_log(), &host_resolver_, &socket_factory_, |
| 315 &http_server_properties_, cert_verifier_.get(), nullptr, | 316 &http_server_properties_, cert_verifier_.get(), &ct_policy_enforcer_, |
| 316 channel_id_service_.get(), &transport_security_state_, | 317 channel_id_service_.get(), &transport_security_state_, |
| 317 cert_transparency_verifier_.get(), | 318 cert_transparency_verifier_.get(), |
| 318 /*SocketPerformanceWatcherFactory*/ nullptr, | 319 /*SocketPerformanceWatcherFactory*/ nullptr, |
| 319 &crypto_client_stream_factory_, &random_generator_, clock_, | 320 &crypto_client_stream_factory_, &random_generator_, clock_, |
| 320 kDefaultMaxPacketSize, string(), SupportedVersions(version_), | 321 kDefaultMaxPacketSize, string(), SupportedVersions(version_), |
| 321 enable_port_selection_, always_require_handshake_confirmation_, | 322 enable_port_selection_, always_require_handshake_confirmation_, |
| 322 disable_connection_pooling_, load_server_info_timeout_srtt_multiplier_, | 323 disable_connection_pooling_, load_server_info_timeout_srtt_multiplier_, |
| 323 enable_connection_racing_, enable_non_blocking_io_, disable_disk_cache_, | 324 enable_connection_racing_, enable_non_blocking_io_, disable_disk_cache_, |
| 324 prefer_aes_, max_number_of_lossy_connections_, packet_loss_threshold_, | 325 prefer_aes_, max_number_of_lossy_connections_, packet_loss_threshold_, |
| 325 max_disabled_reasons_, threshold_timeouts_with_open_streams_, | 326 max_disabled_reasons_, threshold_timeouts_with_open_streams_, |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 MockClock* clock_; // Owned by |factory_| once created. | 479 MockClock* clock_; // Owned by |factory_| once created. |
| 479 scoped_refptr<TestTaskRunner> runner_; | 480 scoped_refptr<TestTaskRunner> runner_; |
| 480 QuicVersion version_; | 481 QuicVersion version_; |
| 481 QuicTestPacketMaker client_maker_; | 482 QuicTestPacketMaker client_maker_; |
| 482 QuicTestPacketMaker server_maker_; | 483 QuicTestPacketMaker server_maker_; |
| 483 HttpServerPropertiesImpl http_server_properties_; | 484 HttpServerPropertiesImpl http_server_properties_; |
| 484 std::unique_ptr<CertVerifier> cert_verifier_; | 485 std::unique_ptr<CertVerifier> cert_verifier_; |
| 485 std::unique_ptr<ChannelIDService> channel_id_service_; | 486 std::unique_ptr<ChannelIDService> channel_id_service_; |
| 486 TransportSecurityState transport_security_state_; | 487 TransportSecurityState transport_security_state_; |
| 487 std::unique_ptr<CTVerifier> cert_transparency_verifier_; | 488 std::unique_ptr<CTVerifier> cert_transparency_verifier_; |
| 489 CTPolicyEnforcer ct_policy_enforcer_; |
| 488 std::unique_ptr<ScopedMockNetworkChangeNotifier> | 490 std::unique_ptr<ScopedMockNetworkChangeNotifier> |
| 489 scoped_mock_network_change_notifier_; | 491 scoped_mock_network_change_notifier_; |
| 490 std::unique_ptr<QuicStreamFactory> factory_; | 492 std::unique_ptr<QuicStreamFactory> factory_; |
| 491 HostPortPair host_port_pair_; | 493 HostPortPair host_port_pair_; |
| 492 GURL url_; | 494 GURL url_; |
| 493 GURL url2_; | 495 GURL url2_; |
| 494 GURL url3_; | 496 GURL url3_; |
| 495 GURL url4_; | 497 GURL url4_; |
| 496 | 498 |
| 497 PrivacyMode privacy_mode_; | 499 PrivacyMode privacy_mode_; |
| (...skipping 3830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4328 EXPECT_NE(session1, session2); | 4330 EXPECT_NE(session1, session2); |
| 4329 | 4331 |
| 4330 EXPECT_EQ(QuicServerId(origin1_, privacy_mode_), session1->server_id()); | 4332 EXPECT_EQ(QuicServerId(origin1_, privacy_mode_), session1->server_id()); |
| 4331 EXPECT_EQ(QuicServerId(origin2_, privacy_mode_), session2->server_id()); | 4333 EXPECT_EQ(QuicServerId(origin2_, privacy_mode_), session2->server_id()); |
| 4332 | 4334 |
| 4333 EXPECT_TRUE(AllDataConsumed()); | 4335 EXPECT_TRUE(AllDataConsumed()); |
| 4334 } | 4336 } |
| 4335 | 4337 |
| 4336 } // namespace test | 4338 } // namespace test |
| 4337 } // namespace net | 4339 } // namespace net |
| OLD | NEW |