| 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 // This class is useful for building a simple URLRequestContext. Most creators | 5 // This class is useful for building a simple URLRequestContext. Most creators |
| 6 // of new URLRequestContexts should use this helper class to construct it. Call | 6 // of new URLRequestContexts should use this helper class to construct it. Call |
| 7 // any configuration params, and when done, invoke Build() to construct the | 7 // any configuration params, and when done, invoke Build() to construct the |
| 8 // URLRequestContext. This URLRequestContext will own all its own storage. | 8 // URLRequestContext. This URLRequestContext will own all its own storage. |
| 9 // | 9 // |
| 10 // URLRequestContextBuilder and its associated params classes are initially | 10 // URLRequestContextBuilder and its associated params classes are initially |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 // These fields mirror those in HttpNetworkSession::Params; | 81 // These fields mirror those in HttpNetworkSession::Params; |
| 82 bool ignore_certificate_errors; | 82 bool ignore_certificate_errors; |
| 83 HostMappingRules* host_mapping_rules; | 83 HostMappingRules* host_mapping_rules; |
| 84 uint16 testing_fixed_http_port; | 84 uint16 testing_fixed_http_port; |
| 85 uint16 testing_fixed_https_port; | 85 uint16 testing_fixed_https_port; |
| 86 NextProtoVector next_protos; | 86 NextProtoVector next_protos; |
| 87 std::string trusted_spdy_proxy; | 87 std::string trusted_spdy_proxy; |
| 88 bool use_alternative_services; | 88 bool use_alternative_services; |
| 89 bool enable_quic; | 89 bool enable_quic; |
| 90 bool quic_store_server_configs_in_properties; | |
| 91 bool quic_delay_tcp_race; | |
| 92 int quic_max_number_of_lossy_connections; | |
| 93 float quic_packet_loss_threshold; | |
| 94 QuicTagVector quic_connection_options; | 90 QuicTagVector quic_connection_options; |
| 95 std::string ssl_session_cache_shard; | 91 std::string ssl_session_cache_shard; |
| 96 }; | 92 }; |
| 97 | 93 |
| 98 URLRequestContextBuilder(); | 94 URLRequestContextBuilder(); |
| 99 ~URLRequestContextBuilder(); | 95 ~URLRequestContextBuilder(); |
| 100 | 96 |
| 101 // Extracts the component pointers required to construct an HttpNetworkSession | 97 // Extracts the component pointers required to construct an HttpNetworkSession |
| 102 // and copies them into the Params used to create the session. This function | 98 // and copies them into the Params used to create the session. This function |
| 103 // should be used to ensure that a context and its associated | 99 // should be used to ensure that a context and its associated |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 const QuicTagVector& quic_connection_options) { | 191 const QuicTagVector& quic_connection_options) { |
| 196 http_network_session_params_.quic_connection_options = | 192 http_network_session_params_.quic_connection_options = |
| 197 quic_connection_options; | 193 quic_connection_options; |
| 198 } | 194 } |
| 199 | 195 |
| 200 void set_ssl_session_cache_shard(const std::string& ssl_session_cache_shard) { | 196 void set_ssl_session_cache_shard(const std::string& ssl_session_cache_shard) { |
| 201 http_network_session_params_.ssl_session_cache_shard = | 197 http_network_session_params_.ssl_session_cache_shard = |
| 202 ssl_session_cache_shard; | 198 ssl_session_cache_shard; |
| 203 } | 199 } |
| 204 | 200 |
| 205 void set_quic_store_server_configs_in_properties( | |
| 206 bool quic_store_server_configs_in_properties) { | |
| 207 http_network_session_params_.quic_store_server_configs_in_properties = | |
| 208 quic_store_server_configs_in_properties; | |
| 209 } | |
| 210 | |
| 211 void set_quic_delay_tcp_race(bool quic_delay_tcp_race) { | |
| 212 http_network_session_params_.quic_delay_tcp_race = quic_delay_tcp_race; | |
| 213 } | |
| 214 | |
| 215 void set_quic_max_number_of_lossy_connections( | |
| 216 int quic_max_number_of_lossy_connections) { | |
| 217 http_network_session_params_.quic_max_number_of_lossy_connections = | |
| 218 quic_max_number_of_lossy_connections; | |
| 219 } | |
| 220 | |
| 221 void set_quic_packet_loss_threshold(float quic_packet_loss_threshold) { | |
| 222 http_network_session_params_.quic_packet_loss_threshold = | |
| 223 quic_packet_loss_threshold; | |
| 224 } | |
| 225 | |
| 226 void set_throttling_enabled(bool throttling_enabled) { | 201 void set_throttling_enabled(bool throttling_enabled) { |
| 227 throttling_enabled_ = throttling_enabled; | 202 throttling_enabled_ = throttling_enabled; |
| 228 } | 203 } |
| 229 | 204 |
| 230 void set_backoff_enabled(bool backoff_enabled) { | 205 void set_backoff_enabled(bool backoff_enabled) { |
| 231 backoff_enabled_ = backoff_enabled; | 206 backoff_enabled_ = backoff_enabled; |
| 232 } | 207 } |
| 233 | 208 |
| 234 void SetCertVerifier(scoped_ptr<CertVerifier> cert_verifier); | 209 void SetCertVerifier(scoped_ptr<CertVerifier> cert_verifier); |
| 235 | 210 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 scoped_ptr<CertVerifier> cert_verifier_; | 283 scoped_ptr<CertVerifier> cert_verifier_; |
| 309 ScopedVector<URLRequestInterceptor> url_request_interceptors_; | 284 ScopedVector<URLRequestInterceptor> url_request_interceptors_; |
| 310 scoped_ptr<HttpServerProperties> http_server_properties_; | 285 scoped_ptr<HttpServerProperties> http_server_properties_; |
| 311 | 286 |
| 312 DISALLOW_COPY_AND_ASSIGN(URLRequestContextBuilder); | 287 DISALLOW_COPY_AND_ASSIGN(URLRequestContextBuilder); |
| 313 }; | 288 }; |
| 314 | 289 |
| 315 } // namespace net | 290 } // namespace net |
| 316 | 291 |
| 317 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ | 292 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ |
| OLD | NEW |