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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 file_enabled_(false), | 204 file_enabled_(false), |
205 #endif | 205 #endif |
206 #if !defined(DISABLE_FTP_SUPPORT) | 206 #if !defined(DISABLE_FTP_SUPPORT) |
207 ftp_enabled_(false), | 207 ftp_enabled_(false), |
208 #endif | 208 #endif |
209 http_cache_enabled_(true), | 209 http_cache_enabled_(true), |
210 throttling_enabled_(false), | 210 throttling_enabled_(false), |
211 backoff_enabled_(false), | 211 backoff_enabled_(false), |
212 sdch_enabled_(false), | 212 sdch_enabled_(false), |
213 cookie_store_set_by_client_(false), | 213 cookie_store_set_by_client_(false), |
214 net_log_(nullptr) { | 214 net_log_(nullptr), |
| 215 socket_performance_watcher_factory_(nullptr) { |
215 } | 216 } |
216 | 217 |
217 URLRequestContextBuilder::~URLRequestContextBuilder() {} | 218 URLRequestContextBuilder::~URLRequestContextBuilder() {} |
218 | 219 |
219 void URLRequestContextBuilder::SetHttpNetworkSessionComponents( | 220 void URLRequestContextBuilder::SetHttpNetworkSessionComponents( |
220 const URLRequestContext* context, | 221 const URLRequestContext* context, |
221 HttpNetworkSession::Params* params) { | 222 HttpNetworkSession::Params* params) { |
222 params->host_resolver = context->host_resolver(); | 223 params->host_resolver = context->host_resolver(); |
223 params->cert_verifier = context->cert_verifier(); | 224 params->cert_verifier = context->cert_verifier(); |
224 params->transport_security_state = context->transport_security_state(); | 225 params->transport_security_state = context->transport_security_state(); |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 network_session_params.quic_prefer_aes = | 439 network_session_params.quic_prefer_aes = |
439 http_network_session_params_.quic_prefer_aes; | 440 http_network_session_params_.quic_prefer_aes; |
440 network_session_params.quic_migrate_sessions_early = | 441 network_session_params.quic_migrate_sessions_early = |
441 http_network_session_params_.quic_migrate_sessions_early; | 442 http_network_session_params_.quic_migrate_sessions_early; |
442 network_session_params.quic_disable_bidirectional_streams = | 443 network_session_params.quic_disable_bidirectional_streams = |
443 http_network_session_params_.quic_disable_bidirectional_streams; | 444 http_network_session_params_.quic_disable_bidirectional_streams; |
444 if (proxy_delegate_) { | 445 if (proxy_delegate_) { |
445 network_session_params.proxy_delegate = proxy_delegate_.get(); | 446 network_session_params.proxy_delegate = proxy_delegate_.get(); |
446 storage->set_proxy_delegate(std::move(proxy_delegate_)); | 447 storage->set_proxy_delegate(std::move(proxy_delegate_)); |
447 } | 448 } |
| 449 if (socket_performance_watcher_factory_) { |
| 450 network_session_params.socket_performance_watcher_factory = |
| 451 socket_performance_watcher_factory_; |
| 452 } |
448 | 453 |
449 storage->set_http_network_session( | 454 storage->set_http_network_session( |
450 base::WrapUnique(new HttpNetworkSession(network_session_params))); | 455 base::WrapUnique(new HttpNetworkSession(network_session_params))); |
451 | 456 |
452 std::unique_ptr<HttpTransactionFactory> http_transaction_factory; | 457 std::unique_ptr<HttpTransactionFactory> http_transaction_factory; |
453 if (http_cache_enabled_) { | 458 if (http_cache_enabled_) { |
454 std::unique_ptr<HttpCache::BackendFactory> http_cache_backend; | 459 std::unique_ptr<HttpCache::BackendFactory> http_cache_backend; |
455 if (http_cache_params_.type != HttpCacheParams::IN_MEMORY) { | 460 if (http_cache_params_.type != HttpCacheParams::IN_MEMORY) { |
456 BackendType backend_type = | 461 BackendType backend_type = |
457 http_cache_params_.type == HttpCacheParams::DISK | 462 http_cache_params_.type == HttpCacheParams::DISK |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 } | 520 } |
516 url_request_interceptors_.clear(); | 521 url_request_interceptors_.clear(); |
517 } | 522 } |
518 storage->set_job_factory(std::move(top_job_factory)); | 523 storage->set_job_factory(std::move(top_job_factory)); |
519 // TODO(willchan): Support sdch. | 524 // TODO(willchan): Support sdch. |
520 | 525 |
521 return std::move(context); | 526 return std::move(context); |
522 } | 527 } |
523 | 528 |
524 } // namespace net | 529 } // namespace net |
OLD | NEW |