| 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 19 matching lines...) Expand all Loading... |
| 30 #include "net/cookies/cookie_monster.h" | 30 #include "net/cookies/cookie_monster.h" |
| 31 #include "net/dns/host_resolver.h" | 31 #include "net/dns/host_resolver.h" |
| 32 #include "net/http/http_auth_handler_factory.h" | 32 #include "net/http/http_auth_handler_factory.h" |
| 33 #include "net/http/http_cache.h" | 33 #include "net/http/http_cache.h" |
| 34 #include "net/http/http_network_layer.h" | 34 #include "net/http/http_network_layer.h" |
| 35 #include "net/http/http_server_properties_impl.h" | 35 #include "net/http/http_server_properties_impl.h" |
| 36 #include "net/http/http_server_properties_manager.h" | 36 #include "net/http/http_server_properties_manager.h" |
| 37 #include "net/http/transport_security_persister.h" | 37 #include "net/http/transport_security_persister.h" |
| 38 #include "net/http/transport_security_state.h" | 38 #include "net/http/transport_security_state.h" |
| 39 #include "net/net_features.h" | 39 #include "net/net_features.h" |
| 40 #include "net/nqe/network_quality_estimator.h" |
| 40 #include "net/quic/chromium/quic_stream_factory.h" | 41 #include "net/quic/chromium/quic_stream_factory.h" |
| 41 #include "net/ssl/channel_id_service.h" | 42 #include "net/ssl/channel_id_service.h" |
| 42 #include "net/ssl/default_channel_id_store.h" | 43 #include "net/ssl/default_channel_id_store.h" |
| 43 #include "net/ssl/ssl_config_service_defaults.h" | 44 #include "net/ssl/ssl_config_service_defaults.h" |
| 44 #include "net/url_request/data_protocol_handler.h" | 45 #include "net/url_request/data_protocol_handler.h" |
| 45 #include "net/url_request/static_http_user_agent_settings.h" | 46 #include "net/url_request/static_http_user_agent_settings.h" |
| 46 #include "net/url_request/url_request_context.h" | 47 #include "net/url_request/url_request_context.h" |
| 47 #include "net/url_request/url_request_context_storage.h" | 48 #include "net/url_request/url_request_context_storage.h" |
| 48 #include "net/url_request/url_request_intercepting_job_factory.h" | 49 #include "net/url_request/url_request_intercepting_job_factory.h" |
| 49 #include "net/url_request/url_request_interceptor.h" | 50 #include "net/url_request/url_request_interceptor.h" |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 request_context->cert_transparency_verifier(); | 225 request_context->cert_transparency_verifier(); |
| 225 session_context->ct_policy_enforcer = request_context->ct_policy_enforcer(); | 226 session_context->ct_policy_enforcer = request_context->ct_policy_enforcer(); |
| 226 session_context->proxy_service = request_context->proxy_service(); | 227 session_context->proxy_service = request_context->proxy_service(); |
| 227 session_context->ssl_config_service = request_context->ssl_config_service(); | 228 session_context->ssl_config_service = request_context->ssl_config_service(); |
| 228 session_context->http_auth_handler_factory = | 229 session_context->http_auth_handler_factory = |
| 229 request_context->http_auth_handler_factory(); | 230 request_context->http_auth_handler_factory(); |
| 230 session_context->http_server_properties = | 231 session_context->http_server_properties = |
| 231 request_context->http_server_properties(); | 232 request_context->http_server_properties(); |
| 232 session_context->net_log = request_context->net_log(); | 233 session_context->net_log = request_context->net_log(); |
| 233 session_context->channel_id_service = request_context->channel_id_service(); | 234 session_context->channel_id_service = request_context->channel_id_service(); |
| 235 session_context->network_quality_provider = |
| 236 request_context->network_quality_estimator(); |
| 234 } | 237 } |
| 235 | 238 |
| 236 void URLRequestContextBuilder::EnableHttpCache(const HttpCacheParams& params) { | 239 void URLRequestContextBuilder::EnableHttpCache(const HttpCacheParams& params) { |
| 237 http_cache_enabled_ = true; | 240 http_cache_enabled_ = true; |
| 238 http_cache_params_ = params; | 241 http_cache_params_ = params; |
| 239 } | 242 } |
| 240 | 243 |
| 241 void URLRequestContextBuilder::DisableHttpCache() { | 244 void URLRequestContextBuilder::DisableHttpCache() { |
| 242 http_cache_enabled_ = false; | 245 http_cache_enabled_ = false; |
| 243 http_cache_params_ = HttpCacheParams(); | 246 http_cache_params_ = HttpCacheParams(); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 HttpNetworkSession::Context network_session_context; | 416 HttpNetworkSession::Context network_session_context; |
| 414 SetHttpNetworkSessionComponents(context.get(), &network_session_context); | 417 SetHttpNetworkSessionComponents(context.get(), &network_session_context); |
| 415 | 418 |
| 416 if (proxy_delegate_) { | 419 if (proxy_delegate_) { |
| 417 network_session_context.proxy_delegate = proxy_delegate_.get(); | 420 network_session_context.proxy_delegate = proxy_delegate_.get(); |
| 418 storage->set_proxy_delegate(std::move(proxy_delegate_)); | 421 storage->set_proxy_delegate(std::move(proxy_delegate_)); |
| 419 } | 422 } |
| 420 if (socket_performance_watcher_factory_) { | 423 if (socket_performance_watcher_factory_) { |
| 421 network_session_context.socket_performance_watcher_factory = | 424 network_session_context.socket_performance_watcher_factory = |
| 422 socket_performance_watcher_factory_; | 425 socket_performance_watcher_factory_; |
| 426 DCHECK(network_session_context.network_quality_provider); |
| 423 } | 427 } |
| 424 | 428 |
| 425 storage->set_http_network_session(base::MakeUnique<HttpNetworkSession>( | 429 storage->set_http_network_session(base::MakeUnique<HttpNetworkSession>( |
| 426 http_network_session_params_, network_session_context)); | 430 http_network_session_params_, network_session_context)); |
| 427 | 431 |
| 428 std::unique_ptr<HttpTransactionFactory> http_transaction_factory; | 432 std::unique_ptr<HttpTransactionFactory> http_transaction_factory; |
| 429 if (http_cache_enabled_) { | 433 if (http_cache_enabled_) { |
| 430 std::unique_ptr<HttpCache::BackendFactory> http_cache_backend; | 434 std::unique_ptr<HttpCache::BackendFactory> http_cache_backend; |
| 431 if (http_cache_params_.type != HttpCacheParams::IN_MEMORY) { | 435 if (http_cache_params_.type != HttpCacheParams::IN_MEMORY) { |
| 432 BackendType backend_type = | 436 BackendType backend_type = |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 std::unique_ptr<ProxyConfigService> proxy_config_service, | 502 std::unique_ptr<ProxyConfigService> proxy_config_service, |
| 499 URLRequestContext* url_request_context, | 503 URLRequestContext* url_request_context, |
| 500 HostResolver* host_resolver, | 504 HostResolver* host_resolver, |
| 501 NetworkDelegate* network_delegate, | 505 NetworkDelegate* network_delegate, |
| 502 NetLog* net_log) { | 506 NetLog* net_log) { |
| 503 return ProxyService::CreateUsingSystemProxyResolver( | 507 return ProxyService::CreateUsingSystemProxyResolver( |
| 504 std::move(proxy_config_service), net_log); | 508 std::move(proxy_config_service), net_log); |
| 505 } | 509 } |
| 506 | 510 |
| 507 } // namespace net | 511 } // namespace net |
| OLD | NEW |