Chromium Code Reviews| 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/url_request/url_request_context_builder.h" | 5 #include "net/url_request/url_request_context_builder.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 169 URLRequestContextBuilder::HttpCacheParams::HttpCacheParams() | 169 URLRequestContextBuilder::HttpCacheParams::HttpCacheParams() |
| 170 : type(IN_MEMORY), | 170 : type(IN_MEMORY), |
| 171 max_size(0) {} | 171 max_size(0) {} |
| 172 URLRequestContextBuilder::HttpCacheParams::~HttpCacheParams() {} | 172 URLRequestContextBuilder::HttpCacheParams::~HttpCacheParams() {} |
| 173 | 173 |
| 174 URLRequestContextBuilder::HttpNetworkSessionParams::HttpNetworkSessionParams() | 174 URLRequestContextBuilder::HttpNetworkSessionParams::HttpNetworkSessionParams() |
| 175 : ignore_certificate_errors(false), | 175 : ignore_certificate_errors(false), |
| 176 host_mapping_rules(NULL), | 176 host_mapping_rules(NULL), |
| 177 testing_fixed_http_port(0), | 177 testing_fixed_http_port(0), |
| 178 testing_fixed_https_port(0), | 178 testing_fixed_https_port(0), |
| 179 trusted_spdy_proxy() {} | 179 use_alternate_protocols(true) { |
| 180 // By default, support SPDY and enable NPN. These are different defaults from | |
| 181 // HttpNetworkSession. | |
| 182 next_protos.push_back(kProtoHTTP11); | |
| 183 next_protos.push_back(kProtoSPDY3); | |
| 184 next_protos.push_back(kProtoSPDY31); | |
|
Ryan Hamilton
2014/05/29 19:54:38
So at some point, we're going to turn QUIC on by d
| |
| 185 } | |
| 180 | 186 |
| 181 URLRequestContextBuilder::HttpNetworkSessionParams::~HttpNetworkSessionParams() | 187 URLRequestContextBuilder::HttpNetworkSessionParams::~HttpNetworkSessionParams() |
| 182 {} | 188 {} |
| 183 | 189 |
| 184 URLRequestContextBuilder::SchemeFactory::SchemeFactory( | 190 URLRequestContextBuilder::SchemeFactory::SchemeFactory( |
| 185 const std::string& auth_scheme, | 191 const std::string& auth_scheme, |
| 186 net::HttpAuthHandlerFactory* auth_handler_factory) | 192 net::HttpAuthHandlerFactory* auth_handler_factory) |
| 187 : scheme(auth_scheme), factory(auth_handler_factory) { | 193 : scheme(auth_scheme), factory(auth_handler_factory) { |
| 188 } | 194 } |
| 189 | 195 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 270 context->transport_security_state(); | 276 context->transport_security_state(); |
| 271 network_session_params.proxy_service = context->proxy_service(); | 277 network_session_params.proxy_service = context->proxy_service(); |
| 272 network_session_params.ssl_config_service = | 278 network_session_params.ssl_config_service = |
| 273 context->ssl_config_service(); | 279 context->ssl_config_service(); |
| 274 network_session_params.http_auth_handler_factory = | 280 network_session_params.http_auth_handler_factory = |
| 275 context->http_auth_handler_factory(); | 281 context->http_auth_handler_factory(); |
| 276 network_session_params.network_delegate = network_delegate; | 282 network_session_params.network_delegate = network_delegate; |
| 277 network_session_params.http_server_properties = | 283 network_session_params.http_server_properties = |
| 278 context->http_server_properties(); | 284 context->http_server_properties(); |
| 279 network_session_params.net_log = context->net_log(); | 285 network_session_params.net_log = context->net_log(); |
| 286 | |
| 280 network_session_params.ignore_certificate_errors = | 287 network_session_params.ignore_certificate_errors = |
| 281 http_network_session_params_.ignore_certificate_errors; | 288 http_network_session_params_.ignore_certificate_errors; |
| 282 network_session_params.host_mapping_rules = | 289 network_session_params.host_mapping_rules = |
| 283 http_network_session_params_.host_mapping_rules; | 290 http_network_session_params_.host_mapping_rules; |
| 284 network_session_params.testing_fixed_http_port = | 291 network_session_params.testing_fixed_http_port = |
| 285 http_network_session_params_.testing_fixed_http_port; | 292 http_network_session_params_.testing_fixed_http_port; |
| 286 network_session_params.testing_fixed_https_port = | 293 network_session_params.testing_fixed_https_port = |
| 287 http_network_session_params_.testing_fixed_https_port; | 294 http_network_session_params_.testing_fixed_https_port; |
| 295 network_session_params.use_alternate_protocols = | |
| 296 http_network_session_params_.use_alternate_protocols; | |
| 288 network_session_params.trusted_spdy_proxy = | 297 network_session_params.trusted_spdy_proxy = |
| 289 http_network_session_params_.trusted_spdy_proxy; | 298 http_network_session_params_.trusted_spdy_proxy; |
| 299 network_session_params.next_protos = http_network_session_params_.next_protos; | |
| 290 | 300 |
| 291 HttpTransactionFactory* http_transaction_factory = NULL; | 301 HttpTransactionFactory* http_transaction_factory = NULL; |
| 292 if (http_cache_enabled_) { | 302 if (http_cache_enabled_) { |
| 293 network_session_params.server_bound_cert_service = | 303 network_session_params.server_bound_cert_service = |
| 294 context->server_bound_cert_service(); | 304 context->server_bound_cert_service(); |
| 295 HttpCache::BackendFactory* http_cache_backend = NULL; | 305 HttpCache::BackendFactory* http_cache_backend = NULL; |
| 296 if (http_cache_params_.type == HttpCacheParams::DISK) { | 306 if (http_cache_params_.type == HttpCacheParams::DISK) { |
| 297 http_cache_backend = new HttpCache::DefaultBackend( | 307 http_cache_backend = new HttpCache::DefaultBackend( |
| 298 DISK_CACHE, | 308 DISK_CACHE, |
| 299 net::CACHE_BACKEND_DEFAULT, | 309 net::CACHE_BACKEND_DEFAULT, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 337 #endif // !defined(DISABLE_FTP_SUPPORT) | 347 #endif // !defined(DISABLE_FTP_SUPPORT) |
| 338 | 348 |
| 339 storage->set_job_factory(job_factory); | 349 storage->set_job_factory(job_factory); |
| 340 | 350 |
| 341 // TODO(willchan): Support sdch. | 351 // TODO(willchan): Support sdch. |
| 342 | 352 |
| 343 return context; | 353 return context; |
| 344 } | 354 } |
| 345 | 355 |
| 346 } // namespace net | 356 } // namespace net |
| OLD | NEW |