| 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 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 file_enabled_(false), | 206 file_enabled_(false), |
| 207 #endif | 207 #endif |
| 208 #if !defined(DISABLE_FTP_SUPPORT) | 208 #if !defined(DISABLE_FTP_SUPPORT) |
| 209 ftp_enabled_(false), | 209 ftp_enabled_(false), |
| 210 #endif | 210 #endif |
| 211 http_cache_enabled_(true), | 211 http_cache_enabled_(true), |
| 212 throttling_enabled_(false), | 212 throttling_enabled_(false), |
| 213 backoff_enabled_(false), | 213 backoff_enabled_(false), |
| 214 sdch_enabled_(false), | 214 sdch_enabled_(false), |
| 215 cookie_store_set_by_client_(false), | 215 cookie_store_set_by_client_(false), |
| 216 net_log_(nullptr) { | 216 net_log_(nullptr), |
| 217 socket_performance_watcher_factory_(nullptr) { |
| 217 } | 218 } |
| 218 | 219 |
| 219 URLRequestContextBuilder::~URLRequestContextBuilder() {} | 220 URLRequestContextBuilder::~URLRequestContextBuilder() {} |
| 220 | 221 |
| 221 void URLRequestContextBuilder::SetHttpNetworkSessionComponents( | 222 void URLRequestContextBuilder::SetHttpNetworkSessionComponents( |
| 222 const URLRequestContext* context, | 223 const URLRequestContext* context, |
| 223 HttpNetworkSession::Params* params) { | 224 HttpNetworkSession::Params* params) { |
| 224 params->host_resolver = context->host_resolver(); | 225 params->host_resolver = context->host_resolver(); |
| 225 params->cert_verifier = context->cert_verifier(); | 226 params->cert_verifier = context->cert_verifier(); |
| 226 params->transport_security_state = context->transport_security_state(); | 227 params->transport_security_state = context->transport_security_state(); |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 network_session_params.quic_prefer_aes = | 446 network_session_params.quic_prefer_aes = |
| 446 http_network_session_params_.quic_prefer_aes; | 447 http_network_session_params_.quic_prefer_aes; |
| 447 network_session_params.quic_migrate_sessions_early = | 448 network_session_params.quic_migrate_sessions_early = |
| 448 http_network_session_params_.quic_migrate_sessions_early; | 449 http_network_session_params_.quic_migrate_sessions_early; |
| 449 network_session_params.quic_disable_bidirectional_streams = | 450 network_session_params.quic_disable_bidirectional_streams = |
| 450 http_network_session_params_.quic_disable_bidirectional_streams; | 451 http_network_session_params_.quic_disable_bidirectional_streams; |
| 451 if (proxy_delegate_) { | 452 if (proxy_delegate_) { |
| 452 network_session_params.proxy_delegate = proxy_delegate_.get(); | 453 network_session_params.proxy_delegate = proxy_delegate_.get(); |
| 453 storage->set_proxy_delegate(std::move(proxy_delegate_)); | 454 storage->set_proxy_delegate(std::move(proxy_delegate_)); |
| 454 } | 455 } |
| 456 if (socket_performance_watcher_factory_) { |
| 457 network_session_params.socket_performance_watcher_factory = |
| 458 socket_performance_watcher_factory_; |
| 459 } |
| 455 | 460 |
| 456 storage->set_http_network_session( | 461 storage->set_http_network_session( |
| 457 base::WrapUnique(new HttpNetworkSession(network_session_params))); | 462 base::WrapUnique(new HttpNetworkSession(network_session_params))); |
| 458 | 463 |
| 459 std::unique_ptr<HttpTransactionFactory> http_transaction_factory; | 464 std::unique_ptr<HttpTransactionFactory> http_transaction_factory; |
| 460 if (http_cache_enabled_) { | 465 if (http_cache_enabled_) { |
| 461 std::unique_ptr<HttpCache::BackendFactory> http_cache_backend; | 466 std::unique_ptr<HttpCache::BackendFactory> http_cache_backend; |
| 462 if (http_cache_params_.type != HttpCacheParams::IN_MEMORY) { | 467 if (http_cache_params_.type != HttpCacheParams::IN_MEMORY) { |
| 463 BackendType backend_type = | 468 BackendType backend_type = |
| 464 http_cache_params_.type == HttpCacheParams::DISK | 469 http_cache_params_.type == HttpCacheParams::DISK |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 } | 527 } |
| 523 url_request_interceptors_.clear(); | 528 url_request_interceptors_.clear(); |
| 524 } | 529 } |
| 525 storage->set_job_factory(std::move(top_job_factory)); | 530 storage->set_job_factory(std::move(top_job_factory)); |
| 526 // TODO(willchan): Support sdch. | 531 // TODO(willchan): Support sdch. |
| 527 | 532 |
| 528 return std::move(context); | 533 return std::move(context); |
| 529 } | 534 } |
| 530 | 535 |
| 531 } // namespace net | 536 } // namespace net |
| OLD | NEW |