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/http/http_stream_factory_impl.h" | 5 #include "net/http/http_stream_factory_impl.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 TEST_F(HttpStreamFactoryTest, UsePreConnectIfNoZeroRTT) { | 1100 TEST_F(HttpStreamFactoryTest, UsePreConnectIfNoZeroRTT) { |
1101 for (int num_streams = 1; num_streams < 3; ++num_streams) { | 1101 for (int num_streams = 1; num_streams < 3; ++num_streams) { |
1102 GURL url = GURL("https://www.google.com"); | 1102 GURL url = GURL("https://www.google.com"); |
1103 | 1103 |
1104 // Set up QUIC as alternative_service. | 1104 // Set up QUIC as alternative_service. |
1105 HttpServerPropertiesImpl http_server_properties; | 1105 HttpServerPropertiesImpl http_server_properties; |
1106 const AlternativeService alternative_service(kProtoQUIC, url.host().c_str(), | 1106 const AlternativeService alternative_service(kProtoQUIC, url.host().c_str(), |
1107 url.IntPort()); | 1107 url.IntPort()); |
1108 AlternativeServiceInfoVector alternative_service_info_vector; | 1108 AlternativeServiceInfoVector alternative_service_info_vector; |
1109 base::Time expiration = base::Time::Now() + base::TimeDelta::FromDays(1); | 1109 base::Time expiration = base::Time::Now() + base::TimeDelta::FromDays(1); |
1110 alternative_service_info_vector.push_back( | 1110 alternative_service_info_vector.push_back(AlternativeServiceInfo( |
1111 AlternativeServiceInfo(alternative_service, expiration)); | 1111 alternative_service, expiration, |
| 1112 HttpNetworkSession::Params().quic_supported_versions)); |
1112 HostPortPair host_port_pair(alternative_service.host_port_pair()); | 1113 HostPortPair host_port_pair(alternative_service.host_port_pair()); |
1113 url::SchemeHostPort server("https", host_port_pair.host(), | 1114 url::SchemeHostPort server("https", host_port_pair.host(), |
1114 host_port_pair.port()); | 1115 host_port_pair.port()); |
1115 http_server_properties.SetAlternativeServices( | 1116 http_server_properties.SetAlternativeServices( |
1116 server, alternative_service_info_vector); | 1117 server, alternative_service_info_vector); |
1117 | 1118 |
1118 SpdySessionDependencies session_deps( | 1119 SpdySessionDependencies session_deps( |
1119 ProxyService::CreateFixed("http_proxy")); | 1120 ProxyService::CreateFixed("http_proxy")); |
1120 | 1121 |
1121 // Setup params to disable preconnect, but QUIC doesn't 0RTT. | 1122 // Setup params to disable preconnect, but QUIC doesn't 0RTT. |
(...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2187 params_.client_socket_factory = &socket_factory_; | 2188 params_.client_socket_factory = &socket_factory_; |
2188 session_.reset(new HttpNetworkSession(params_)); | 2189 session_.reset(new HttpNetworkSession(params_)); |
2189 session_->quic_stream_factory()->set_require_confirmation(false); | 2190 session_->quic_stream_factory()->set_require_confirmation(false); |
2190 } | 2191 } |
2191 | 2192 |
2192 void AddQuicAlternativeService() { | 2193 void AddQuicAlternativeService() { |
2193 const AlternativeService alternative_service(kProtoQUIC, "www.example.org", | 2194 const AlternativeService alternative_service(kProtoQUIC, "www.example.org", |
2194 443); | 2195 443); |
2195 AlternativeServiceInfoVector alternative_service_info_vector; | 2196 AlternativeServiceInfoVector alternative_service_info_vector; |
2196 base::Time expiration = base::Time::Now() + base::TimeDelta::FromDays(1); | 2197 base::Time expiration = base::Time::Now() + base::TimeDelta::FromDays(1); |
2197 alternative_service_info_vector.push_back( | 2198 alternative_service_info_vector.push_back(AlternativeServiceInfo( |
2198 AlternativeServiceInfo(alternative_service, expiration)); | 2199 alternative_service, expiration, |
| 2200 HttpNetworkSession::Params().quic_supported_versions)); |
2199 http_server_properties_.SetAlternativeServices( | 2201 http_server_properties_.SetAlternativeServices( |
2200 url::SchemeHostPort(default_url_), alternative_service_info_vector); | 2202 url::SchemeHostPort(default_url_), alternative_service_info_vector); |
2201 } | 2203 } |
2202 | 2204 |
2203 test::QuicTestPacketMaker& client_packet_maker() { | 2205 test::QuicTestPacketMaker& client_packet_maker() { |
2204 return client_packet_maker_; | 2206 return client_packet_maker_; |
2205 } | 2207 } |
2206 test::QuicTestPacketMaker& server_packet_maker() { | 2208 test::QuicTestPacketMaker& server_packet_maker() { |
2207 return server_packet_maker_; | 2209 return server_packet_maker_; |
2208 } | 2210 } |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2497 HttpNetworkSession::NORMAL_SOCKET_POOL))); | 2499 HttpNetworkSession::NORMAL_SOCKET_POOL))); |
2498 EXPECT_EQ(0, GetSocketPoolGroupCount(session->GetTransportSocketPool( | 2500 EXPECT_EQ(0, GetSocketPoolGroupCount(session->GetTransportSocketPool( |
2499 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); | 2501 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); |
2500 EXPECT_EQ(0, GetSocketPoolGroupCount(session->GetSSLSocketPool( | 2502 EXPECT_EQ(0, GetSocketPoolGroupCount(session->GetSSLSocketPool( |
2501 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); | 2503 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); |
2502 } | 2504 } |
2503 | 2505 |
2504 } // namespace | 2506 } // namespace |
2505 | 2507 |
2506 } // namespace net | 2508 } // namespace net |
OLD | NEW |