| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 // These fields mirror those in HttpNetworkSession::Params; | 77 // These fields mirror those in HttpNetworkSession::Params; |
| 78 bool ignore_certificate_errors; | 78 bool ignore_certificate_errors; |
| 79 HostMappingRules* host_mapping_rules; | 79 HostMappingRules* host_mapping_rules; |
| 80 uint16 testing_fixed_http_port; | 80 uint16 testing_fixed_http_port; |
| 81 uint16 testing_fixed_https_port; | 81 uint16 testing_fixed_https_port; |
| 82 NextProtoVector next_protos; | 82 NextProtoVector next_protos; |
| 83 std::string trusted_spdy_proxy; | 83 std::string trusted_spdy_proxy; |
| 84 bool use_alternative_services; | 84 bool use_alternative_services; |
| 85 bool enable_quic; | 85 bool enable_quic; |
| 86 bool quic_store_server_configs_in_properties; |
| 87 bool quic_delay_tcp_race; |
| 88 int quic_max_number_of_lossy_connections; |
| 89 float quic_packet_loss_threshold; |
| 86 QuicTagVector quic_connection_options; | 90 QuicTagVector quic_connection_options; |
| 87 std::string ssl_session_cache_shard; | 91 std::string ssl_session_cache_shard; |
| 88 }; | 92 }; |
| 89 | 93 |
| 90 URLRequestContextBuilder(); | 94 URLRequestContextBuilder(); |
| 91 ~URLRequestContextBuilder(); | 95 ~URLRequestContextBuilder(); |
| 92 | 96 |
| 93 // Extracts the component pointers required to construct an HttpNetworkSession | 97 // Extracts the component pointers required to construct an HttpNetworkSession |
| 94 // 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 |
| 95 // 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... |
| 187 const QuicTagVector& quic_connection_options) { | 191 const QuicTagVector& quic_connection_options) { |
| 188 http_network_session_params_.quic_connection_options = | 192 http_network_session_params_.quic_connection_options = |
| 189 quic_connection_options; | 193 quic_connection_options; |
| 190 } | 194 } |
| 191 | 195 |
| 192 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) { |
| 193 http_network_session_params_.ssl_session_cache_shard = | 197 http_network_session_params_.ssl_session_cache_shard = |
| 194 ssl_session_cache_shard; | 198 ssl_session_cache_shard; |
| 195 } | 199 } |
| 196 | 200 |
| 201 void set_quic_store_server_configs_in_properties( |
| 202 bool quic_store_server_configs_in_properties) { |
| 203 http_network_session_params_.quic_store_server_configs_in_properties = |
| 204 quic_store_server_configs_in_properties; |
| 205 } |
| 206 |
| 207 void set_quic_delay_tcp_race(bool quic_delay_tcp_race) { |
| 208 http_network_session_params_.quic_delay_tcp_race = quic_delay_tcp_race; |
| 209 } |
| 210 |
| 211 void set_quic_max_number_of_lossy_connections( |
| 212 int quic_max_number_of_lossy_connections) { |
| 213 http_network_session_params_.quic_max_number_of_lossy_connections = |
| 214 quic_max_number_of_lossy_connections; |
| 215 } |
| 216 |
| 217 void set_quic_packet_loss_threshold(float quic_packet_loss_threshold) { |
| 218 http_network_session_params_.quic_packet_loss_threshold = |
| 219 quic_packet_loss_threshold; |
| 220 } |
| 221 |
| 197 void set_throttling_enabled(bool throttling_enabled) { | 222 void set_throttling_enabled(bool throttling_enabled) { |
| 198 throttling_enabled_ = throttling_enabled; | 223 throttling_enabled_ = throttling_enabled; |
| 199 } | 224 } |
| 200 | 225 |
| 201 void set_backoff_enabled(bool backoff_enabled) { | 226 void set_backoff_enabled(bool backoff_enabled) { |
| 202 backoff_enabled_ = backoff_enabled; | 227 backoff_enabled_ = backoff_enabled; |
| 203 } | 228 } |
| 204 | 229 |
| 205 void SetCertVerifier(scoped_ptr<CertVerifier> cert_verifier); | 230 void SetCertVerifier(scoped_ptr<CertVerifier> cert_verifier); |
| 206 | 231 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 scoped_ptr<CertVerifier> cert_verifier_; | 304 scoped_ptr<CertVerifier> cert_verifier_; |
| 280 ScopedVector<URLRequestInterceptor> url_request_interceptors_; | 305 ScopedVector<URLRequestInterceptor> url_request_interceptors_; |
| 281 scoped_ptr<HttpServerProperties> http_server_properties_; | 306 scoped_ptr<HttpServerProperties> http_server_properties_; |
| 282 | 307 |
| 283 DISALLOW_COPY_AND_ASSIGN(URLRequestContextBuilder); | 308 DISALLOW_COPY_AND_ASSIGN(URLRequestContextBuilder); |
| 284 }; | 309 }; |
| 285 | 310 |
| 286 } // namespace net | 311 } // namespace net |
| 287 | 312 |
| 288 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ | 313 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ |
| OLD | NEW |