| 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 enable_insecure_quic; | |
| 87 QuicTagVector quic_connection_options; | 86 QuicTagVector quic_connection_options; |
| 88 }; | 87 }; |
| 89 | 88 |
| 90 URLRequestContextBuilder(); | 89 URLRequestContextBuilder(); |
| 91 ~URLRequestContextBuilder(); | 90 ~URLRequestContextBuilder(); |
| 92 | 91 |
| 93 // Extracts the component pointers required to construct an HttpNetworkSession | 92 // Extracts the component pointers required to construct an HttpNetworkSession |
| 94 // and copies them into the Params used to create the session. This function | 93 // 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 | 94 // should be used to ensure that a context and its associated |
| 96 // HttpNetworkSession are consistent. | 95 // HttpNetworkSession are consistent. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 175 |
| 177 void set_transport_security_persister_path( | 176 void set_transport_security_persister_path( |
| 178 const base::FilePath& transport_security_persister_path) { | 177 const base::FilePath& transport_security_persister_path) { |
| 179 transport_security_persister_path_ = transport_security_persister_path; | 178 transport_security_persister_path_ = transport_security_persister_path; |
| 180 } | 179 } |
| 181 | 180 |
| 182 // Adjust |http_network_session_params_.next_protos| to enable SPDY and QUIC. | 181 // Adjust |http_network_session_params_.next_protos| to enable SPDY and QUIC. |
| 183 void SetSpdyAndQuicEnabled(bool spdy_enabled, | 182 void SetSpdyAndQuicEnabled(bool spdy_enabled, |
| 184 bool quic_enabled); | 183 bool quic_enabled); |
| 185 | 184 |
| 186 void set_enable_insecure_quic(bool enable_insecure_quic) { | |
| 187 http_network_session_params_.enable_insecure_quic = enable_insecure_quic; | |
| 188 } | |
| 189 | |
| 190 void set_quic_connection_options( | 185 void set_quic_connection_options( |
| 191 const QuicTagVector& quic_connection_options) { | 186 const QuicTagVector& quic_connection_options) { |
| 192 http_network_session_params_.quic_connection_options = | 187 http_network_session_params_.quic_connection_options = |
| 193 quic_connection_options; | 188 quic_connection_options; |
| 194 } | 189 } |
| 195 | 190 |
| 196 void set_throttling_enabled(bool throttling_enabled) { | 191 void set_throttling_enabled(bool throttling_enabled) { |
| 197 throttling_enabled_ = throttling_enabled; | 192 throttling_enabled_ = throttling_enabled; |
| 198 } | 193 } |
| 199 | 194 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 scoped_ptr<CertVerifier> cert_verifier_; | 273 scoped_ptr<CertVerifier> cert_verifier_; |
| 279 ScopedVector<URLRequestInterceptor> url_request_interceptors_; | 274 ScopedVector<URLRequestInterceptor> url_request_interceptors_; |
| 280 scoped_ptr<HttpServerProperties> http_server_properties_; | 275 scoped_ptr<HttpServerProperties> http_server_properties_; |
| 281 | 276 |
| 282 DISALLOW_COPY_AND_ASSIGN(URLRequestContextBuilder); | 277 DISALLOW_COPY_AND_ASSIGN(URLRequestContextBuilder); |
| 283 }; | 278 }; |
| 284 | 279 |
| 285 } // namespace net | 280 } // namespace net |
| 286 | 281 |
| 287 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ | 282 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ |
| OLD | NEW |