| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 QuicTagVector quic_connection_options; | 86 QuicTagVector quic_connection_options; |
| 87 CertVerifier* cert_verifier; |
| 87 }; | 88 }; |
| 88 | 89 |
| 89 URLRequestContextBuilder(); | 90 URLRequestContextBuilder(); |
| 90 ~URLRequestContextBuilder(); | 91 ~URLRequestContextBuilder(); |
| 91 | 92 |
| 92 // Extracts the component pointers required to construct an HttpNetworkSession | 93 // Extracts the component pointers required to construct an HttpNetworkSession |
| 93 // and copies them into the Params used to create the session. This function | 94 // and copies them into the Params used to create the session. This function |
| 94 // should be used to ensure that a context and its associated | 95 // should be used to ensure that a context and its associated |
| 95 // HttpNetworkSession are consistent. | 96 // HttpNetworkSession are consistent. |
| 96 static void SetHttpNetworkSessionComponents( | 97 static void SetHttpNetworkSessionComponents( |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 // Adjust |http_network_session_params_.next_protos| to enable SPDY and QUIC. | 182 // Adjust |http_network_session_params_.next_protos| to enable SPDY and QUIC. |
| 182 void SetSpdyAndQuicEnabled(bool spdy_enabled, | 183 void SetSpdyAndQuicEnabled(bool spdy_enabled, |
| 183 bool quic_enabled); | 184 bool quic_enabled); |
| 184 | 185 |
| 185 void set_quic_connection_options( | 186 void set_quic_connection_options( |
| 186 const QuicTagVector& quic_connection_options) { | 187 const QuicTagVector& quic_connection_options) { |
| 187 http_network_session_params_.quic_connection_options = | 188 http_network_session_params_.quic_connection_options = |
| 188 quic_connection_options; | 189 quic_connection_options; |
| 189 } | 190 } |
| 190 | 191 |
| 192 // Sets a CertVerifier for HttpNetworkSession::Param. |
| 193 void set_cert_verifier(CertVerifier* cert_verifier) { |
| 194 http_network_session_params_.cert_verifier = cert_verifier; |
| 195 } |
| 196 |
| 191 void set_throttling_enabled(bool throttling_enabled) { | 197 void set_throttling_enabled(bool throttling_enabled) { |
| 192 throttling_enabled_ = throttling_enabled; | 198 throttling_enabled_ = throttling_enabled; |
| 193 } | 199 } |
| 194 | 200 |
| 195 void set_backoff_enabled(bool backoff_enabled) { | 201 void set_backoff_enabled(bool backoff_enabled) { |
| 196 backoff_enabled_ = backoff_enabled; | 202 backoff_enabled_ = backoff_enabled; |
| 197 } | 203 } |
| 198 | 204 |
| 199 void SetInterceptors( | 205 void SetInterceptors( |
| 200 ScopedVector<URLRequestInterceptor> url_request_interceptors); | 206 ScopedVector<URLRequestInterceptor> url_request_interceptors); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 std::vector<SchemeFactory> extra_http_auth_handlers_; | 276 std::vector<SchemeFactory> extra_http_auth_handlers_; |
| 271 ScopedVector<URLRequestInterceptor> url_request_interceptors_; | 277 ScopedVector<URLRequestInterceptor> url_request_interceptors_; |
| 272 scoped_ptr<HttpServerProperties> http_server_properties_; | 278 scoped_ptr<HttpServerProperties> http_server_properties_; |
| 273 | 279 |
| 274 DISALLOW_COPY_AND_ASSIGN(URLRequestContextBuilder); | 280 DISALLOW_COPY_AND_ASSIGN(URLRequestContextBuilder); |
| 275 }; | 281 }; |
| 276 | 282 |
| 277 } // namespace net | 283 } // namespace net |
| 278 | 284 |
| 279 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ | 285 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ |
| OLD | NEW |